|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava3.core.sequence.loader.SequenceFileProxyLoader<C>
C
- public class SequenceFileProxyLoader<C extends Compound>
This class represents the storage container of a sequence stored in a fasta file where the initial parsing of the file we store the offset and length of the sequence. When a call is made to any method that needs sequence data then the file will be opened and the sequence loaded. This class could be improved by using the hints or a some algorithm that indicates the sequence data once loaded should stay loaded. Could keep track of the last time sequence data was loaded and then after X amount of time clear the contents to free up memory.
Constructor Summary | |
---|---|
SequenceFileProxyLoader(File file,
SequenceParserInterface sequenceParser,
long sequenceStartIndex,
int sequenceLength,
CompoundSet<C> compoundSet)
|
Method Summary | |
---|---|
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 |
List<C> |
getAsList()
Returns the Sequence as a List of compounds |
C |
getCompoundAt(int position)
Returns the Compound at the given biological index |
CompoundSet<C> |
getCompoundSet()
Gets the compound set used to back this Sequence |
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 |
String |
getSequenceAsString()
Returns the String representation of the Sequence |
String |
getSequenceAsString(Integer bioBegin,
Integer bioEnd,
Strand strand)
|
SequenceView<C> |
getSubSequence(Integer bioBegin,
Integer bioEnd)
Returns a portion of the sequence from the different positions. |
boolean |
isInitialized()
|
Iterator<C> |
iterator()
|
void |
setCompoundSet(CompoundSet<C> compoundSet)
|
void |
setContents(String sequence)
|
void |
setInitialized(boolean initialized)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SequenceFileProxyLoader(File file, SequenceParserInterface sequenceParser, long sequenceStartIndex, int sequenceLength, CompoundSet<C> compoundSet)
file
- The file where the sequence will be foundsequenceParser
- The parser to use to load the sequencesequenceStartIndex
- The file offset to the start of the sequencesequenceLength
- The length of the sequencecompoundSet
- Method Detail |
---|
public void setCompoundSet(CompoundSet<C> compoundSet)
setCompoundSet
in interface SequenceReader<C extends Compound>
compoundSet
- public void setContents(String sequence)
setContents
in interface SequenceReader<C extends Compound>
sequence
- public int getLength()
Sequence
getLength
in interface Sequence<C extends Compound>
public C getCompoundAt(int position)
Sequence
getCompoundAt
in interface Sequence<C extends Compound>
position
-
public 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 String toString()
toString
in class Object
public String getSequenceAsString()
Sequence
getSequenceAsString
in interface Sequence<C extends Compound>
public String getSequenceAsString(Integer bioBegin, Integer bioEnd, Strand strand)
bioBegin
- bioEnd
- strand
-
public List<C> getAsList()
Sequence
getAsList
in interface Sequence<C extends Compound>
public SequenceView<C> getSubSequence(Integer bioBegin, Integer bioEnd)
Sequence
getSubSequence
in interface Sequence<C extends Compound>
bioBegin
- bioEnd
-
public Iterator<C> iterator()
iterator
in interface Iterable<C extends Compound>
public CompoundSet<C> getCompoundSet()
Sequence
getCompoundSet
in interface Sequence<C extends Compound>
public boolean isInitialized()
public void setInitialized(boolean initialized)
initialized
- the initialized to setpublic AccessionID getAccession()
Accessioned
getAccession
in interface Accessioned
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>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |