Class NucleotideSequence

java.lang.Object
com.compomics.util.nucleotide.NucleotideSequence

public class NucleotideSequence
extends Object
This class combines a protein Header with a nucleotide sequence. Header is in Protein package for historical reasons.
Author:
Lennart Martens
  • Constructor Details

    • NucleotideSequence

      public NucleotideSequence()
      Empty default constructor
    • NucleotideSequence

      public NucleotideSequence​(NucleotideSequenceImpl aSequence)
      This constructor requires a NucleotideSequenceImpl as argument. THis will be the sequence around which the nucleotide will be built.
      Parameters:
      aSequence - NucleotideSequenceImpl around which this NucleotideSequence will be built.
    • NucleotideSequence

      public NucleotideSequence​(Header aHeader, NucleotideSequenceImpl aSequence)
      This constructor allows the passing of a Header, as well as an AASequenceImpl for this Protein.
      Parameters:
      aHeader - Header with the header information for this NucleotideSequence.
      aSequence - NucleotideSequenceImpl with the sequence for this NucleotideSequence.
    • NucleotideSequence

      public NucleotideSequence​(String aFASTAString)
      This constructor allows for the construction of a NucleotideSequence instance by passing a FASTA entry.
      Parameters:
      aFASTAString - String with the FASTA representation of the NucleotideSequence.
    • NucleotideSequence

      public NucleotideSequence​(String aHeader, String aSequence)
      This constructor allows for the construction of a NucleotideSequence instance through the passing of a NucleotideSequence String and a Sequence String. This is mainly useful to obtain a NucleotideSequence instance without a Header.
      Parameters:
      aHeader - String with the header (can be 'null').
      aSequence - String with the sequence.
  • Method Details

    • getSequence

      public NucleotideSequenceImpl getSequence()
      This method reports on the nucleotide sequence.
      Returns:
      NucleotideSequenceImpl with the sequence.
    • setSequence

      public void setSequence​(NucleotideSequenceImpl aSequence)
      This method allows the setting of a sequence.
      Parameters:
      aSequence - NucleotideSequenceImpl with the sequence.
    • getHeader

      public Header getHeader()
      This method reports on the nucleotide header.
      Returns:
      Header with the header.
    • setHeader

      public void setHeader​(Header aHeader)
      This method sets the header.
      Parameters:
      aHeader - the header
    • getLength

      public long getLength()
      This method reports on the length of the sequence for the current nucleotide sequence.
      Returns:
      long with the length of the sequence for the current nucleotide sequence.
    • getMass

      public double getMass()
      This method returns the nucleotide sequence weight in Da.
      Returns:
      double with the mass of the nucleotide sequence in Da.
    • writeToFASTAFile

      public void writeToFASTAFile​(PrintWriter aOut) throws IOException
      This method can be used to append this nucleotide sequence to the FASTA DB flatfile the PrintWriter points to.
      Parameters:
      aOut - PrintWriter to write the file to.
      Throws:
      IOException - when the writing failed.
    • translate

      public Protein[] translate()
      This method translates the nucleotide sequence in six reading frames.
      Returns:
      Protein[] with at most the six reading frames.