|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.biojava3.alignment.SimpleProfile<S,C>
S - each element of the alignment Profile is of type SC - each element of an AlignedSequence is a Compound of type Cpublic class SimpleProfile<S extends Sequence<C>,C extends Compound>
Implements a data structure for the results of sequence alignment. Every List returned is unmodifiable.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.biojava3.alignment.template.Profile |
|---|
Profile.StringFormat |
| Field Summary | |
|---|---|
protected static SubstitutionMatrix<AminoAcidCompound> |
matrix
|
| Constructor Summary | |
|---|---|
protected |
SimpleProfile(AlignedSequence<S,C> query,
AlignedSequence<S,C> target)
Creates a pair profile for the given already aligned sequences. |
protected |
SimpleProfile(Profile<S,C> query,
Profile<S,C> target,
List<AlignedSequence.Step> sx,
List<AlignedSequence.Step> sy)
Creates a pair profile for the given profiles. |
|
SimpleProfile(S sequence)
Creates a profile from a single sequence. |
protected |
SimpleProfile(S query,
S target,
List<AlignedSequence.Step> sx,
int xb,
int xa,
List<AlignedSequence.Step> sy,
int yb,
int ya)
Creates a pair profile for the given sequences. |
| Method Summary | |
|---|---|
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. |
List<AlignedSequence<S,C>> |
getAlignedSequences()
Returns a List containing the individual AlignedSequences of this alignment. |
List<AlignedSequence<S,C>> |
getAlignedSequences(int... listIndices)
Returns a List containing some of the individual AlignedSequences of this alignment. |
List<AlignedSequence<S,C>> |
getAlignedSequences(S... sequences)
Returns a List containing some of the individual AlignedSequences 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,
List<C> compounds)
Returns the number of each Compound in the given column only for compounds in the given list. |
List<C> |
getCompoundsAt(int alignmentIndex)
Returns the Compound elements of the original Sequences at the given column. |
CompoundSet<C> |
getCompoundSet()
Returns CompoundSet of all AlignedSequences |
float[] |
getCompoundWeightsAt(int alignmentIndex)
Returns the fraction of each Compound in the given column for all compounds in CompoundSet. |
float[] |
getCompoundWeightsAt(int alignmentIndex,
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 Sequences 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. |
List<S> |
getOriginalSequences()
Returns a List containing the original Sequences 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. |
Iterator<AlignedSequence<S,C>> |
iterator()
|
String |
toString()
Returns a simple view of the alignment profile. |
String |
toString(int width)
Returns a formatted view of the alignment profile. |
String |
toString(Profile.StringFormat format)
Returns a formatted view of the alignment profile. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final SubstitutionMatrix<AminoAcidCompound> matrix
| Constructor Detail |
|---|
protected SimpleProfile(AlignedSequence<S,C> query,
AlignedSequence<S,C> target)
query - the first sequence of the pairtarget - the second sequence of the pair
IllegalArgumentException - if sequences differ in sizepublic SimpleProfile(S sequence)
sequence - sequence to seed profile
protected SimpleProfile(S query,
S target,
List<AlignedSequence.Step> sx,
int xb,
int xa,
List<AlignedSequence.Step> sy,
int yb,
int ya)
query - the first sequence of the pairtarget - the second sequence of the pairsx - lists whether the query sequence aligns a Compound or gap at each index of the alignmentxb - number of Compounds skipped in the query sequence before the aligned regionxa - number of Compounds skipped in the query sequence after the aligned regionsy - lists whether the target sequence aligns a Compound or gap at each index of the alignmentyb - number of Compounds skipped in the target sequence before the aligned regionya - number of Compounds skipped in the target sequence after the aligned region
IllegalArgumentException - if alignments differ in size or given sequences do not fit in alignments
protected SimpleProfile(Profile<S,C> query,
Profile<S,C> target,
List<AlignedSequence.Step> sx,
List<AlignedSequence.Step> sy)
query - the first profile of the pairtarget - the second profile of the pairsx - lists whether the query profile aligns a Compound or gap at each index of the alignmentsy - lists whether the target profile aligns a Compound or gap at each index of the alignment
IllegalArgumentException - if alignments differ in size or given profiles do not fit in alignments| Method Detail |
|---|
public AlignedSequence<S,C> getAlignedSequence(int listIndex)
ProfileAlignedSequence at given index.
getAlignedSequence in interface Profile<S extends Sequence<C>,C extends Compound>listIndex - index of sequence in profile
public AlignedSequence<S,C> getAlignedSequence(S sequence)
ProfileSequence within this alignment profile. Returns the corresponding
AlignedSequence.
getAlignedSequence in interface Profile<S extends Sequence<C>,C extends Compound>sequence - an original Sequence
AlignedSequencepublic List<AlignedSequence<S,C>> getAlignedSequences()
ProfileList containing the individual AlignedSequences of this alignment.
getAlignedSequences in interface Profile<S extends Sequence<C>,C extends Compound>public List<AlignedSequence<S,C>> getAlignedSequences(int... listIndices)
ProfileList containing some of the individual AlignedSequences of this alignment.
getAlignedSequences in interface Profile<S extends Sequence<C>,C extends Compound>listIndices - indices of sequences in profile
public List<AlignedSequence<S,C>> getAlignedSequences(S... sequences)
ProfileList containing some of the individual AlignedSequences of this alignment.
getAlignedSequences in interface Profile<S extends Sequence<C>,C extends Compound>sequences - original Sequences
public C getCompoundAt(int listIndex,
int alignmentIndex)
ProfileCompound 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.
getCompoundAt in interface Profile<S extends Sequence<C>,C extends Compound>listIndex - index of sequence in profilealignmentIndex - column index within an alignment
public C getCompoundAt(S sequence,
int alignmentIndex)
ProfileCompound 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.
getCompoundAt in interface Profile<S extends Sequence<C>,C extends Compound>sequence - either an AlignedSequence or an original SequencealignmentIndex - column index within an alignment
public int[] getCompoundCountsAt(int alignmentIndex)
ProfileCompound in the given column for all compounds in CompoundSet.
getCompoundCountsAt in interface Profile<S extends Sequence<C>,C extends Compound>alignmentIndex - column index within an alignment
public int[] getCompoundCountsAt(int alignmentIndex,
List<C> compounds)
ProfileCompound in the given column only for compounds in the given list.
getCompoundCountsAt in interface Profile<S extends Sequence<C>,C extends Compound>alignmentIndex - column index within an alignmentcompounds - list of compounds to count
public List<C> getCompoundsAt(int alignmentIndex)
ProfileCompound elements of the original Sequences at the given column.
getCompoundsAt in interface Profile<S extends Sequence<C>,C extends Compound>alignmentIndex - column index within an alignment
public CompoundSet<C> getCompoundSet()
ProfileCompoundSet of all AlignedSequences
getCompoundSet in interface Profile<S extends Sequence<C>,C extends Compound>Compounds in contained sequencespublic float[] getCompoundWeightsAt(int alignmentIndex)
ProfileCompound in the given column for all compounds in CompoundSet.
getCompoundWeightsAt in interface Profile<S extends Sequence<C>,C extends Compound>alignmentIndex - column index within an alignment
public float[] getCompoundWeightsAt(int alignmentIndex,
List<C> compounds)
ProfileCompound in the given column only for compounds in the given list.
getCompoundWeightsAt in interface Profile<S extends Sequence<C>,C extends Compound>alignmentIndex - column index within an alignmentcompounds - list of compounds to count
public int getIndexOf(C compound)
ProfileCompound within this alignment profile. Returns column index nearest to the
start of the alignment profile, or -1 if not found.
getIndexOf in interface Profile<S extends Sequence<C>,C extends Compound>compound - search element
public int[] getIndicesAt(int alignmentIndex)
ProfileSequences corresponding to the given column. All indices are
1-indexed and inclusive.
getIndicesAt in interface Profile<S extends Sequence<C>,C extends Compound>alignmentIndex - column index within an alignment
public int getLastIndexOf(C compound)
ProfileCompound within this alignment profile. Returns column index nearest to the end
of the alignment profile, or -1 if not found.
getLastIndexOf in interface Profile<S extends Sequence<C>,C extends Compound>compound - search element
public int getLength()
Profile
getLength in interface Profile<S extends Sequence<C>,C extends Compound>public List<S> getOriginalSequences()
ProfileList containing the original Sequences used for alignment.
getOriginalSequences in interface Profile<S extends Sequence<C>,C extends Compound>public int getSize()
ProfileAlignedSequences are circular and overlap within the
alignment, the returned size will be greater than the number of sequences, otherwise the numbers will be equal.
getSize in interface Profile<S extends Sequence<C>,C extends Compound>public ProfileView<S,C> getSubProfile(Location location)
ProfileProfileView windowed to contain only the given Location. This only includes the
AlignedSequences which overlap the location.
getSubProfile in interface Profile<S extends Sequence<C>,C extends Compound>location - portion of profile to view
public boolean hasGap(int alignmentIndex)
ProfileAlignedSequence has a gap at the given index.
hasGap in interface Profile<S extends Sequence<C>,C extends Compound>alignmentIndex - column index within an alignment
AlignedSequence has a gap at the given indexpublic boolean isCircular()
ProfileAlignedSequence 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.
isCircular in interface Profile<S extends Sequence<C>,C extends Compound>AlignedSequence is circularpublic String toString(int width)
Profile
toString in interface Profile<S extends Sequence<C>,C extends Compound>width - limit on the line length
public String toString(Profile.StringFormat format)
Profile
toString in interface Profile<S extends Sequence<C>,C extends Compound>format - output format
public String toString()
ProfileProfile.getSize() lines with Profile.getLength()
Compounds per line.
toString in interface Profile<S extends Sequence<C>,C extends Compound>toString in class Objectpublic Iterator<AlignedSequence<S,C>> iterator()
iterator in interface Iterable<AlignedSequence<S extends Sequence<C>,C extends Compound>>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||