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 Details

    • SingleProteinSequenceProvider

      public SingleProteinSequenceProvider()
      Empty default constructor.
    • SingleProteinSequenceProvider

      public SingleProteinSequenceProvider(Protein protein)
      Constructor.
      Parameters:
      protein - the protein
  • Method Details

    • getAccessions

      public Collection<String> getAccessions()
      Description copied from interface: SequenceProvider
      Returns all accessions loaded in the provider.
      Specified by:
      getAccessions in interface SequenceProvider
      Returns:
      all accessions loaded in the provider
    • getDecoyAccessions

      public HashSet<String> getDecoyAccessions()
      Description copied from interface: SequenceProvider
      Returns the decoy accessions.
      Specified by:
      getDecoyAccessions in interface SequenceProvider
      Returns:
      the decoy accessions
    • getSequence

      public String getSequence(String proteinAccession)
      Description copied from interface: SequenceProvider
      Returns the protein sequence for the given accession.
      Specified by:
      getSequence in interface SequenceProvider
      Parameters:
      proteinAccession - the accession of the protein
      Returns:
      the sequence of the protein
    • getSubsequence

      public String getSubsequence(String accession, int start, int end)
      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 interface SequenceProvider
      Parameters:
      accession - the accession of the protein
      start - the start index
      end - the end index
      Returns:
      the subsequence as string
    • getHeaderAsString

      public String getHeaderAsString(String proteinAccession)
      Description copied from interface: SequenceProvider
      Returns the FASTA header of the protein as found in the FASTA file.
      Specified by:
      getHeaderAsString in interface SequenceProvider
      Parameters:
      proteinAccession - the accession of the protein
      Returns:
      the FASTA header of the protein as found in the FASTA file