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>
 
 public class GeneSequence extends DNASequence - Author:
- Scooter Willis
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.biojava.nbio.core.sequence.DNASequenceDNASequence.DNAType
 - 
Nested classes/interfaces inherited from class org.biojava.nbio.core.sequence.template.AbstractSequenceAbstractSequence.AnnotationType
 
- 
 - 
Constructor SummaryConstructors Constructor Description GeneSequence(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 SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description ExonSequenceaddExon(AccessionID accession, int begin, int end)Add an ExonSequence mainly used to mark as a featureIntronSequenceaddIntron(AccessionID accession, int begin, int end)Add an Intron Currently used to mark an IntronSequence as a featurevoidaddIntronsUsingExons()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.TranscriptSequenceaddTranscript(AccessionID accession, int begin, int end)Add a transcription sequence to a gene which describes a ProteinSequenceArrayList<ExonSequence>getExonSequences()Get the exons as an ArrayListArrayList<IntronSequence>getIntronSequences()Get the introns as an ArrayListintgetLength()Returns the length of the SequenceChromosomeSequencegetParentChromosomeSequence()The parent ChromosomeSequence which contains the actual DNA sequence dataDNASequencegetSequence5PrimeTo3Prime()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 strandStrandgetStrand()A gene should have StrandTranscriptSequencegetTranscript(String accession)Get the transcript sequence by accessionLinkedHashMap<String,TranscriptSequence>getTranscripts()Get the collection of transcription sequences assigned to this geneExonSequenceremoveExon(String accession)Remove the exon sequenceIntronSequenceremoveIntron(String accession)Remove the intron by accessionTranscriptSequenceremoveTranscript(String accession)Remove the transcript sequence from the genevoidsetStrand(Strand strand)- 
Methods inherited from class org.biojava.nbio.core.sequence.DNASequencegetComplement, getDNAType, getGCCount, getReverse, getReverseComplement, getRNASequence, getRNASequence, getRNASequence, getRNASequence, main, setDNAType
 - 
Methods inherited from class org.biojava.nbio.core.sequence.template.AbstractSequenceaddFeature, addFeature, addNote, countCompounds, equals, getAccession, getAnnotationType, getAsList, getBioBegin, getBioEnd, getComments, getCompoundAt, getCompoundSet, getDatabaseReferences, getDescription, getFeatureRetriever, getFeatures, getFeatures, getFeatures, getFeaturesByType, getFeaturesKeyWord, getIndexOf, getInverse, getLastIndexOf, getNotesList, getOriginalHeader, getParentSequence, getProxySequenceReader, getReferences, getSequenceAsString, getSequenceAsString, getSequenceScore, getSource, getSubSequence, getTaxonomy, getUserCollection, hashCode, 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.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface java.lang.IterableforEach, spliterator
 
- 
 
- 
- 
- 
Constructor Detail- 
GeneSequencepublic GeneSequence(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. 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 end
- strand- force a gene to have strand and transcription sequence will inherit
 
 
- 
 - 
Method Detail- 
getParentChromosomeSequencepublic ChromosomeSequence getParentChromosomeSequence() The parent ChromosomeSequence which contains the actual DNA sequence data- Returns:
- Chromosome sequence
 
 - 
getLengthpublic int getLength() Description copied from interface:SequenceReturns the length of the Sequence- Specified by:
- getLengthin interface- Sequence<NucleotideCompound>
- Overrides:
- getLengthin class- AbstractSequence<NucleotideCompound>
 
 - 
addIntronsUsingExonspublic void addIntronsUsingExons() throws Exception 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
 
 - 
getTranscriptpublic TranscriptSequence getTranscript(String accession) Get the transcript sequence by accession- Parameters:
- accession-
- Returns:
- the transcript
 
 - 
getTranscriptspublic LinkedHashMap<String,TranscriptSequence> getTranscripts() Get the collection of transcription sequences assigned to this gene- Returns:
- transcripts
 
 - 
removeTranscriptpublic TranscriptSequence removeTranscript(String accession) Remove the transcript sequence from the gene- Parameters:
- accession-
- Returns:
- transcriptsequence
 
 - 
addTranscriptpublic TranscriptSequence addTranscript(AccessionID accession, int begin, int end) throws Exception 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
 
 - 
removeIntronpublic IntronSequence removeIntron(String accession) Remove the intron by accession- Parameters:
- accession-
- Returns:
- intron sequence
 
 - 
addIntronpublic IntronSequence addIntron(AccessionID accession, int begin, int end) throws Exception Add an Intron Currently used to mark an IntronSequence as a feature- Parameters:
- accession-
- begin-
- end-
- Returns:
- intron sequence
- Throws:
- Exception
 
 - 
removeExonpublic ExonSequence removeExon(String accession) Remove the exon sequence- Parameters:
- accession-
- Returns:
- exon sequence
 
 - 
addExonpublic ExonSequence addExon(AccessionID accession, int begin, int end) throws Exception Add an ExonSequence mainly used to mark as a feature- Parameters:
- accession-
- begin-
- end-
- Returns:
- exon sequence
- Throws:
- Exception
 
 - 
getExonSequencespublic ArrayList<ExonSequence> getExonSequences() Get the exons as an ArrayList- Returns:
- exons
 
 - 
getIntronSequencespublic ArrayList<IntronSequence> getIntronSequences() Get the introns as an ArrayList- Returns:
- introns
 
 - 
getSequence5PrimeTo3Primepublic DNASequence 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
 
 
- 
 
-