Package org.biojava.nbio.core.sequence
Class MultipleSequenceAlignment<S extends Sequence<C>,C extends Compound>
- java.lang.Object
-
- org.biojava.nbio.core.sequence.MultipleSequenceAlignment<S,C>
-
- All Implemented Interfaces:
LightweightProfile<S,C>
public class MultipleSequenceAlignment<S extends Sequence<C>,C extends Compound> extends java.lang.Object implements LightweightProfile<S,C>
Implements a minimal data structure for reading and writing a sequence alignment. The fullProfile
data structure in the alignment module provides additional functionality.- Author:
- Scooter Willis, Mark Chapman
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.biojava.nbio.core.sequence.template.LightweightProfile
LightweightProfile.StringFormat
-
-
Constructor Summary
Constructors Constructor Description MultipleSequenceAlignment()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAlignedSequence(S sequence)
A sequence that has been aligned to other sequences will have inserts.S
getAlignedSequence(int listIndex)
Uses bioIndex starting at 1 instead of 0java.util.List<S>
getAlignedSequences()
Get the list of sequencesjava.util.List<C>
getCompoundsAt(int alignmentIndex)
Get a list of compounds at a sequence positionCompoundSet<C>
getCompoundSet()
Get the Compounds defined in the first sequenceint
getLength()
Get the length of the MSA where it is assumed that all sequence positionint
getSize()
Get the number of sequences in the MSAboolean
removeAlignedSequence(S sequence)
Remove a sequencejava.lang.String
toString()
String representation of the MSAjava.lang.String
toString(int width)
Get a string representation of the MSA with a fixed widthjava.lang.String
toString(LightweightProfile.StringFormat format)
Support for different MSA formats
-
-
-
Method Detail
-
addAlignedSequence
public void addAlignedSequence(S sequence)
A sequence that has been aligned to other sequences will have inserts.- Parameters:
sequence
-
-
removeAlignedSequence
public boolean removeAlignedSequence(S sequence)
Remove a sequence- Parameters:
sequence
-- Returns:
- flag
-
getAlignedSequence
public S getAlignedSequence(int listIndex)
Uses bioIndex starting at 1 instead of 0- Specified by:
getAlignedSequence
in interfaceLightweightProfile<S extends Sequence<C>,C extends Compound>
- Parameters:
listIndex
-- Returns:
- sequence
-
getAlignedSequences
public java.util.List<S> getAlignedSequences()
Get the list of sequences- Specified by:
getAlignedSequences
in interfaceLightweightProfile<S extends Sequence<C>,C extends Compound>
- Returns:
- list of sequences
-
getCompoundsAt
public java.util.List<C> getCompoundsAt(int alignmentIndex)
Get a list of compounds at a sequence position- Specified by:
getCompoundsAt
in interfaceLightweightProfile<S extends Sequence<C>,C extends Compound>
- Parameters:
alignmentIndex
-- Returns:
- compounds
-
getCompoundSet
public CompoundSet<C> getCompoundSet()
Get the Compounds defined in the first sequence- Specified by:
getCompoundSet
in interfaceLightweightProfile<S extends Sequence<C>,C extends Compound>
- Returns:
- get compound set
-
getLength
public int getLength()
Get the length of the MSA where it is assumed that all sequence position
-
getSize
public int getSize()
Get the number of sequences in the MSA
-
toString
public java.lang.String toString(int width)
Get a string representation of the MSA with a fixed width
-
toString
public java.lang.String toString(LightweightProfile.StringFormat format)
Support for different MSA formats
-
-