Package org.biojava.nbio.core.sequence
Class ChromosomeSequence
- java.lang.Object
-
- org.biojava.nbio.core.sequence.template.AbstractSequence<NucleotideCompound>
-
- org.biojava.nbio.core.sequence.DNASequence
-
- org.biojava.nbio.core.sequence.ChromosomeSequence
-
- All Implemented Interfaces:
Iterable<NucleotideCompound>
,Accessioned
,Sequence<NucleotideCompound>
public class ChromosomeSequence extends DNASequence
A ChromosomeSequence is a DNASequence but keeps track of geneSequences- 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
Constructors Constructor Description ChromosomeSequence()
Empty constructor used by tools that need a proper Bean that allows the actual sequence data to be set after construction.ChromosomeSequence(String seqString)
String is king and assume DNAChromosomeSequence(String seqString, CompoundSet<NucleotideCompound> compoundSet)
Allows the creation of a ChromosomeSequence using String for the sequence with a custom CompoundSetChromosomeSequence(SequenceReader<NucleotideCompound> proxyLoader)
Fairly important constructor given the size of a ChromsomeSequence where the ProxySequenceReader could load from disk via RandomAccessFile so that the sequence doesn't need to be kept in memory.ChromosomeSequence(SequenceReader<NucleotideCompound> proxyLoader, CompoundSet<NucleotideCompound> compoundSet)
Allows the creation of a ChromosomeSequence using a ProxyResequenceReader for the sequence with a custom CompoundSet
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GeneSequence
addGene(AccessionID accession, int bioBegin, int bioEnd, Strand strand)
Add a gene to the chromosome sequence using bioIndexing starts at 1 instead of 0.int
getChromosomeNumber()
GeneSequence
getGene(String accession)
Get the gene based on accession.LinkedHashMap<String,GeneSequence>
getGeneSequences()
Get the list of genes that have been added to the ChromosomeSequence where accession.toString is the key.GeneSequence
removeGeneSequence(String accession)
void
setChromosomeNumber(int chromosomeNumber)
-
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, 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, 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
-
ChromosomeSequence
public ChromosomeSequence()
Empty constructor used by tools that need a proper Bean that allows the actual sequence data to be set after construction. Not recommended
-
ChromosomeSequence
public ChromosomeSequence(String seqString) throws CompoundNotFoundException
String is king and assume DNA- Parameters:
seqString
-- Throws:
CompoundNotFoundException
-
ChromosomeSequence
public ChromosomeSequence(SequenceReader<NucleotideCompound> proxyLoader)
Fairly important constructor given the size of a ChromsomeSequence where the ProxySequenceReader could load from disk via RandomAccessFile so that the sequence doesn't need to be kept in memory. Could also be a NCBI proxy to load sequence data as needed from remote web server.- Parameters:
proxyLoader
-
-
ChromosomeSequence
public ChromosomeSequence(String seqString, CompoundSet<NucleotideCompound> compoundSet) throws CompoundNotFoundException
Allows the creation of a ChromosomeSequence using String for the sequence with a custom CompoundSet- Parameters:
seqString
-compoundSet
-- Throws:
CompoundNotFoundException
-
ChromosomeSequence
public ChromosomeSequence(SequenceReader<NucleotideCompound> proxyLoader, CompoundSet<NucleotideCompound> compoundSet)
Allows the creation of a ChromosomeSequence using a ProxyResequenceReader for the sequence with a custom CompoundSet- Parameters:
proxyLoader
-compoundSet
-
-
-
Method Detail
-
getChromosomeNumber
public int getChromosomeNumber()
- Returns:
- the chromosomeNumber
-
setChromosomeNumber
public void setChromosomeNumber(int chromosomeNumber)
- Parameters:
chromosomeNumber
- the chromosomeNumber to set
-
getGeneSequences
public LinkedHashMap<String,GeneSequence> getGeneSequences()
Get the list of genes that have been added to the ChromosomeSequence where accession.toString is the key. The list retains the order the genes are added- Returns:
-
removeGeneSequence
public GeneSequence removeGeneSequence(String accession)
- Parameters:
accession
-- Returns:
-
addGene
public GeneSequence addGene(AccessionID accession, int bioBegin, int bioEnd, Strand strand)
Add a gene to the chromosome sequence using bioIndexing starts at 1 instead of 0. The GeneSequence that is returned will have a reference to parent chromosome sequence which actually contains the sequence data. Strand is important for positive and negative direction where negative strand means we need reverse complement. If negative strand then bioBegin will be greater than bioEnd- Parameters:
accession
-begin
-end
-strand
-- Returns:
-
getGene
public GeneSequence getGene(String accession)
Get the gene based on accession. Will return null if not found- Parameters:
accession
-- Returns:
-
-