S
- each element of the alignment Profile
is of type SC
- each element of an AlignedSequence
is a Compound
of type Cjava.lang.Iterable<AlignedSequence<S,C>>
MutableProfile<S,C>
, MutableProfilePair<S,C>
, MutableSequencePair<S,C>
, ProfilePair<S,C>
, ProfileView<S,C>
, SequencePair<S,C>
SimpleProfile
, SimpleProfilePair
, SimpleSequencePair
public interface Profile<S extends Sequence<C>,C extends Compound> extends java.lang.Iterable<AlignedSequence<S,C>>
List
returned is unmodifiable unless
the class implements the subinterface MutableProfile
.Modifier and Type | Interface | Description |
---|---|---|
static class |
Profile.StringFormat |
List of output formats.
|
Modifier and Type | Method | Description |
---|---|---|
AlignedSequence<S,C> |
getAlignedSequence(int listIndex) |
Returns
AlignedSequence at given index. |
AlignedSequence<S,C> |
getAlignedSequence(S sequence) |
Searches for the given
Sequence within this alignment profile. |
java.util.List<AlignedSequence<S,C>> |
getAlignedSequences() |
Returns a
List containing the individual AlignedSequence s of this alignment. |
java.util.List<AlignedSequence<S,C>> |
getAlignedSequences(int... listIndices) |
Returns a
List containing some of the individual AlignedSequence s of this alignment. |
java.util.List<AlignedSequence<S,C>> |
getAlignedSequences(S... sequences) |
Returns a
List containing some of the individual AlignedSequence s of this alignment. |
C |
getCompoundAt(int listIndex,
int alignmentIndex) |
Returns the
Compound at row of given sequence and column of alignment index. |
C |
getCompoundAt(S sequence,
int alignmentIndex) |
Returns the
Compound at row of given sequence and column of alignment index. |
int[] |
getCompoundCountsAt(int alignmentIndex) |
Returns the number of each
Compound in the given column for all compounds in CompoundSet . |
int[] |
getCompoundCountsAt(int alignmentIndex,
java.util.List<C> compounds) |
Returns the number of each
Compound in the given column only for compounds in the given list. |
java.util.List<C> |
getCompoundsAt(int alignmentIndex) |
|
CompoundSet<C> |
getCompoundSet() |
Returns
CompoundSet of all AlignedSequence s |
float[] |
getCompoundWeightsAt(int alignmentIndex) |
Returns the fraction of each
Compound in the given column for all compounds in CompoundSet . |
float[] |
getCompoundWeightsAt(int alignmentIndex,
java.util.List<C> compounds) |
Returns the fraction of each
Compound in the given column only for compounds in the given list. |
int |
getIndexOf(C compound) |
Searches for the given
Compound within this alignment profile. |
int[] |
getIndicesAt(int alignmentIndex) |
Returns the indices in the original
Sequence s corresponding to the given column. |
int |
getLastIndexOf(C compound) |
Searches for the given
Compound within this alignment profile. |
int |
getLength() |
Returns the number of columns in the alignment profile.
|
java.util.List<S> |
getOriginalSequences() |
Returns a
List containing the original Sequence s used for alignment. |
int |
getSize() |
Returns the number of rows in this profile.
|
ProfileView<S,C> |
getSubProfile(Location location) |
Returns a
ProfileView windowed to contain only the given Location . |
boolean |
hasGap(int alignmentIndex) |
Returns true if any
AlignedSequence has a gap at the given index. |
boolean |
isCircular() |
Returns true if any
AlignedSequence is circular. |
java.lang.String |
toString() |
Returns a simple view of the alignment profile.
|
java.lang.String |
toString(int width) |
Returns a formatted view of the alignment profile.
|
java.lang.String |
toString(Profile.StringFormat format) |
Returns a formatted view of the alignment profile.
|
AlignedSequence<S,C> getAlignedSequence(int listIndex)
AlignedSequence
at given index.listIndex
- index of sequence in profilejava.lang.IndexOutOfBoundsException
- if listIndex < 1 or listIndex > number of sequencesAlignedSequence<S,C> getAlignedSequence(S sequence)
Sequence
within this alignment profile. Returns the corresponding
AlignedSequence
.sequence
- an original Sequence
AlignedSequence
java.util.List<AlignedSequence<S,C>> getAlignedSequences()
List
containing the individual AlignedSequence
s of this alignment.java.util.List<AlignedSequence<S,C>> getAlignedSequences(int... listIndices)
List
containing some of the individual AlignedSequence
s of this alignment.listIndices
- indices of sequences in profilejava.util.List<AlignedSequence<S,C>> getAlignedSequences(S... sequences)
List
containing some of the individual AlignedSequence
s of this alignment.sequences
- original Sequence
sC getCompoundAt(int listIndex, int alignmentIndex)
Compound
at row of given sequence and column of alignment index. If the given sequence has
overlap, this will return the Compound
from the top row of the sequence.listIndex
- index of sequence in profilealignmentIndex
- column index within an alignmentjava.lang.IndexOutOfBoundsException
- if listIndex < 1, listIndex > number of sequences, alignmentIndex < 1, or
alignmentIndex > getLength()
C getCompoundAt(S sequence, int alignmentIndex)
Compound
at row of given sequence and column of alignment index. If the given sequence has
overlap, this will return the Compound
from the top row of the sequence.sequence
- either an AlignedSequence
or an original Sequence
alignmentIndex
- column index within an alignmentjava.lang.IndexOutOfBoundsException
- if alignmentIndex < 1 or alignmentIndex > getLength()
int[] getCompoundCountsAt(int alignmentIndex)
Compound
in the given column for all compounds in CompoundSet
.alignmentIndex
- column index within an alignmentjava.lang.IndexOutOfBoundsException
- if alignmentIndex < 1 or alignmentIndex > getLength()
int[] getCompoundCountsAt(int alignmentIndex, java.util.List<C> compounds)
Compound
in the given column only for compounds in the given list.alignmentIndex
- column index within an alignmentcompounds
- list of compounds to countjava.lang.IndexOutOfBoundsException
- if alignmentIndex < 1 or alignmentIndex > getLength()
java.util.List<C> getCompoundsAt(int alignmentIndex)
alignmentIndex
- column index within an alignmentjava.lang.IndexOutOfBoundsException
- if alignmentIndex < 1 or alignmentIndex > getLength()
CompoundSet<C> getCompoundSet()
CompoundSet
of all AlignedSequence
sCompound
s in contained sequencesfloat[] getCompoundWeightsAt(int alignmentIndex)
Compound
in the given column for all compounds in CompoundSet
.alignmentIndex
- column index within an alignmentjava.lang.IndexOutOfBoundsException
- if alignmentIndex < 1 or alignmentIndex > getLength()
float[] getCompoundWeightsAt(int alignmentIndex, java.util.List<C> compounds)
Compound
in the given column only for compounds in the given list.alignmentIndex
- column index within an alignmentcompounds
- list of compounds to countjava.lang.IndexOutOfBoundsException
- if alignmentIndex < 1 or alignmentIndex > getLength()
int[] getIndicesAt(int alignmentIndex)
Sequence
s corresponding to the given column. All indices are
1-indexed and inclusive.alignmentIndex
- column index within an alignmentjava.lang.IndexOutOfBoundsException
- if alignmentIndex < 1 or alignmentIndex > getLength()
int getIndexOf(C compound)
Compound
within this alignment profile. Returns column index nearest to the
start of the alignment profile, or -1 if not found.compound
- search elementint getLastIndexOf(C compound)
Compound
within this alignment profile. Returns column index nearest to the end
of the alignment profile, or -1 if not found.compound
- search elementint getLength()
java.util.List<S> getOriginalSequences()
List
containing the original Sequence
s used for alignment.int getSize()
AlignedSequence
s are circular and overlap within the
alignment, the returned size will be greater than the number of sequences, otherwise the numbers will be equal.ProfileView<S,C> getSubProfile(Location location)
ProfileView
windowed to contain only the given Location
. This only includes the
AlignedSequence
s which overlap the location.location
- portion of profile to viewjava.lang.IllegalArgumentException
- if location is invalidboolean hasGap(int alignmentIndex)
AlignedSequence
has a gap at the given index.alignmentIndex
- column index within an alignmentAlignedSequence
has a gap at the given indexjava.lang.IndexOutOfBoundsException
- if alignmentIndex < 1 or alignmentIndex > getLength()
boolean isCircular()
AlignedSequence
is circular. If so, sequences may simply wrap around from the end
to the start of the alignment or they may contribute multiple overlapping lines to the profile.AlignedSequence
is circularjava.lang.String toString()
getSize()
lines with getLength()
Compound
s per line.toString
in class java.lang.Object
java.lang.String toString(int width)
width
- limit on the line lengthjava.lang.String toString(Profile.StringFormat format)
format
- output format