Class SequenceAlignment

  • Direct Known Subclasses:
    NeedlemanWunsch

    public abstract class SequenceAlignment
    extends java.lang.Object
    This Interface provides methods for the alignment of bio-sequences.
    Author:
    Andreas Dräger , Mark Schreiber
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract java.util.List alignAll​(SequenceIterator source, SequenceDB subjectDB)  
      static java.lang.StringBuffer formatOutput​(java.lang.String queryName, java.lang.String targetName, java.lang.String[] align, java.lang.String path, int queryStart, int queryEnd, long queryLength, int targetStart, int targetEnd, long targetLength, int editdistance, long time)
      This method provides a BLAST-like formated alignment from the given Strings, in which the sequence coordinates and the information "Query" or "Target", respectively is added to each line.
      abstract Alignment getAlignment​(SymbolList query, SymbolList subject)
      This method also performs a sequence alignment of the two given sequences but it returns an Alignment object instead of the score.
      abstract java.lang.String getAlignmentString()  
      abstract int pairwiseAlignment​(SymbolList query, SymbolList subject)
      Performs a pairwise sequence alignment of the two given sequences.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SequenceAlignment

        public SequenceAlignment()
    • Method Detail

      • getAlignmentString

        public abstract java.lang.String getAlignmentString()
                                                     throws java.lang.Exception
        Returns:
        a string representation of the alignment
        Throws:
        BioException
        java.lang.Exception
      • alignAll

        public abstract java.util.List alignAll​(SequenceIterator source,
                                                SequenceDB subjectDB)
                                         throws java.lang.Exception
        Parameters:
        source - a SequenceIterator containing a set of sequences to be aligned with
        subjectDB - the SequenceDB containing another set of sequences.
        Returns:
        a list containing the results of all single alignments performed by this method.
        Throws:
        NoSuchElementException
        java.lang.Exception
      • pairwiseAlignment

        public abstract int pairwiseAlignment​(SymbolList query,
                                              SymbolList subject)
                                       throws java.lang.Exception
        Performs a pairwise sequence alignment of the two given sequences.
        Parameters:
        query -
        subject -
        Returns:
        score of the alignment or the distance.
        Throws:
        java.lang.Exception
      • getAlignment

        public abstract Alignment getAlignment​(SymbolList query,
                                               SymbolList subject)
                                        throws java.lang.Exception
        This method also performs a sequence alignment of the two given sequences but it returns an Alignment object instead of the score.
        Parameters:
        query -
        subject -
        Returns:
        Alignment
        Throws:
        java.lang.Exception
      • formatOutput

        public static java.lang.StringBuffer formatOutput​(java.lang.String queryName,
                                                          java.lang.String targetName,
                                                          java.lang.String[] align,
                                                          java.lang.String path,
                                                          int queryStart,
                                                          int queryEnd,
                                                          long queryLength,
                                                          int targetStart,
                                                          int targetEnd,
                                                          long targetLength,
                                                          int editdistance,
                                                          long time)
        This method provides a BLAST-like formated alignment from the given Strings, in which the sequence coordinates and the information "Query" or "Target", respectively is added to each line. Each line contains 60 sequence characters including the gap symbols plus the meta information. There is one white line between two pairs of sequences.
        Parameters:
        queryName - name of the query sequence
        targetName - name of the target sequence
        align - a String-array, where the index 0 is the query sequence and index 1 the target sequence (for instance new String[] {myQuerySequence.seqString(), myTargetSequence.seqString()})
        path - the "path", that means a String containing white spaces and pipe ("|") symbols, which makes matches visible. The two strings in align have to have the same length and also the same length than this path.
        queryStart - the start position in the query, where the alignment starts. For example zero for normal Needleman-Wunsch-Alignments.
        queryEnd - the end position, that means the sequence coordinate, which is the last symbol of the query sequence. Counting starts at zero!
        queryLength - The length of the query sequence without gaps.
        targetStart - These are all the same for the target. Have a look at these above.
        targetEnd -
        targetLength -
        editdistance -
        time - The time in milliseconds, which was needed to generate the alignment.
        Returns:
        formated String.