com.compomics.util.nucleotide
Class NucleotideSequenceImpl

java.lang.Object
  extended by com.compomics.util.nucleotide.NucleotideSequenceImpl
All Implemented Interfaces:
Sequence

public class NucleotideSequenceImpl
extends java.lang.Object
implements Sequence

This class represents a nucleotide sequence (RNA or DNA).

Author:
Lennart Martens

Constructor Summary
NucleotideSequenceImpl(java.lang.String aSequence)
          This constructor allows the construction of an Object, wrapping a nucleotidesequence.
NucleotideSequenceImpl(java.lang.String aSequence, java.util.Properties aCodonUsageTable)
          This constructor allows the construction of an Object, wrapping a nucleotidesequence.
NucleotideSequenceImpl(java.lang.String aSequence, java.lang.String aCodonUsageTable)
          This constructor allows the construction of an Object, wrapping a nucleotidesequence.
 
Method Summary
 int getLength()
          This method reports on the length of the current sequence.
 double getMass()
          This method will return the mass for the sequence.
 java.lang.String getReverseComplementary()
          This method returns the reverse complementary strand for the sequence.
 java.lang.String getSequence()
          This method will retrieve the sequence.
 void setSequence(java.lang.String aSequence)
          This method will set the sequence.
 AASequenceImpl[] translate()
          This method translates the specified nucleotidesequence into the six reading frames.
 java.util.Vector translateToStopCodonSeparatedEntries(java.lang.String aDatabaseIdentifier, java.lang.String aShortOrganism)
          This method translates the specified nucleotidesequence into the six reading frames.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NucleotideSequenceImpl

public NucleotideSequenceImpl(java.lang.String aSequence)
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

public NucleotideSequenceImpl(java.lang.String aSequence,
                              java.util.Properties aCodonUsageTable)
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

public NucleotideSequenceImpl(java.lang.String aSequence,
                              java.lang.String aCodonUsageTable)
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 Detail

setSequence

public void setSequence(java.lang.String aSequence)
This method will set the sequence.
Note that most implementations will also allow you to set this via the constructor.

Specified by:
setSequence in interface Sequence
Parameters:
aSequence - String with the sequence.

getLength

public int getLength()
This method reports on the length of the current sequence.

Specified by:
getLength in interface Sequence
Returns:
int with the length of the sequence.

getMass

public double getMass()
This method will return the mass for the sequence.

Specified by:
getMass in interface Sequence
Returns:
double with the mass.

getSequence

public java.lang.String getSequence()
This method will retrieve the sequence.

Specified by:
getSequence in interface Sequence
Returns:
String with the sequence.

translate

public AASequenceImpl[] 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 java.util.Vector translateToStopCodonSeparatedEntries(java.lang.String aDatabaseIdentifier,
                                                             java.lang.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

public java.lang.String getReverseComplementary()
This method returns the reverse complementary strand for the sequence.

Returns:
String with the reverse complementary sequence.


Copyright © 2012. All Rights Reserved.