- Type Parameters:
 S- each element of the alignmentProfileis of type SC- each element of anAlignedSequenceis aCompoundof type C
- All Superinterfaces:
 Iterable<AlignedSequence<S,C>> 
- All Known Subinterfaces:
 MutableProfile<S,,C> MutableProfilePair<S,,C> MutableSequencePair<S,,C> ProfilePair<S,,C> ProfileView<S,,C> SequencePair<S,C> 
- All Known Implementing Classes:
 SimpleProfile,SimpleProfilePair,SimpleSequencePair
public interface Profile<S extends Sequence<C>,C extends Compound> 
extends Iterable<AlignedSequence<S,C>> 
Defines a data structure for the results of sequence alignment.  Every 
List returned is unmodifiable unless
 the class implements the subinterface MutableProfile.- Author:
 - Mark Chapman, Paolo Pavan
 
- 
Nested Class Summary
Nested Classes - 
Method Summary
Modifier and TypeMethodDescriptiongetAlignedSequence(int listIndex) ReturnsAlignedSequenceat given index.getAlignedSequence(S sequence) Searches for the givenSequencewithin this alignment profile.Returns aListcontaining the individualAlignedSequences of this alignment.getAlignedSequences(int... listIndices) Returns aListcontaining some of the individualAlignedSequences of this alignment.getAlignedSequences(S... sequences) Returns aListcontaining some of the individualAlignedSequences of this alignment.getCompoundAt(int listIndex, int alignmentIndex) Returns theCompoundat row of given sequence and column of alignment index.getCompoundAt(S sequence, int alignmentIndex) Returns theCompoundat row of given sequence and column of alignment index.int[]getCompoundCountsAt(int alignmentIndex) Returns the number of eachCompoundin the given column for all compounds inCompoundSet.int[]getCompoundCountsAt(int alignmentIndex, List<C> compounds) Returns the number of eachCompoundin the given column only for compounds in the given list.getCompoundsAt(int alignmentIndex) ReturnsCompoundSetof allAlignedSequencesfloat[]getCompoundWeightsAt(int alignmentIndex) Returns the fraction of eachCompoundin the given column for all compounds inCompoundSet.float[]getCompoundWeightsAt(int alignmentIndex, List<C> compounds) Returns the fraction of eachCompoundin the given column only for compounds in the given list.intgetIndexOf(C compound) Searches for the givenCompoundwithin this alignment profile.int[]getIndicesAt(int alignmentIndex) Returns the indices in the originalSequences corresponding to the given column.intgetLastIndexOf(C compound) Searches for the givenCompoundwithin this alignment profile.intReturns the number of columns in the alignment profile.intgetSize()Returns the number of rows in this profile.getSubProfile(Location location) Returns aProfileViewwindowed to contain only the givenLocation.booleanhasGap(int alignmentIndex) Returns true if anyAlignedSequencehas a gap at the given index.booleanReturns true if anyAlignedSequenceis circular.toString()Returns a simple view of the alignment profile.toString(int width) Returns a formatted view of the alignment profile.toString(Profile.StringFormat format) Returns a formatted view of the alignment profile.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator 
- 
Method Details
- 
getAlignedSequence
ReturnsAlignedSequenceat given index.- Parameters:
 listIndex- index of sequence in profile- Returns:
 - desired sequence
 - Throws:
 IndexOutOfBoundsException- if listIndex < 1 or listIndex > number of sequences
 - 
getAlignedSequence
Searches for the givenSequencewithin this alignment profile. Returns the correspondingAlignedSequence.- Parameters:
 sequence- an originalSequence- Returns:
 - the corresponding 
AlignedSequence 
 - 
getAlignedSequences
Returns aListcontaining the individualAlignedSequences of this alignment.- Returns:
 - list of aligned sequences
 
 - 
getAlignedSequences
Returns aListcontaining some of the individualAlignedSequences of this alignment.- Parameters:
 listIndices- indices of sequences in profile- Returns:
 - list of aligned sequences
 
 - 
getAlignedSequences
Returns aListcontaining some of the individualAlignedSequences of this alignment.- Parameters:
 sequences- originalSequences- Returns:
 - list of aligned sequences
 
 - 
getCompoundAt
Returns theCompoundat row of given sequence and column of alignment index. If the given sequence has overlap, this will return theCompoundfrom the top row of the sequence.- Parameters:
 listIndex- index of sequence in profilealignmentIndex- column index within an alignment- Returns:
 - the sequence element
 - Throws:
 IndexOutOfBoundsException- if listIndex < 1, listIndex > number of sequences, alignmentIndex < 1, or alignmentIndex >getLength()
 - 
getCompoundAt
Returns theCompoundat row of given sequence and column of alignment index. If the given sequence has overlap, this will return theCompoundfrom the top row of the sequence.- Parameters:
 sequence- either anAlignedSequenceor an originalSequencealignmentIndex- column index within an alignment- Returns:
 - the sequence element
 - Throws:
 IndexOutOfBoundsException- if alignmentIndex < 1 or alignmentIndex >getLength()
 - 
getCompoundCountsAt
Returns the number of eachCompoundin the given column for all compounds inCompoundSet.- Parameters:
 alignmentIndex- column index within an alignment- Returns:
 - list of counts
 - Throws:
 IndexOutOfBoundsException- if alignmentIndex < 1 or alignmentIndex >getLength()
 - 
getCompoundCountsAt
Returns the number of eachCompoundin the given column only for compounds in the given list.- Parameters:
 alignmentIndex- column index within an alignmentcompounds- list of compounds to count- Returns:
 - corresponding list of counts
 - Throws:
 IndexOutOfBoundsException- if alignmentIndex < 1 or alignmentIndex >getLength()
 - 
getCompoundsAt
- Parameters:
 alignmentIndex- column index within an alignment- Returns:
 - the sequence elements
 - Throws:
 IndexOutOfBoundsException- if alignmentIndex < 1 or alignmentIndex >getLength()
 - 
getCompoundSet
ReturnsCompoundSetof allAlignedSequences- Returns:
 - set of 
Compounds in contained sequences 
 - 
getCompoundWeightsAt
Returns the fraction of eachCompoundin the given column for all compounds inCompoundSet.- Parameters:
 alignmentIndex- column index within an alignment- Returns:
 - list of fractional weights
 - Throws:
 IndexOutOfBoundsException- if alignmentIndex < 1 or alignmentIndex >getLength()
 - 
getCompoundWeightsAt
Returns the fraction of eachCompoundin the given column only for compounds in the given list.- Parameters:
 alignmentIndex- column index within an alignmentcompounds- list of compounds to count- Returns:
 - corresponding list of fractional weights
 - Throws:
 IndexOutOfBoundsException- if alignmentIndex < 1 or alignmentIndex >getLength()
 - 
getIndicesAt
Returns the indices in the originalSequences corresponding to the given column. All indices are 1-indexed and inclusive.- Parameters:
 alignmentIndex- column index within an alignment- Returns:
 - the sequence indices
 - Throws:
 IndexOutOfBoundsException- if alignmentIndex < 1 or alignmentIndex >getLength()
 - 
getIndexOf
Searches for the givenCompoundwithin this alignment profile. Returns column index nearest to the start of the alignment profile, or -1 if not found.- Parameters:
 compound- search element- Returns:
 - index of column containing search element nearest to the start of the alignment profile
 
 - 
getLastIndexOf
Searches for the givenCompoundwithin this alignment profile. Returns column index nearest to the end of the alignment profile, or -1 if not found.- Parameters:
 compound- search element- Returns:
 - index of column containing search element nearest to the end of the alignment profile
 
 - 
getLength
int getLength()Returns the number of columns in the alignment profile.- Returns:
 - the number of columns
 
 - 
getOriginalSequences
- Returns:
 - list of original sequences
 
 - 
getSize
int getSize()Returns the number of rows in this profile. If anyAlignedSequences are circular and overlap within the alignment, the returned size will be greater than the number of sequences, otherwise the numbers will be equal.- Returns:
 - number of rows
 
 - 
getSubProfile
Returns aProfileViewwindowed to contain only the givenLocation. This only includes theAlignedSequences which overlap the location.- Parameters:
 location- portion of profile to view- Returns:
 - a windowed view of the profile
 - Throws:
 IllegalArgumentException- if location is invalid
 - 
hasGap
Returns true if anyAlignedSequencehas a gap at the given index.- Parameters:
 alignmentIndex- column index within an alignment- Returns:
 - true if any 
AlignedSequencehas a gap at the given index - Throws:
 IndexOutOfBoundsException- if alignmentIndex < 1 or alignmentIndex >getLength()
 - 
isCircular
boolean isCircular()Returns true if anyAlignedSequenceis 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.- Returns:
 - true if any 
AlignedSequenceis circular 
 - 
toString
Returns a simple view of the alignment profile. This shows each sequence on a separate line (or multiple lines, if circular) and nothing more. This should result ingetSize()lines withgetLength()Compounds per line. - 
toString
Returns a formatted view of the alignment profile. This shows the start and end indices of the profile and each sequence for each group of lines of the given width. Each line may also be labeled.- Parameters:
 width- limit on the line length- Returns:
 - a formatted view of the alignment profile
 
 - 
toString
Returns a formatted view of the alignment profile. Details depend on the format given.- Parameters:
 format- output format- Returns:
 - a formatted view of the alignment profile
 
 
 -