public class StringAlignment extends Object implements Comparable<StringAlignment>, Storable
Strings. It
contains the Strings that were aligned and expanded by
gap-symbols, and the edit-costs according to the employed
Costs instance.| Constructor and Description |
|---|
StringAlignment(double cost,
String... strings)
This constructor creates an instance storing the aligned Strings and the costs of the alignment.
|
StringAlignment(double cost,
String[] strings,
Result res)
This constructor creates an instance storing the aligned Strings and the costs of the alignment.
|
StringAlignment(StringBuffer xml)
Restores
StringAlignment object from its XML representation. |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(StringAlignment o) |
protected void |
fromXML(StringBuffer xml)
Parses the XML representation.
|
String |
getAlignedString(int index)
Returns the aligned
String with index index. |
Result |
getAnnotationResult()
Returns the annotation result.
|
double |
getCost()
Returns the costs.
|
int |
getLength()
This method return the length of the alignment.
|
int |
getNumberOfAlignedSequences()
Returns the number of sequences in this alignment.
|
String |
toString() |
String |
toString(int chunkSize,
int simplifyIdx,
List<String> annot)
This method returns a String representation of the alignment with a given chunk size.
|
StringBuffer |
toXML()
This method returns an XML representation as
StringBuffer of an
instance of the implementing class. |
public StringAlignment(StringBuffer xml) throws NonParsableException
StringAlignment object from its XML representation.xml - the XML representationNonParsableException - if the XML could not be parsedpublic StringAlignment(double cost,
String... strings)
cost - the cost of the alignmentstrings - the aligned and expanded Stringspublic StringAlignment(double cost,
String[] strings,
Result res)
cost - the cost of the alignmentstrings - the aligned and expanded Stringsres - a result describing the alignmentpublic Result getAnnotationResult()
public double getCost()
public int getNumberOfAlignedSequences()
public String getAlignedString(int index)
String with index index.public String toString(int chunkSize, int simplifyIdx, List<String> annot)
chunkSize symbols.chunkSize - the size of the chunkssimplifyIdx - if non-negative the alignment is given relative to the sequence with the corresponding index; i.e. match is represented by "." and mismatch by the corresponding symbolannot - a list of annotations for the aligned Strings, can be nullpublic int getLength()
public int compareTo(StringAlignment o)
compareTo in interface Comparable<StringAlignment>protected void fromXML(StringBuffer xml) throws NonParsableException
xml - the XML representationNonParsableException - if XML could not be parsedpublic StringBuffer toXML()
StorableStringBuffer of an
instance of the implementing class.