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> extends Object implements Serializable, Profile<S,C>
List
returned is unmodifiable.Profile.StringFormat
Modifier and Type | Field and Description |
---|---|
protected static SubstitutionMatrix<AminoAcidCompound> |
matrix |
Modifier | Constructor and Description |
---|---|
protected |
SimpleProfile(AlignedSequence<S,C> query,
AlignedSequence<S,C> target)
Creates a pair profile for the given already aligned sequences.
|
|
SimpleProfile(Collection<AlignedSequence<S,C>> alignedSequences)
Creates a profile for the 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.
|
Modifier and Type | Method and 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. |
List<AlignedSequence<S,C>> |
getAlignedSequences()
Returns a
List containing the individual AlignedSequence s of this alignment. |
List<AlignedSequence<S,C>> |
getAlignedSequences(int... listIndices)
Returns a
List containing some of the individual AlignedSequence s of this alignment. |
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,
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)
|
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,
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.
|
List<S> |
getOriginalSequences()
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
protected static final SubstitutionMatrix<AminoAcidCompound> matrix
protected SimpleProfile(AlignedSequence<S,C> query, AlignedSequence<S,C> target)
query
- the first sequence of the pairtarget
- the second sequence of the pairIllegalArgumentException
- if sequences differ in sizepublic SimpleProfile(S sequence)
sequence
- sequence to seed profileprotected 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 Compound
s skipped in the query sequence before the aligned regionxa
- number of Compound
s 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 Compound
s skipped in the target sequence before the aligned regionya
- number of Compound
s skipped in the target sequence after the aligned regionIllegalArgumentException
- if alignments differ in size or given sequences do not fit in alignmentsprotected 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 alignmentIllegalArgumentException
- if alignments differ in size or given profiles do not fit in alignmentspublic SimpleProfile(Collection<AlignedSequence<S,C>> alignedSequences)
alignedSequences
- the already aligned sequencesIllegalArgument
- if aligned sequences differ in length or
collection is empty.public AlignedSequence<S,C> getAlignedSequence(int listIndex)
Profile
AlignedSequence
at given index.public AlignedSequence<S,C> getAlignedSequence(S sequence)
Profile
Sequence
within this alignment profile. Returns the corresponding
AlignedSequence
.getAlignedSequence
in interface Profile<S extends Sequence<C>,C extends Compound>
sequence
- an original Sequence
AlignedSequence
public List<AlignedSequence<S,C>> getAlignedSequences()
Profile
List
containing the individual AlignedSequence
s of this alignment.public List<AlignedSequence<S,C>> getAlignedSequences(int... listIndices)
Profile
List
containing some of the individual AlignedSequence
s of this alignment.public List<AlignedSequence<S,C>> getAlignedSequences(S... sequences)
Profile
List
containing some of the individual AlignedSequence
s of this alignment.public C getCompoundAt(int listIndex, int alignmentIndex)
Profile
public C getCompoundAt(S sequence, int alignmentIndex)
Profile
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.getCompoundAt
in interface Profile<S extends Sequence<C>,C extends Compound>
sequence
- either an AlignedSequence
or an original Sequence
alignmentIndex
- column index within an alignmentpublic int[] getCompoundCountsAt(int alignmentIndex)
Profile
Compound
in the given column for all compounds in CompoundSet
.public int[] getCompoundCountsAt(int alignmentIndex, List<C> compounds)
Profile
Compound
in the given column only for compounds in the given list.public List<C> getCompoundsAt(int alignmentIndex)
Profile
public CompoundSet<C> getCompoundSet()
Profile
CompoundSet
of all AlignedSequence
spublic float[] getCompoundWeightsAt(int alignmentIndex)
Profile
Compound
in the given column for all compounds in CompoundSet
.public float[] getCompoundWeightsAt(int alignmentIndex, List<C> compounds)
Profile
Compound
in the given column only for compounds in the given list.public int getIndexOf(C compound)
Profile
Compound
within this alignment profile. Returns column index nearest to the
start of the alignment profile, or -1 if not found.public int[] getIndicesAt(int alignmentIndex)
Profile
Sequence
s corresponding to the given column. All indices are
1-indexed and inclusive.public int getLastIndexOf(C compound)
Profile
Compound
within this alignment profile. Returns column index nearest to the end
of the alignment profile, or -1 if not found.public int getLength()
Profile
public List<S> getOriginalSequences()
Profile
public int getSize()
Profile
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.public ProfileView<S,C> getSubProfile(Location location)
Profile
ProfileView
windowed to contain only the given Location
. This only includes the
AlignedSequence
s which overlap the location.public boolean hasGap(int alignmentIndex)
Profile
AlignedSequence
has a gap at the given index.public boolean isCircular()
Profile
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.isCircular
in interface Profile<S extends Sequence<C>,C extends Compound>
AlignedSequence
is circularpublic String toString(int width)
Profile
public String toString(Profile.StringFormat format)
Profile
public String toString()
Profile
Profile.getSize()
lines with Profile.getLength()
Compound
s per line.Copyright © 2000–2016 BioJava. All rights reserved.