public class ReferenceSequenceAnnotationParser extends SplitSequenceAnnotationParser
SequenceAnnotationParser
that parses a ReferenceSequenceAnnotation
from the comment lines of a sequence.annot, annotationDelimiter, keyValueDelimiter
Constructor and Description |
---|
ReferenceSequenceAnnotationParser(String key,
AlphabetContainer alphabet,
String keyValueDelimiter,
String annotationDelimiter)
Creates a new
ReferenceSequenceAnnotationParser with user-specified delimiters. |
ReferenceSequenceAnnotationParser(String key,
AlphabetContainer alphabet,
String keyValueDelimiter,
String annotationDelimiter,
String delim)
Creates a new
ReferenceSequenceAnnotationParser with user-specified delimiters. |
Modifier and Type | Method and Description |
---|---|
protected void |
add(String type,
String identifier)
This method actually adds a
SequenceAnnotation to the internal list. |
String |
parseAnnotationToComment(char commentChar,
SequenceAnnotation... annotations)
This method returns a
String representation of the given
SequenceAnnotation s that can be used as comment line in a file. |
addToAnnotation, clearAnnotation, getCurrentAnnotation
public ReferenceSequenceAnnotationParser(String key, AlphabetContainer alphabet, String keyValueDelimiter, String annotationDelimiter, String delim) throws IllegalArgumentException
ReferenceSequenceAnnotationParser
with user-specified delimiters.key
- the key for the ReferenceSequenceAnnotation
alphabet
- the AlphabetContainer
of the reference sequencekeyValueDelimiter
- the delimiter between key and corresponding valueannotationDelimiter
- the delimiter between different SequenceAnnotation
sdelim
- the delimiter between symbols a the reference sequenceIllegalArgumentException
- if the delimiters are identicalpublic ReferenceSequenceAnnotationParser(String key, AlphabetContainer alphabet, String keyValueDelimiter, String annotationDelimiter) throws IllegalArgumentException
ReferenceSequenceAnnotationParser
with user-specified delimiters.key
- the key for the ReferenceSequenceAnnotation
alphabet
- the AlphabetContainer
of the reference sequencekeyValueDelimiter
- the delimiter between key and corresponding valueannotationDelimiter
- the delimiter between different SequenceAnnotation
sIllegalArgumentException
- if the delimiters are identicalprotected void add(String type, String identifier)
SplitSequenceAnnotationParser
SequenceAnnotation
to the internal list.add
in class SplitSequenceAnnotationParser
type
- the type of the SequenceAnnotation
identifier
- the identifier of the SequenceAnnotation
public String parseAnnotationToComment(char commentChar, SequenceAnnotation... annotations)
SequenceAnnotationParser
String
representation of the given
SequenceAnnotation
s that can be used as comment line in a file.
SequenceAnnotationParser.addToAnnotation(String)
.parseAnnotationToComment
in interface SequenceAnnotationParser
parseAnnotationToComment
in class SplitSequenceAnnotationParser
commentChar
- the char at the beginning of comment linesannotations
- the SequenceAnnotation
s to be parsedSequenceAnnotation
sDataSet.save(java.io.OutputStream, char, SequenceAnnotationParser)