Class NucleotideSequenceImpl

java.lang.Object
com.compomics.util.nucleotide.NucleotideSequenceImpl
All Implemented Interfaces:
Sequence

public class NucleotideSequenceImpl
extends Object
implements Sequence
This class represents a nucleotide sequence (RNA or DNA).
Author:
Lennart Martens
  • Constructor Details

    • NucleotideSequenceImpl

      public NucleotideSequenceImpl()
      Empty default constructor
    • NucleotideSequenceImpl

      public NucleotideSequenceImpl​(String aSequence)
      This constructor allows the construction of an Object, wrapping a nucleotidesequence. The default codon usage table for translation will be used when translating.
      Parameters:
      aSequence - String with the nucleotide sequence.
    • NucleotideSequenceImpl

      public NucleotideSequenceImpl​(String aSequence, Properties aCodonUsageTable)
      This constructor allows the construction of an Object, wrapping a nucleotidesequence. Translation will be done using the specified codon usage table.
      Parameters:
      aSequence - String with the nucleotide sequence.
      aCodonUsageTable - Properties instance with the codon usage table (triplet is key, single-letter amino acid is value).
    • NucleotideSequenceImpl

      public NucleotideSequenceImpl​(String aSequence, String aCodonUsageTable)
      This constructor allows the construction of an Object, wrapping a nucleotidesequence. Translation will be done using the specified codon usage table.
      Parameters:
      aSequence - String with the nucleotide sequence.
      aCodonUsageTable - Properties instance with the codon usage table (triplet is key, single-letter amino acid is value).
  • Method Details

    • setSequence

      public void setSequence​(String aSequence)
      This method will set the sequence.
      Note that most implementations will also allow you to set this via the constructor.
      Specified by:
      setSequence in interface Sequence
      Parameters:
      aSequence - String with the sequence.
    • getLength

      public int getLength()
      This method reports on the length of the current sequence.
      Specified by:
      getLength in interface Sequence
      Returns:
      int with the length of the sequence.
    • getMass

      public double getMass()
      This method will return the mass for the sequence.
      Specified by:
      getMass in interface Sequence
      Returns:
      double with the mass.
    • getSequence

      public String getSequence()
      This method will retrieve the sequence.
      Specified by:
      getSequence in interface Sequence
      Returns:
      String with the sequence.
    • translate

      public AASequenceImpl[] translate()
      This method translates the specified nucleotidesequence into the six reading frames. If an unkown nucleic acid 'N' is part of the codon, amino acid 'X' will be inserted in the string.
      Returns:
      AASequenceImpl[] with the maximum of 6 translated protein sequences.
    • translateToStopCodonSeparatedEntries

      public Vector translateToStopCodonSeparatedEntries​(String aDatabaseIdentifier, String aShortOrganism)
      This method translates the specified nucleotidesequence into the six reading frames. While doing so, distinct entries are generated when stop codons are encountered in the nucleotide sequence. If an unkown nucleic acid 'N' is part of the codon, amino acid 'X' will be inserted in the string.
      Parameters:
      aDatabaseIdentifier - String to include the database origin in the protein entry annotation.
      aShortOrganism - String to include the organism origin in the protein entry annotation.
      Returns:
      Vector with the maximum of 6 translated reading frames. Each Vector element is a HashMap with all the proteins from one reading frame. HashMap structure : Key - Header Instance ; Value - Protein instance of the translation.
    • getReverseComplementary

      public String getReverseComplementary()
      This method returns the reverse complementary strand for the sequence.
      Returns:
      String with the reverse complementary sequence.