com.compomics.util.nucleotide
Class NucleotideSequence

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

public class NucleotideSequence
extends java.lang.Object

This class combines a protein Header with a nucleotide sequence. Header is in Protein package for historical reasons.

Author:
Lennart Martens

Constructor Summary
NucleotideSequence(Header aHeader, NucleotideSequenceImpl aSequence)
          This constructor allows the passing of a Header, as well as an AASequenceImpl for this Protein.
NucleotideSequence(NucleotideSequenceImpl aSequence)
          This constructor requires a NucleotideSequenceImpl as argument.
NucleotideSequence(java.lang.String aFASTAString)
          This constructor allows for the construction of a NucleotideSequence instance by passing a FASTA entry.
NucleotideSequence(java.lang.String aHeader, java.lang.String aSequence)
          This constructor allows for the construction of a NucleotideSequence instance through the passing of a NucleotideSequence String and a Sequence String.
 
Method Summary
 Header getHeader()
          This method reports on the nucleotide header.
 long getLength()
          This method reports on the length of the sequence for the current nucleotide sequence.
 double getMass()
          This method returns the nucleotide sequence weight in Da.
 NucleotideSequenceImpl getSequence()
          This method reports on the nucleotide sequence.
 void setHeader(Header aHeader)
          This method sets the header.
 void setSequence(NucleotideSequenceImpl aSequence)
          This method allows the setting of a sequence.
 Protein[] translate()
          This method translates the nucleotide sequence in six reading frames.
 void writeToFASTAFile(java.io.PrintWriter aOut)
          This method can be used to append this nucleotide sequence to the FASTA DB flatfile the PrintWriter points to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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(java.lang.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(java.lang.String aHeader,
                          java.lang.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 Detail

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.


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(java.io.PrintWriter aOut)
                      throws java.io.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:
java.io.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.


Copyright © 2012. All Rights Reserved.