org.biojava3.core.sequence
Class MultipleSequenceAlignment<S extends Sequence<C>,C extends Compound>

java.lang.Object
  extended by org.biojava3.core.sequence.MultipleSequenceAlignment<S,C>
All Implemented Interfaces:
LightweightProfile<S,C>

public class MultipleSequenceAlignment<S extends Sequence<C>,C extends Compound>
extends Object
implements LightweightProfile<S,C>

Implements a minimal data structure for reading and writing a sequence alignment. The full Profile data structure in the alignment module provides additional functionality.

Author:
Scooter Willis, Mark Chapman

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.biojava3.core.sequence.template.LightweightProfile
LightweightProfile.StringFormat
 
Constructor Summary
MultipleSequenceAlignment()
           
 
Method Summary
 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 0
 List<S> getAlignedSequences()
          Get the list of sequences
 List<C> getCompoundsAt(int alignmentIndex)
          Get a list of compounds at a sequence position
 CompoundSet<C> getCompoundSet()
          Get the Compounds defined in the first sequence
 int getLength()
          Get the length of the MSA where it is assumed that all sequence position
 int getSize()
          Get the number of sequences in the MSA
 boolean removeAlignedSequence(S sequence)
          Remove a sequence
 String toString()
          String representation of the MSA
 String toString(int width)
          Get a string representation of the MSA with a fixed width
 String toString(LightweightProfile.StringFormat format)
          Support for different MSA formats
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MultipleSequenceAlignment

public MultipleSequenceAlignment()
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:

getAlignedSequence

public S getAlignedSequence(int listIndex)
Uses bioIndex starting at 1 instead of 0

Specified by:
getAlignedSequence in interface LightweightProfile<S extends Sequence<C>,C extends Compound>
Parameters:
listIndex -
Returns:

getAlignedSequences

public List<S> getAlignedSequences()
Get the list of sequences

Specified by:
getAlignedSequences in interface LightweightProfile<S extends Sequence<C>,C extends Compound>
Returns:

getCompoundsAt

public List<C> getCompoundsAt(int alignmentIndex)
Get a list of compounds at a sequence position

Specified by:
getCompoundsAt in interface LightweightProfile<S extends Sequence<C>,C extends Compound>
Parameters:
alignmentIndex -
Returns:

getCompoundSet

public CompoundSet<C> getCompoundSet()
Get the Compounds defined in the first sequence

Specified by:
getCompoundSet in interface LightweightProfile<S extends Sequence<C>,C extends Compound>
Returns:

getLength

public int getLength()
Get the length of the MSA where it is assumed that all sequence position

Specified by:
getLength in interface LightweightProfile<S extends Sequence<C>,C extends Compound>
Returns:

getSize

public int getSize()
Get the number of sequences in the MSA

Specified by:
getSize in interface LightweightProfile<S extends Sequence<C>,C extends Compound>
Returns:

toString

public String toString(int width)
Get a string representation of the MSA with a fixed width

Specified by:
toString in interface LightweightProfile<S extends Sequence<C>,C extends Compound>
Parameters:
width -
Returns:

toString

public String toString(LightweightProfile.StringFormat format)
Support for different MSA formats

Specified by:
toString in interface LightweightProfile<S extends Sequence<C>,C extends Compound>
Parameters:
format -
Returns:

toString

public String toString()
String representation of the MSA

Specified by:
toString in interface LightweightProfile<S extends Sequence<C>,C extends Compound>
Overrides:
toString in class Object
Returns:


Copyright © 2010 BioJava. All Rights Reserved.