Package com.compomics.util.nucleotide
Class NucleotideSequenceImpl
java.lang.Object
com.compomics.util.nucleotide.NucleotideSequenceImpl
- All Implemented Interfaces:
Sequence
This class represents a nucleotide sequence (RNA or DNA).
- Author:
- Lennart Martens
-
Constructor Summary
ConstructorsConstructorDescriptionEmpty 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 TypeMethodDescriptionintThis method reports on the length of the current sequence.doublegetMass()This method will return the mass for the sequence.This method returns the reverse complementary strand for the sequence.This method will retrieve the sequence.voidsetSequence(String aSequence) This method will set the sequence.This method translates the specified nucleotidesequence into the six reading frames.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:
setSequencein 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:
getSequencein 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.
-