|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava3.alignment.SimpleAlignedSequence<S,C>
C
- each element of the Sequence
is a Compound
of type Cpublic class SimpleAlignedSequence<S extends Sequence<C>,C extends Compound>
Implements a data structure for a Sequence
within an alignment.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.biojava3.alignment.template.AlignedSequence |
---|
AlignedSequence.Step |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
void |
clearCache()
Nullifies cached arrays/objects. |
int |
countCompounds(C... compounds)
Returns the number of times we found a compound in the Sequence |
AccessionID |
getAccession()
Returns the AccessionID this location is currently bound with |
int |
getAlignmentIndexAt(int sequenceIndex)
Returns the column index within an alignment corresponding to the given index in the original Sequence . |
List<C> |
getAsList()
Returns the Sequence as a List of compounds |
C |
getCompoundAt(int alignmentIndex)
Returns the Compound at the given biological index |
CompoundSet<C> |
getCompoundSet()
Gets the compound set used to back this Sequence |
Point |
getEnd()
Returns the Point within an alignment of the last element of the original Sequence . |
int |
getIndexOf(C compound)
Scans through the Sequence looking for the first occurrence of the given compound |
SequenceView<C> |
getInverse()
Does the right thing to get the inverse of the current Sequence. |
int |
getLastIndexOf(C compound)
Scans through the Sequence looking for the last occurrence of the given compound |
int |
getLength()
Returns the length of the Sequence |
Location |
getLocationInAlignment()
Returns the Location of the original Sequence within an alignment. |
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()
Returns the String representation of the Sequence |
int |
getSequenceIndexAt(int alignmentIndex)
Returns the index in the original Sequence corresponding to the given index within an alignment. |
Point |
getStart()
Returns the Point within an alignment of the first element of the original Sequence . |
SequenceView<C> |
getSubSequence(Integer start,
Integer end)
Returns a portion of the sequence from the different positions. |
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() . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
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 alignment
IllegalArgumentException
- 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 Compound
s before a local alignmentnumAfter
- number of Compound
s after a local alignment
IllegalArgumentException
- 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 alignment
IllegalArgumentException
- 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 Compound
s before a local alignmentnumAfter
- number of Compound
s after a local alignment
IllegalArgumentException
- if given sequence does not fit in alignmentMethod Detail |
---|
public void clearCache()
AlignedSequence
clearCache
in interface AlignedSequence<S extends Sequence<C>,C extends Compound>
public int getAlignmentIndexAt(int sequenceIndex)
AlignedSequence
Sequence
.
Both indices are 1-indexed and inclusive.
getAlignmentIndexAt
in interface AlignedSequence<S extends Sequence<C>,C extends Compound>
sequenceIndex
- index in the original Sequence
public Point getEnd()
AlignedSequence
Point
within an alignment of the last element of the original Sequence
.
getEnd
in interface AlignedSequence<S extends Sequence<C>,C extends Compound>
Sequence
elementpublic Location getLocationInAlignment()
AlignedSequence
Location
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()
AlignedSequence
Location
information or from
gap Compound
s, which may not necessarily result in the same number.
getNumGaps
in interface AlignedSequence<S extends Sequence<C>,C extends Compound>
public S getOriginalSequence()
AlignedSequence
Sequence
before alignment.
getOriginalSequence
in interface AlignedSequence<S extends Sequence<C>,C extends Compound>
public int getOverlapCount()
AlignedSequence
Sequence
. 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)
AlignedSequence
Sequence
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 alignment
Sequence
public Point getStart()
AlignedSequence
Point
within an alignment of the first element of the original Sequence
.
getStart
in interface AlignedSequence<S extends Sequence<C>,C extends Compound>
Sequence
elementpublic boolean isCircular()
AlignedSequence
Sequence
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)
AlignedSequence
Sequence
has a gap at a particular alignment column.
isGap
in interface AlignedSequence<S extends Sequence<C>,C extends Compound>
alignmentIndex
- column index within an alignment
public int countCompounds(C... compounds)
Sequence
countCompounds
in interface Sequence<C extends Compound>
compounds
- Vargs of the compounds to count
public AccessionID getAccession()
Accessioned
getAccession
in interface Accessioned
public List<C> getAsList()
Sequence
getAsList
in interface Sequence<C extends Compound>
public C getCompoundAt(int alignmentIndex)
Sequence
getCompoundAt
in interface Sequence<C extends Compound>
alignmentIndex
- Biological index (1 to n)
public CompoundSet<C> getCompoundSet()
Sequence
getCompoundSet
in interface Sequence<C extends Compound>
public int getIndexOf(C compound)
Sequence
getIndexOf
in interface Sequence<C extends Compound>
compound
- Compounds to look for
public int getLastIndexOf(C compound)
Sequence
getLastIndexOf
in interface Sequence<C extends Compound>
compound
- Compounds to look for
public int getLength()
Sequence
getLength
in interface Sequence<C extends Compound>
public String getSequenceAsString()
Sequence
getSequenceAsString
in interface Sequence<C extends Compound>
public SequenceView<C> getSubSequence(Integer start, Integer end)
Sequence
getSubSequence
in interface Sequence<C extends Compound>
start
- Biological index start; must be greater than 0end
- Biological end; must be less than length + 1
public Iterator<C> iterator()
iterator
in interface Iterable<C extends Compound>
public String toString()
getSequenceAsString()
.
toString
in class Object
public SequenceView<C> getInverse()
Sequence
getInverse
in interface Sequence<C extends Compound>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |