Package org.biojava.nbio.core.sequence
Class GeneSequence
java.lang.Object
org.biojava.nbio.core.sequence.template.AbstractSequence<NucleotideCompound>
org.biojava.nbio.core.sequence.DNASequence
org.biojava.nbio.core.sequence.GeneSequence
- All Implemented Interfaces:
Iterable<NucleotideCompound>
,Accessioned
,Sequence<NucleotideCompound>
- Author:
- Scooter Willis
-
Nested Class Summary
Nested classes/interfaces inherited from class org.biojava.nbio.core.sequence.DNASequence
DNASequence.DNAType
Nested classes/interfaces inherited from class org.biojava.nbio.core.sequence.template.AbstractSequence
AbstractSequence.AnnotationType
-
Constructor Summary
ConstructorDescriptionGeneSequence
(ChromosomeSequence parentSequence, int begin, int end, Strand strand) A class that keeps track of the details of a GeneSequence which is difficult to properly model. -
Method Summary
Modifier and TypeMethodDescriptionaddExon
(AccessionID accession, int begin, int end) Add an ExonSequence mainly used to mark as a featureaddIntron
(AccessionID accession, int begin, int end) Add an Intron Currently used to mark an IntronSequence as a featurevoid
Once everything has been added to the gene sequence where you might have added exon sequences only then you can infer the intron sequences and add them.addTranscript
(AccessionID accession, int begin, int end) Add a transcription sequence to a gene which describes a ProteinSequenceGet the exons as an ArrayListGet the introns as an ArrayListint
Returns the length of the SequenceThe parent ChromosomeSequence which contains the actual DNA sequence dataTry to give method clarity where you want a DNASequence coding in the 5' to 3' direction Returns the DNASequence representative of the 5' and 3' reading based on strandA gene should have StrandgetTranscript
(String accession) Get the transcript sequence by accessionGet the collection of transcription sequences assigned to this generemoveExon
(String accession) Remove the exon sequenceremoveIntron
(String accession) Remove the intron by accessionremoveTranscript
(String accession) Remove the transcript sequence from the genevoid
Methods inherited from class org.biojava.nbio.core.sequence.DNASequence
getComplement, getDNAType, getGCCount, getReverse, getReverseComplement, getRNASequence, getRNASequence, getRNASequence, getRNASequence, main, setDNAType
Methods inherited from class org.biojava.nbio.core.sequence.template.AbstractSequence
addFeature, addFeature, addNote, countCompounds, getAccession, getAnnotationType, getAsList, getBioBegin, getBioEnd, getCompoundAt, getCompoundSet, getDatabaseReferences, getDescription, getFeatureRetriever, getFeatures, getFeatures, getFeatures, getFeaturesByType, getFeaturesKeyWord, getIndexOf, getInverse, getLastIndexOf, getNotesList, getOriginalHeader, getParentSequence, getProxySequenceReader, getSequenceAsString, getSequenceAsString, getSequenceScore, getSource, getSubSequence, getTaxonomy, getUserCollection, iterator, removeFeature, removeNote, setAccession, setAnnotationType, setBioBegin, setBioEnd, setCompoundSet, setDatabaseReferences, setDescription, setFeatureRetriever, setFeaturesKeyWord, setNotesList, setOriginalHeader, setParentSequence, setProxySequenceReader, setSequenceScore, setSource, setTaxonomy, setUserCollection, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
GeneSequence
A class that keeps track of the details of a GeneSequence which is difficult to properly model. Two important concepts that is difficult to make everything flexible but still work. You can have GFF features that only describe Exons or Exons/Introns or CDS regions and one or more Transcriptions. You can have exon sequences but that does not imply transcription to the actual protein. The GeneSequence will keep track of Exons and Introns but to get a Protein sequence you need to start with a TranscriptSequence and then add CDS sequences. This is also a key class in the biojava-3-genome module for reading and writing GFF3 files- Parameters:
parentDNASequence
-begin
-end
- inclusive of endstrand
- force a gene to have strand and transcription sequence will inherit
-
-
Method Details
-
getParentChromosomeSequence
The parent ChromosomeSequence which contains the actual DNA sequence data- Returns:
- Chromosome sequence
-
getLength
public int getLength()Description copied from interface:Sequence
Returns the length of the Sequence- Specified by:
getLength
in interfaceSequence<NucleotideCompound>
- Overrides:
getLength
in classAbstractSequence<NucleotideCompound>
-
addIntronsUsingExons
Once everything has been added to the gene sequence where you might have added exon sequences only then you can infer the intron sequences and add them. You may also have the case where you only added one or more TranscriptSequences and from that you can infer the exon sequences and intron sequences. Currently not implement- Throws:
Exception
-
getStrand
A gene should have Strand- Returns:
- the strand
-
setStrand
- Parameters:
strand
- the strand to set
-
getTranscript
Get the transcript sequence by accession- Parameters:
accession
-- Returns:
- the transcript
-
getTranscripts
Get the collection of transcription sequences assigned to this gene- Returns:
- transcripts
-
removeTranscript
Remove the transcript sequence from the gene- Parameters:
accession
-- Returns:
- transcriptsequence
-
addTranscript
Add a transcription sequence to a gene which describes a ProteinSequence- Parameters:
accession
-begin
-end
-- Returns:
- transcript sequence
- Throws:
Exception
- If the accession id is already used
-
removeIntron
Remove the intron by accession- Parameters:
accession
-- Returns:
- intron sequence
-
addIntron
Add an Intron Currently used to mark an IntronSequence as a feature- Parameters:
accession
-begin
-end
-- Returns:
- intron sequence
- Throws:
Exception
-
removeExon
Remove the exon sequence- Parameters:
accession
-- Returns:
- exon sequence
-
addExon
Add an ExonSequence mainly used to mark as a feature- Parameters:
accession
-begin
-end
-- Returns:
- exon sequence
- Throws:
Exception
-
getExonSequences
Get the exons as an ArrayList- Returns:
- exons
-
getIntronSequences
Get the introns as an ArrayList- Returns:
- introns
-
getSequence5PrimeTo3Prime
Try to give method clarity where you want a DNASequence coding in the 5' to 3' direction Returns the DNASequence representative of the 5' and 3' reading based on strand- Returns:
- dna sequence
-