de.jstacs.data.sequences.annotation
Class ReferenceSequenceAnnotationParser
java.lang.Object
de.jstacs.data.sequences.annotation.SplitSequenceAnnotationParser
de.jstacs.data.sequences.annotation.ReferenceSequenceAnnotationParser
- All Implemented Interfaces:
- SequenceAnnotationParser
public class ReferenceSequenceAnnotationParser
- extends SplitSequenceAnnotationParser
This class implements an SequenceAnnotationParser
that parses a ReferenceSequenceAnnotation
from the comment lines of a sequence.
- Author:
- Jan Grau
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReferenceSequenceAnnotationParser
public ReferenceSequenceAnnotationParser(String key,
AlphabetContainer alphabet,
String keyValueDelimiter,
String annotationDelimiter,
String delim)
throws IllegalArgumentException
- Creates a new
ReferenceSequenceAnnotationParser
with user-specified delimiters.
- Parameters:
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 sequence
- Throws:
IllegalArgumentException
- if the delimiters are identical
ReferenceSequenceAnnotationParser
public ReferenceSequenceAnnotationParser(String key,
AlphabetContainer alphabet,
String keyValueDelimiter,
String annotationDelimiter)
throws IllegalArgumentException
- Creates a new
ReferenceSequenceAnnotationParser
with user-specified delimiters.
- Parameters:
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
s
- Throws:
IllegalArgumentException
- if the delimiters are identical
add
protected void add(String type,
String identifier)
- Description copied from class:
SplitSequenceAnnotationParser
- This method actually adds a
SequenceAnnotation
to the internal list.
- Overrides:
add
in class SplitSequenceAnnotationParser
- Parameters:
type
- the type of the SequenceAnnotation
identifier
- the identifier of the SequenceAnnotation
parseAnnotationToComment
public String parseAnnotationToComment(char commentChar,
SequenceAnnotation... annotations)
- Description copied from interface:
SequenceAnnotationParser
- This method returns a
String
representation of the given
SequenceAnnotation
s that can be used as comment line in a file.
Normally, the method should do the opposite of SequenceAnnotationParser.addToAnnotation(String)
.
- Specified by:
parseAnnotationToComment
in interface SequenceAnnotationParser
- Overrides:
parseAnnotationToComment
in class SplitSequenceAnnotationParser
- Parameters:
commentChar
- the char at the beginning of comment linesannotations
- the SequenceAnnotation
s to be parsed
- Returns:
- a String representing the given
SequenceAnnotation
s - See Also:
DataSet.save(java.io.OutputStream, char, SequenceAnnotationParser)