de.jstacs.data.sequences.annotation
Class MotifAnnotationParser

java.lang.Object
  extended by de.jstacs.data.sequences.annotation.SplitSequenceAnnotationParser
      extended by de.jstacs.data.sequences.annotation.MotifAnnotationParser
All Implemented Interfaces:
SequenceAnnotationParser

public class MotifAnnotationParser
extends SplitSequenceAnnotationParser

Annotation parser for MotifAnnotations.

Author:
Jan Grau

Field Summary
 
Fields inherited from class de.jstacs.data.sequences.annotation.SplitSequenceAnnotationParser
annot, annotationDelimiter, keyValueDelimiter
 
Constructor Summary
MotifAnnotationParser()
          Creates a new MotifAnnotationParser with default delimiters.
MotifAnnotationParser(String keyValueDelimiter, String annotationDelimiter)
          Creates a new MotifAnnotationParser with the supplied delimiters
 
Method Summary
protected  void add(String identifier, int position, int length, StrandedLocatedSequenceAnnotationWithLength.Strand strandedness)
          Adds the motif with identifier identifier at position position with length length and StrandedLocatedSequenceAnnotationWithLength.Strand strandedness
 void addToAnnotation(String unparsed)
          This method adds the unparsed String in some way to the SequenceAnnotation.
 String parseAnnotationToComment(char commentChar, SequenceAnnotation... annotations)
          This method returns a String representation of the given SequenceAnnotations that can be used as comment line in a file.
 
Methods inherited from class de.jstacs.data.sequences.annotation.SplitSequenceAnnotationParser
add, clearAnnotation, getCurrentAnnotation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MotifAnnotationParser

public MotifAnnotationParser()
Creates a new MotifAnnotationParser with default delimiters.

See Also:
SplitSequenceAnnotationParser.SplitSequenceAnnotationParser()

MotifAnnotationParser

public MotifAnnotationParser(String keyValueDelimiter,
                             String annotationDelimiter)
Creates a new MotifAnnotationParser with the supplied delimiters

Parameters:
keyValueDelimiter - the delimiter between key and value
annotationDelimiter - the delimiter between different annotations
Method Detail

addToAnnotation

public void addToAnnotation(String unparsed)
Description copied from interface: SequenceAnnotationParser
This method adds the unparsed String in some way to the SequenceAnnotation.

Specified by:
addToAnnotation in interface SequenceAnnotationParser
Overrides:
addToAnnotation in class SplitSequenceAnnotationParser
Parameters:
unparsed - the String containing the annotation

add

protected void add(String identifier,
                   int position,
                   int length,
                   StrandedLocatedSequenceAnnotationWithLength.Strand strandedness)
Adds the motif with identifier identifier at position position with length length and StrandedLocatedSequenceAnnotationWithLength.Strand strandedness

Parameters:
identifier - the identifier of the motif
position - the position of the motif
length - the length of the motif
strandedness - the strand of the motif

parseAnnotationToComment

public String parseAnnotationToComment(char commentChar,
                                       SequenceAnnotation... annotations)
Description copied from interface: SequenceAnnotationParser
This method returns a String representation of the given SequenceAnnotations 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 lines
annotations - the SequenceAnnotations to be parsed
Returns:
a String representing the given SequenceAnnotations
See Also:
DataSet.save(java.io.OutputStream, char, SequenceAnnotationParser)