Package com.compomics.util.nucleotide
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 Summary
Constructors Constructor Description NucleotideSequence()
Empty default constructorNucleotideSequence(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(String aFASTAString)
This constructor allows for the construction of a NucleotideSequence instance by passing a FASTA entry.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. -
Method Summary
Modifier and Type Method Description 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(PrintWriter aOut)
This method can be used to append this nucleotide sequence to the FASTA DB flatfile the PrintWriter points to.
-
Constructor Details
-
NucleotideSequence
public NucleotideSequence()Empty default constructor -
NucleotideSequence
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
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
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
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
This method reports on the nucleotide sequence.- Returns:
- NucleotideSequenceImpl with the sequence.
-
setSequence
This method allows the setting of a sequence.- Parameters:
aSequence
- NucleotideSequenceImpl with the sequence.
-
getHeader
This method reports on the nucleotide header.- Returns:
- Header with the header.
-
setHeader
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
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
This method translates the nucleotide sequence in six reading frames.- Returns:
- Protein[] with at most the six reading frames.
-