dasp.model
Class Alignment

java.lang.Object
  extended by dasp.model.Alignment
Direct Known Subclasses:
ActiveSiteProfile

public class Alignment
extends Object


Field Summary
protected  List<String> alignment
           
protected  Align method
           
protected  Map<String,String> nameMap
           
protected  List<String> seqs
           
 
Constructor Summary
Alignment()
           
Alignment(List<String> sequences, Align alignmentMethod)
           
 
Method Summary
 void addSequence(String seq)
          addSequence can be used to add an addtional sequence to the alignment.
 void addSequences(List<String> seqList)
          addSequences can be used to add a list of addtional sequences to the alignment.
 void deleteSequence(String seq)
          deleteSequence can be used to remove a sequence from the alignment.
 void doAlign()
           
 List<String> getAlignment()
          Return the alignment itself as a list of strings with dashes inserted to account for insertions.
 String getAlignmentAsString()
          Return the alignment itself as a string with newlines between sequences and dashes inserted to account for insertions.
 String getAlignmentByIndex(int index)
          Return the alignment string for just one of the proteins in the alignment.
 String getAlignmentByName(String name)
          Return the alignment string for just one of the proteins in the alignment.
 String getHTMLAlignment()
          Return the alignment itself as an HTML-formatted string to account for insertions.
 double getIdentity()
          Return the % identity for all of the sequences in the alignment.
 double getScore()
          Return the alignment score that results from the alignment.
 List<String> getSequences()
          Return all of the sequences as FASTA-formatted strings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

method

protected Align method

seqs

protected List<String> seqs

nameMap

protected Map<String,String> nameMap

alignment

protected List<String> alignment
Constructor Detail

Alignment

public Alignment()

Alignment

public Alignment(List<String> sequences,
                 Align alignmentMethod)
Method Detail

doAlign

public void doAlign()

addSequence

public void addSequence(String seq)
addSequence can be used to add an addtional sequence to the alignment. Note that the alignment is *not* recalculated when you add a new sequence.

Parameters:
seq - the sequence to add as a FASTA-formatted string

deleteSequence

public void deleteSequence(String seq)
deleteSequence can be used to remove a sequence from the alignment. Note that the alignment is *not* recalculated when you remove a new sequence.

Parameters:
seq - the sequence to remove as a FASTA-formatted string

addSequences

public void addSequences(List<String> seqList)
addSequences can be used to add a list of addtional sequences to the alignment. Note that the alignment is *not* recalculated when you add new sequences.

Parameters:
seqList - the sequences to add as a list of FASTA-formatted strings

getSequences

public List<String> getSequences()
Return all of the sequences as FASTA-formatted strings

Returns:
FASTA-formatted sequences as a list

getIdentity

public double getIdentity()
Return the % identity for all of the sequences in the alignment.

Returns:
the % identity

getScore

public double getScore()
Return the alignment score that results from the alignment. Usually this will be the expectation value (e-value) or some other measure of the probably that this alignment could result from a random assembly of sequences.

Returns:
the score

getAlignmentAsString

public String getAlignmentAsString()
Return the alignment itself as a string with newlines between sequences and dashes inserted to account for insertions.

Returns:
the alignment

getAlignment

public List<String> getAlignment()
Return the alignment itself as a list of strings with dashes inserted to account for insertions.

Returns:
the alignment as a list of strings

getAlignmentByName

public String getAlignmentByName(String name)
Return the alignment string for just one of the proteins in the alignment. This assumes that each of the entries in the fasta file were named.

Parameters:
name - the name of this protein (usually from the fasta file)
Returns:
the alignment string for name

getAlignmentByIndex

public String getAlignmentByIndex(int index)
Return the alignment string for just one of the proteins in the alignment. This method does not assume that the sequences are named, just that they are ordered.

Parameters:
index - the index of the desired sequence
Returns:
the alignment string for name

getHTMLAlignment

public String getHTMLAlignment()
Return the alignment itself as an HTML-formatted string to account for insertions.

Returns:
the HTML formatted alignment