C
- java.lang.Iterable<C>
, Accessioned
, Sequence<C>
BasicSequence
, DNASequence
, ProteinSequence
, RNASequence
public abstract class AbstractSequence<C extends Compound> extends java.lang.Object implements Sequence<C>
Modifier and Type | Class | Description |
---|---|---|
static class |
AbstractSequence.AnnotationType |
Constructor | Description |
---|---|
AbstractSequence() |
|
AbstractSequence(java.lang.String seqString,
CompoundSet<C> compoundSet) |
Create a Sequence from a simple string where the values should be found in compoundSet
|
AbstractSequence(SequenceReader<C> proxyLoader,
CompoundSet<C> compoundSet) |
A ProxySequenceReader allows abstraction of both the storage of the sequence data and the location
of the sequence data.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addFeature(int bioStart,
int bioEnd,
FeatureInterface<AbstractSequence<C>,C> feature) |
Method to help set the proper details for a feature as it relates to a sequence
where the feature needs to have a location on the sequence
|
void |
addFeature(FeatureInterface<AbstractSequence<C>,C> feature) |
Add a feature to this sequence.
|
void |
addNote(java.lang.String note) |
Add notes about this sequence that will get exported for GFF3
|
int |
countCompounds(C... compounds) |
Returns the number of times we found a compound in the Sequence
|
AccessionID |
getAccession() |
Returns the AccessionID this location is currently bound with
|
AbstractSequence.AnnotationType |
getAnnotationType() |
|
java.util.List<C> |
getAsList() |
Returns the Sequence as a List of compounds
|
java.lang.Integer |
getBioBegin() |
|
java.lang.Integer |
getBioEnd() |
|
C |
getCompoundAt(int position) |
Returns the Compound at the given biological index
|
CompoundSet<C> |
getCompoundSet() |
Gets the compound set used to back this Sequence
|
DatabaseReferenceInterface |
getDatabaseReferences() |
|
java.lang.String |
getDescription() |
|
FeatureRetriever |
getFeatureRetriever() |
|
java.util.List<FeatureInterface<AbstractSequence<C>,C>> |
getFeatures() |
|
java.util.List<FeatureInterface<AbstractSequence<C>,C>> |
getFeatures(int bioSequencePosition) |
Return features at a sequence position
|
java.util.List<FeatureInterface<AbstractSequence<C>,C>> |
getFeatures(java.lang.String featureType,
int bioSequencePosition) |
Return features at a sequence position by type
|
java.util.List<FeatureInterface<AbstractSequence<C>,C>> |
getFeaturesByType(java.lang.String type) |
|
FeaturesKeyWordInterface |
getFeaturesKeyWord() |
|
int |
getIndexOf(C compound) |
Scans through the Sequence looking for the first occurrence of the given
compound
|
SequenceView<C> |
getInverse() |
Does the right thing to get the inverse of the current
Sequence.
|
int |
getLastIndexOf(C compound) |
Scans through the Sequence looking for the last occurrence of the given
compound
|
int |
getLength() |
Returns the length of the Sequence
|
java.util.ArrayList<java.lang.String> |
getNotesList() |
|
java.lang.String |
getOriginalHeader() |
|
AbstractSequence<?> |
getParentSequence() |
|
SequenceReader<C> |
getProxySequenceReader() |
|
java.lang.String |
getSequenceAsString() |
Default case is to assume strand is positive because only CDSSequence can be either positive or negative Strand.
|
java.lang.String |
getSequenceAsString(java.lang.Integer bioStart,
java.lang.Integer bioEnd,
Strand strand) |
|
java.lang.Double |
getSequenceScore() |
Provide place holder for a metric that indicate a score associated with the sequence
|
java.lang.String |
getSource() |
Added support for the source of this sequence for GFF3 export
If a sub sequence doesn't have source then check for parent source
|
SequenceView<C> |
getSubSequence(java.lang.Integer bioStart,
java.lang.Integer bioEnd) |
Returns a portion of the sequence from the different positions.
|
TaxonomyID |
getTaxonomy() |
|
java.util.Collection<java.lang.Object> |
getUserCollection() |
Provided for convince if the developer needs to associate data with a sequence
|
java.util.Iterator<C> |
iterator() |
|
void |
removeFeature(FeatureInterface<AbstractSequence<C>,C> feature) |
Remove a feature from the sequence
|
void |
removeNote(java.lang.String note) |
|
void |
setAccession(AccessionID accession) |
|
void |
setAnnotationType(AbstractSequence.AnnotationType annotationType) |
|
void |
setBioBegin(java.lang.Integer begin) |
|
void |
setBioEnd(java.lang.Integer end) |
|
void |
setCompoundSet(CompoundSet<C> compoundSet) |
|
void |
setDatabaseReferences(DatabaseReferenceInterface databaseReferences) |
|
void |
setDescription(java.lang.String description) |
|
void |
setFeatureRetriever(FeatureRetriever featureRetriever) |
|
void |
setFeaturesKeyWord(FeaturesKeyWordInterface featuresKeyWord) |
|
void |
setNotesList(java.util.ArrayList<java.lang.String> notesList) |
|
void |
setOriginalHeader(java.lang.String originalHeader) |
|
void |
setParentSequence(AbstractSequence<?> parentSequence) |
|
void |
setProxySequenceReader(SequenceReader<C> proxyLoader) |
Very important method that allows external mappings of sequence data and features.
|
void |
setSequenceScore(java.lang.Double sequenceScore) |
|
void |
setSource(java.lang.String source) |
Added support for the source of this sequence for GFF3 export
|
void |
setTaxonomy(TaxonomyID taxonomy) |
|
void |
setUserCollection(java.util.Collection<java.lang.Object> userCollection) |
|
java.lang.String |
toString() |
public AbstractSequence()
public AbstractSequence(java.lang.String seqString, CompoundSet<C> compoundSet) throws CompoundNotFoundException
seqString
- compoundSet
- CompoundNotFoundException
public AbstractSequence(SequenceReader<C> proxyLoader, CompoundSet<C> compoundSet)
proxyLoader
- compoundSet
- public void setProxySequenceReader(SequenceReader<C> proxyLoader)
proxyLoader
- public SequenceReader<C> getProxySequenceReader()
public java.lang.Integer getBioBegin()
public void setBioBegin(java.lang.Integer begin)
bioBegin
- the bioBegin to setpublic java.lang.Integer getBioEnd()
public void setBioEnd(java.lang.Integer end)
bioEnd
- the bioEnd to setpublic java.util.Collection<java.lang.Object> getUserCollection()
public void setUserCollection(java.util.Collection<java.lang.Object> userCollection)
userCollection
- public AbstractSequence.AnnotationType getAnnotationType()
public void setAnnotationType(AbstractSequence.AnnotationType annotationType)
annotation
- the annotation to setpublic java.lang.String getDescription()
public void setDescription(java.lang.String description)
description
- the description to setpublic java.lang.String getOriginalHeader()
public void setOriginalHeader(java.lang.String originalHeader)
originalHeader
- the originalHeader to setpublic AbstractSequence<?> getParentSequence()
public void setParentSequence(AbstractSequence<?> parentSequence)
parentSequence
- the parentSequence to setpublic java.lang.String getSource()
public void setSource(java.lang.String source)
source
- the source to setpublic void addNote(java.lang.String note)
note
- public void removeNote(java.lang.String note)
public java.util.ArrayList<java.lang.String> getNotesList()
public void setNotesList(java.util.ArrayList<java.lang.String> notesList)
notesList
- the notesList to setpublic java.lang.Double getSequenceScore()
public void setSequenceScore(java.lang.Double sequenceScore)
sequenceScore
- the sequenceScore to setpublic java.util.List<FeatureInterface<AbstractSequence<C>,C>> getFeatures(java.lang.String featureType, int bioSequencePosition)
featureType
- bioSequencePosition
- public java.util.List<FeatureInterface<AbstractSequence<C>,C>> getFeatures(int bioSequencePosition)
featureType
- bioSequencePosition
- public java.util.List<FeatureInterface<AbstractSequence<C>,C>> getFeatures()
public void addFeature(int bioStart, int bioEnd, FeatureInterface<AbstractSequence<C>,C> feature)
bioStart
- bioEnd
- feature
- public void addFeature(FeatureInterface<AbstractSequence<C>,C> feature)
feature
- public void removeFeature(FeatureInterface<AbstractSequence<C>,C> feature)
feature
- public java.util.List<FeatureInterface<AbstractSequence<C>,C>> getFeaturesByType(java.lang.String type)
type
- public FeaturesKeyWordInterface getFeaturesKeyWord()
public void setFeaturesKeyWord(FeaturesKeyWordInterface featuresKeyWord)
featuresKeyWord
- the featuresKeyWord to setpublic DatabaseReferenceInterface getDatabaseReferences()
public void setDatabaseReferences(DatabaseReferenceInterface databaseReferences)
databaseReferences
- the databaseReferences to setpublic FeatureRetriever getFeatureRetriever()
public void setFeatureRetriever(FeatureRetriever featureRetriever)
public AccessionID getAccession()
Accessioned
getAccession
in interface Accessioned
public void setAccession(AccessionID accession)
accession
- the accession to setpublic TaxonomyID getTaxonomy()
public void setTaxonomy(TaxonomyID taxonomy)
species
- the species to setpublic CompoundSet<C> getCompoundSet()
Sequence
getCompoundSet
in interface Sequence<C extends Compound>
public void setCompoundSet(CompoundSet<C> compoundSet)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getSequenceAsString(java.lang.Integer bioStart, java.lang.Integer bioEnd, Strand strand)
begin
- end
- strand
- public java.lang.String getSequenceAsString()
getSequenceAsString
in interface Sequence<C extends Compound>
public java.util.List<C> getAsList()
Sequence
public C getCompoundAt(int position)
Sequence
getCompoundAt
in interface Sequence<C extends Compound>
position
- The 1-indexed position of the amino acidpublic int getIndexOf(C compound)
Sequence
getIndexOf
in interface Sequence<C extends Compound>
compound
- public int getLastIndexOf(C compound)
Sequence
getLastIndexOf
in interface Sequence<C extends Compound>
compound
- public int getLength()
Sequence
public SequenceView<C> getSubSequence(java.lang.Integer bioStart, java.lang.Integer bioEnd)
Sequence
getSubSequence
in interface Sequence<C extends Compound>
bioStart
- bioEnd
- public java.util.Iterator<C> iterator()
public int countCompounds(C... compounds)
Sequence
countCompounds
in interface Sequence<C extends Compound>
compounds
- public SequenceView<C> getInverse()
Sequence
getInverse
in interface Sequence<C extends Compound>