C
- The Compound
to usepublic abstract static class BitSequenceReader.BitArrayWorker<C extends Compound>
extends java.lang.Object
Sequence
without the interfaceModifier and Type | Field and Description |
---|---|
static int |
BYTES_PER_INT |
Constructor and Description |
---|
BitSequenceReader.BitArrayWorker(CompoundSet<C> compoundSet,
int length) |
BitSequenceReader.BitArrayWorker(CompoundSet<C> compoundSet,
int[] sequence) |
BitSequenceReader.BitArrayWorker(Sequence<C> sequence) |
BitSequenceReader.BitArrayWorker(java.lang.String sequence,
CompoundSet<C> compoundSet) |
Modifier and Type | Method and Description |
---|---|
protected abstract byte |
bitMask()
This method should return the bit mask to be used to extract the
bytes you are interested in working with.
|
protected int |
bitsPerCompound()
Returns how many bits are used to represent a compound e.g. 2 if using
2bit encoding.
|
protected abstract int |
compoundsPerDatatype()
Should return the maximum amount of compounds we can encode per int
|
boolean |
equals(java.lang.Object o) |
protected abstract java.util.Map<C,java.lang.Integer> |
generateCompoundsToIndex()
Returns what the value of a compound is in the backing bit storage i.e.
|
protected abstract java.util.List<C> |
generateIndexToCompounds()
Should return the inverse information that
generateCompoundsToIndex()
returns i.e. if the Compound C returns 1 from compoundsToIndex then we
should find that compound here in position 1 |
C |
getCompoundAt(int position)
Returns the compound at the specified biological index
|
CompoundSet<C> |
getCompoundSet()
Returns the compound set backing this store
|
protected java.util.Map<C,java.lang.Integer> |
getCompoundsToIndexLookup()
Returns a map which converts from compound to an integer representation
|
protected java.util.List<C> |
getIndexToCompoundsLookup()
Returns a list of compounds the index position of which is used
to translate from the byte representation into a compound.
|
int |
getLength() |
int |
hashCode() |
void |
populate(Sequence<C> sequence)
Loops through the Compounds in a Sequence and passes them onto
setCompoundAt(Compound, int) |
void |
populate(java.lang.String sequence)
Loops through the chars in a String and passes them onto
setCompoundAt(char, int) |
protected byte |
processUnknownCompound(C compound,
int position)
Since bit encoding only supports a finite number of bases
it is more than likely when processing sequence you will encounter a
compound which is not covered by the encoding e.g.
|
int |
seqArraySize(int length) |
void |
setCompoundAt(char base,
int position)
Converts from char to Compound and sets it at the given biological index
|
void |
setCompoundAt(C compound,
int position)
Sets the compound at the specified biological index
|
public static final int BYTES_PER_INT
public BitSequenceReader.BitArrayWorker(java.lang.String sequence, CompoundSet<C> compoundSet)
public BitSequenceReader.BitArrayWorker(CompoundSet<C> compoundSet, int length)
public BitSequenceReader.BitArrayWorker(CompoundSet<C> compoundSet, int[] sequence)
protected abstract byte bitMask()
protected abstract int compoundsPerDatatype()
protected abstract java.util.List<C> generateIndexToCompounds()
generateCompoundsToIndex()
returns i.e. if the Compound C returns 1 from compoundsToIndex then we
should find that compound here in position 1protected abstract java.util.Map<C,java.lang.Integer> generateCompoundsToIndex()
protected int bitsPerCompound()
public int seqArraySize(int length)
public void populate(Sequence<C> sequence)
setCompoundAt(Compound, int)
public void populate(java.lang.String sequence)
setCompoundAt(char, int)
public void setCompoundAt(char base, int position)
public void setCompoundAt(C compound, int position)
public C getCompoundAt(int position)
protected byte processUnknownCompound(C compound, int position) throws java.lang.IllegalStateException
compound
- Compound processjava.lang.IllegalStateException
- Done whenever this method is invokedprotected java.util.List<C> getIndexToCompoundsLookup()
protected java.util.Map<C,java.lang.Integer> getCompoundsToIndexLookup()
public CompoundSet<C> getCompoundSet()
public int getLength()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object