Package org.biojava.nbio.core.sequence
Class DNASequence
- java.lang.Object
-
- org.biojava.nbio.core.sequence.template.AbstractSequence<NucleotideCompound>
-
- org.biojava.nbio.core.sequence.DNASequence
-
- All Implemented Interfaces:
Iterable<NucleotideCompound>
,Accessioned
,Sequence<NucleotideCompound>
- Direct Known Subclasses:
CDSSequence
,ChromosomeSequence
,ExonSequence
,GeneSequence
,IntronSequence
,StartCodonSequence
,StopCodonSequence
,TranscriptSequence
public class DNASequence extends AbstractSequence<NucleotideCompound>
This is class should model the attributes associated with a DNA sequence- Author:
- Scooter Willis
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DNASequence.DNAType
The type of DNA sequence-
Nested classes/interfaces inherited from class org.biojava.nbio.core.sequence.template.AbstractSequence
AbstractSequence.AnnotationType
-
-
Constructor Summary
Constructors Constructor Description DNASequence()
Shouldn't be used but makes it bean happyDNASequence(String seqString)
String is king and create a sequence from DNA with default DNA compound setDNASequence(String seqString, CompoundSet<NucleotideCompound> compoundSet)
Create a sequence from a string with user defined compound setDNASequence(SequenceReader<NucleotideCompound> proxyLoader)
Create a sequence where the actual storage of the sequence data is somewhere elseDNASequence(SequenceReader<NucleotideCompound> proxyLoader, CompoundSet<NucleotideCompound> compoundSet)
Create a sequence from a ProxySequencereader and user defined compound set
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SequenceView<NucleotideCompound>
getComplement()
Returns a Sequence which will complement every baseDNASequence.DNAType
getDNAType()
int
getGCCount()
Get the GC count in the DNA SequenceSequenceView<NucleotideCompound>
getReverse()
Returns a Sequence which runs in the current reverse orderSequenceView<NucleotideCompound>
getReverseComplement()
Delegates toAbstractSequence.getInverse()
for the reverse complementRNASequence
getRNASequence()
Return the RNASequence equivalent of the DNASequence using default Transcription Engine.RNASequence
getRNASequence(Frame frame)
Allows the user to pass in the Frame shift.RNASequence
getRNASequence(TranscriptionEngine engine)
Allow a user to pass in a rules engine to do the DNA to RNA translationRNASequence
getRNASequence(TranscriptionEngine engine, Frame frame)
void
setDNAType(DNASequence.DNAType dnaType)
-
Methods inherited from class org.biojava.nbio.core.sequence.template.AbstractSequence
addFeature, addFeature, addNote, countCompounds, equals, getAccession, getAnnotationType, getAsList, getBioBegin, getBioEnd, getComments, getCompoundAt, getCompoundSet, getDatabaseReferences, getDescription, getFeatureRetriever, getFeatures, getFeatures, getFeatures, getFeaturesByType, getFeaturesKeyWord, getIndexOf, getInverse, getLastIndexOf, getLength, getNotesList, getOriginalHeader, getParentSequence, getProxySequenceReader, getReferences, getSequenceAsString, getSequenceAsString, getSequenceScore, getSource, getSubSequence, getTaxonomy, getUserCollection, hashCode, initSequenceStorage, iterator, removeFeature, removeNote, setAccession, setAnnotationType, setBioBegin, setBioEnd, setComments, setCompoundSet, setDatabaseReferences, setDescription, setFeatureRetriever, setFeaturesKeyWord, setNotesList, setOriginalHeader, setParentSequence, setProxySequenceReader, setReferences, setSequenceScore, setSource, setTaxonomy, setUserCollection, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
DNASequence
public DNASequence()
Shouldn't be used but makes it bean happy
-
DNASequence
public DNASequence(String seqString) throws CompoundNotFoundException
String is king and create a sequence from DNA with default DNA compound set- Parameters:
seqString
-- Throws:
CompoundNotFoundException
-
DNASequence
public DNASequence(SequenceReader<NucleotideCompound> proxyLoader)
Create a sequence where the actual storage of the sequence data is somewhere else- Parameters:
proxyLoader
-
-
DNASequence
public DNASequence(String seqString, CompoundSet<NucleotideCompound> compoundSet) throws CompoundNotFoundException
Create a sequence from a string with user defined compound set- Parameters:
seqString
-compoundSet
-- Throws:
CompoundNotFoundException
-
DNASequence
public DNASequence(SequenceReader<NucleotideCompound> proxyLoader, CompoundSet<NucleotideCompound> compoundSet)
Create a sequence from a ProxySequencereader and user defined compound set- Parameters:
proxyLoader
-compoundSet
-
-
-
Method Detail
-
getRNASequence
public RNASequence getRNASequence()
Return the RNASequence equivalent of the DNASequence using default Transcription Engine. Not all species follow the same rules. If you don't know better use this method- Returns:
- RNA sequence
-
getRNASequence
public RNASequence getRNASequence(TranscriptionEngine engine)
Allow a user to pass in a rules engine to do the DNA to RNA translation- Parameters:
engine
-- Returns:
- RNA sequence
-
getRNASequence
public RNASequence getRNASequence(Frame frame)
Allows the user to pass in the Frame shift.- Parameters:
frame
-- Returns:
- rna sequence
-
getRNASequence
public RNASequence getRNASequence(TranscriptionEngine engine, Frame frame)
-
getGCCount
public int getGCCount()
Get the GC count in the DNA Sequence- Returns:
- GC count
-
getReverse
public SequenceView<NucleotideCompound> getReverse()
Returns a Sequence which runs in the current reverse order
-
getComplement
public SequenceView<NucleotideCompound> getComplement()
Returns a Sequence which will complement every base
-
getReverseComplement
public SequenceView<NucleotideCompound> getReverseComplement()
Delegates toAbstractSequence.getInverse()
for the reverse complement
-
getDNAType
public DNASequence.DNAType getDNAType()
- Returns:
- the dnaType
-
setDNAType
public void setDNAType(DNASequence.DNAType dnaType)
- Parameters:
dnaType
- the dnaType to set
-
-