Package com.compomics.util.nucleotide
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 Summary
Constructors Constructor Description NucleotideSequenceImpl()
Empty default constructorNucleotideSequenceImpl(String aSequence)
This constructor allows the construction of an Object, wrapping a nucleotidesequence.NucleotideSequenceImpl(String aSequence, String aCodonUsageTable)
This constructor allows the construction of an Object, wrapping a nucleotidesequence.NucleotideSequenceImpl(String aSequence, Properties aCodonUsageTable)
This constructor allows the construction of an Object, wrapping a nucleotidesequence. -
Method Summary
Modifier and Type Method Description int
getLength()
This method reports on the length of the current sequence.double
getMass()
This method will return the mass for the sequence.String
getReverseComplementary()
This method returns the reverse complementary strand for the sequence.String
getSequence()
This method will retrieve the sequence.void
setSequence(String aSequence)
This method will set the sequence.AASequenceImpl[]
translate()
This method translates the specified nucleotidesequence into the six reading frames.Vector
translateToStopCodonSeparatedEntries(String aDatabaseIdentifier, String aShortOrganism)
This method translates the specified nucleotidesequence into the six reading frames.
-
Constructor Details
-
NucleotideSequenceImpl
public NucleotideSequenceImpl()Empty default constructor -
NucleotideSequenceImpl
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
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
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
This method will set the sequence.
Note that most implementations will also allow you to set this via the constructor.- Specified by:
setSequence
in interfaceSequence
- Parameters:
aSequence
- String with the sequence.
-
getLength
public int getLength()This method reports on the length of the current sequence. -
getMass
public double getMass()This method will return the mass for the sequence. -
getSequence
This method will retrieve the sequence.- Specified by:
getSequence
in interfaceSequence
- Returns:
- String with the sequence.
-
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
This method returns the reverse complementary strand for the sequence.- Returns:
- String with the reverse complementary sequence.
-