public class SimpleAlignedSequence<S extends Sequence<C>,C extends Compound> extends Object implements AlignedSequence<S,C>
Sequence within an alignment.AlignedSequence.Step| Constructor and Description |
|---|
SimpleAlignedSequence(AlignedSequence<S,C> prev,
List<AlignedSequence.Step> steps)
Creates a new
AlignedSequence for the given AlignedSequence in a global alignment. |
SimpleAlignedSequence(AlignedSequence<S,C> prev,
List<AlignedSequence.Step> steps,
int numBefore,
int numAfter)
Creates a new
AlignedSequence for the given AlignedSequence in a local alignment. |
SimpleAlignedSequence(S original,
List<AlignedSequence.Step> steps)
Creates an
AlignedSequence for the given Sequence in a global alignment. |
SimpleAlignedSequence(S original,
List<AlignedSequence.Step> steps,
int numBefore,
int numAfter)
Creates an
AlignedSequence for the given Sequence in a local alignment. |
| Modifier and Type | Method and Description |
|---|---|
void |
clearCache()
Nullifies cached arrays/objects.
|
int |
countCompounds(C... compounds) |
AccessionID |
getAccession() |
int |
getAlignmentIndexAt(int sequenceIndex)
Returns the column index within an alignment corresponding to the given index in the original
Sequence. |
List<C> |
getAsList() |
C |
getCompoundAt(int alignmentIndex) |
CompoundSet<C> |
getCompoundSet() |
Point |
getEnd()
|
int |
getIndexOf(C compound) |
SequenceView<C> |
getInverse() |
int |
getLastIndexOf(C compound) |
int |
getLength() |
Location |
getLocationInAlignment()
|
int |
getNumGaps()
Returns number of gaps in the sequence.
|
S |
getOriginalSequence()
Returns the original
Sequence before alignment. |
int |
getOverlapCount()
Returns the maximum number of elements contributed to a column of an alignment by this
Sequence. |
String |
getSequenceAsString() |
int |
getSequenceIndexAt(int alignmentIndex)
Returns the index in the original
Sequence corresponding to the given index within an alignment. |
Point |
getStart()
|
SequenceView<C> |
getSubSequence(Integer start,
Integer end) |
boolean |
isCircular()
Returns true if this
Sequence wraps around from the last alignment column back to the first. |
boolean |
isGap(int alignmentIndex)
Returns true if this
Sequence has a gap at a particular alignment column. |
Iterator<C> |
iterator() |
String |
toString()
Provides standard Java language access to results of
getSequenceAsString(). |
public SimpleAlignedSequence(S original, List<AlignedSequence.Step> steps)
AlignedSequence for the given Sequence in a global alignment.original - the original Sequence before alignmentsteps - lists whether the sequence aligns a Compound or gap at each index of the alignmentIllegalArgumentException - if given sequence does not fit in alignmentpublic SimpleAlignedSequence(S original, List<AlignedSequence.Step> steps, int numBefore, int numAfter)
AlignedSequence for the given Sequence in a local alignment.original - the original Sequence before alignmentsteps - lists whether the sequence aligns a Compound or gap at each index of the alignmentnumBefore - number of Compounds before a local alignmentnumAfter - number of Compounds after a local alignmentIllegalArgumentException - if given sequence does not fit in alignmentpublic SimpleAlignedSequence(AlignedSequence<S,C> prev, List<AlignedSequence.Step> steps)
AlignedSequence for the given AlignedSequence in a global alignment.prev - the previous AlignedSequence before this alignmentsteps - lists whether the sequence aligns a Compound or gap at each index of the alignmentIllegalArgumentException - if given sequence does not fit in alignmentpublic SimpleAlignedSequence(AlignedSequence<S,C> prev, List<AlignedSequence.Step> steps, int numBefore, int numAfter)
AlignedSequence for the given AlignedSequence in a local alignment.prev - the previous AlignedSequence before this alignmentsteps - lists whether the sequence aligns a Compound or gap at each index of the alignmentnumBefore - number of Compounds before a local alignmentnumAfter - number of Compounds after a local alignmentIllegalArgumentException - if given sequence does not fit in alignmentpublic void clearCache()
AlignedSequenceclearCache in interface AlignedSequence<S extends Sequence<C>,C extends Compound>public int getAlignmentIndexAt(int sequenceIndex)
AlignedSequenceSequence.
Both indices are 1-indexed and inclusive.getAlignmentIndexAt in interface AlignedSequence<S extends Sequence<C>,C extends Compound>sequenceIndex - index in the original Sequencepublic Point getEnd()
AlignedSequencepublic Location getLocationInAlignment()
AlignedSequenceLocation of the original Sequence within an alignment. This provides access to
additional substructure beyond start and end points.getLocationInAlignment in interface AlignedSequence<S extends Sequence<C>,C extends Compound>public int getNumGaps()
AlignedSequenceLocation information or from
gap Compounds, which may not necessarily result in the same number.getNumGaps in interface AlignedSequence<S extends Sequence<C>,C extends Compound>public S getOriginalSequence()
AlignedSequenceSequence before alignment.getOriginalSequence in interface AlignedSequence<S extends Sequence<C>,C extends Compound>public int getOverlapCount()
AlignedSequenceSequence. If
this Sequence is circular, this number is >= 1. If not, this overlap count is definitely 1.getOverlapCount in interface AlignedSequence<S extends Sequence<C>,C extends Compound>public int getSequenceIndexAt(int alignmentIndex)
AlignedSequenceSequence corresponding to the given index within an alignment. Both
indices are 1-indexed and inclusive.getSequenceIndexAt in interface AlignedSequence<S extends Sequence<C>,C extends Compound>alignmentIndex - column index within an alignmentSequencepublic Point getStart()
AlignedSequencepublic boolean isCircular()
AlignedSequenceSequence wraps around from the last alignment column back to the first. This makes
overlap possible, but does not require an overlap count > 1.isCircular in interface AlignedSequence<S extends Sequence<C>,C extends Compound>public boolean isGap(int alignmentIndex)
AlignedSequenceSequence has a gap at a particular alignment column.public int countCompounds(C... compounds)
countCompounds in interface Sequence<C extends Compound>public AccessionID getAccession()
getAccession in interface Accessionedpublic C getCompoundAt(int alignmentIndex)
getCompoundAt in interface Sequence<C extends Compound>public CompoundSet<C> getCompoundSet()
getCompoundSet in interface Sequence<C extends Compound>public int getIndexOf(C compound)
getIndexOf in interface Sequence<C extends Compound>public int getLastIndexOf(C compound)
getLastIndexOf in interface Sequence<C extends Compound>public String getSequenceAsString()
getSequenceAsString in interface Sequence<C extends Compound>public SequenceView<C> getSubSequence(Integer start, Integer end)
getSubSequence in interface Sequence<C extends Compound>public String toString()
getSequenceAsString().public SequenceView<C> getInverse()
getInverse in interface Sequence<C extends Compound>Copyright © 2000-2015 BioJava. All Rights Reserved.