Class SingleProteinSequenceProvider
java.lang.Object
com.compomics.util.experiment.identification.protein_sequences.SingleProteinSequenceProvider
- All Implemented Interfaces:
SequenceProvider
public class SingleProteinSequenceProvider extends Object implements SequenceProvider
Sequence provider for a single protein.
- Author:
- Marc Vaudel
-
Constructor Summary
Constructors Constructor Description SingleProteinSequenceProvider()
Empty default constructor.SingleProteinSequenceProvider(Protein protein)
Constructor. -
Method Summary
Modifier and Type Method Description Collection<String>
getAccessions()
Returns all accessions loaded in the provider.HashSet<String>
getDecoyAccessions()
Returns the decoy accessions.String
getHeader(String proteinAccession)
Returns the FASTA header of the protein as found in the FASTA file.String
getSequence(String proteinAccession)
Returns the protein sequence for the given accession.String
getSubsequence(String accession, int start, int end)
Returns the subsequence of the sequence of a given protein.
-
Constructor Details
-
SingleProteinSequenceProvider
public SingleProteinSequenceProvider()Empty default constructor. -
SingleProteinSequenceProvider
Constructor.- Parameters:
protein
- the protein
-
-
Method Details
-
getAccessions
Description copied from interface:SequenceProvider
Returns all accessions loaded in the provider.- Specified by:
getAccessions
in interfaceSequenceProvider
- Returns:
- all accessions loaded in the provider
-
getDecoyAccessions
Description copied from interface:SequenceProvider
Returns the decoy accessions.- Specified by:
getDecoyAccessions
in interfaceSequenceProvider
- Returns:
- the decoy accessions
-
getSequence
Description copied from interface:SequenceProvider
Returns the protein sequence for the given accession.- Specified by:
getSequence
in interfaceSequenceProvider
- Parameters:
proteinAccession
- the accession of the protein- Returns:
- the sequence of the protein
-
getSubsequence
Description copied from interface:SequenceProvider
Returns the subsequence of the sequence of a given protein. Indexes are 0-based like for strings and no exception is thrown if indexes are out of bounds, the substring is trimmed.- Specified by:
getSubsequence
in interfaceSequenceProvider
- Parameters:
accession
- the accession of the proteinstart
- the start indexend
- the end index- Returns:
- the subsequence as string
-
getHeader
Description copied from interface:SequenceProvider
Returns the FASTA header of the protein as found in the FASTA file.- Specified by:
getHeader
in interfaceSequenceProvider
- Parameters:
proteinAccession
- the accession of the protein- Returns:
- the FASTA header of the protein as found in the FASTA file
-