Package org.snpeff.binseq
Class BinarySequence
java.lang.Object
org.snpeff.binseq.BinarySequence
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<BinarySequence>
- Direct Known Subclasses:
DnaAndQualitySequence
,DnaSequence
,DnaSequencePe
public abstract class BinarySequence
extends Object
implements Comparable<BinarySequence>, Serializable, Cloneable
Base class for a binary 'read'. I.e. a binary representation of a sequencer's read
A read is a short DNA fragment (short now means anywhere from 36 bases to 10K).
- Author:
- pcingola
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
char
getBase
(int index) Return the base at position 'index'abstract int
getCode
(int index) Return the code at position 'index'abstract Coder
getCoder()
Get sequence encoder & decoderabstract String
Get the sequence as a Stringabstract int
hashCode()
abstract int
length()
Get sequence lengthoverlap
(BinarySequence sequence, int start) Creates a new sequence by overlapping 'this' and 'sequence' E.g.abstract BinarySequence
read
(DataInputStream dataInStream) Read a sequence from a data streamprotected abstract void
readDataStream
(DataInputStream dataInStream) abstract BinarySequence
Reverse Watson-Cricks complementabstract void
Set sequence from a stringvoid
setQuality
(int index, int quality) Set the quality at position 'index'abstract void
write
(DataOutputStream dataOutStream) Write to a binary streamMethods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
-
Constructor Details
-
BinarySequence
public BinarySequence()
-
-
Method Details
-
getBase
public char getBase(int index) Return the base at position 'index' -
clone
-
getCode
public abstract int getCode(int index) Return the code at position 'index' -
getCoder
Get sequence encoder & decoder -
getSequence
Get the sequence as a String -
hashCode
public abstract int hashCode() -
length
public abstract int length()Get sequence length -
overlap
Creates a new sequence by overlapping 'this' and 'sequence' E.g. this.sequence : |xxxxxxxxxxxxxxxxxxxxOOOOOOOOOOOOOOOOOOOOOOOO | other.sequence : | OOOOOOOOOOOOOOOOOOOOOOOOyyyyyyyyyyyyyyyyy| | |start=20 | result : |xxxxxxxxxxxxxxxxxxxxOOOOOOOOOOOOOOOOOOOOOOOOyyyyyyyyyyyyyyyyy| this.sequence : | OOOOOOOOOOOOOOOOOOOOOOOOxxxxxxxxxxxxxxxxxxxx| other.sequence : |yyyyyyyyyyyyyyyyyyyyyyyyOOOOOOOOOOOOOOOOOOOOOOOO | |start=-20 | result : |yyyyyyyyyyyyyyyyyyyyyyyyOOOOOOOOOOOOOOOOOOOOOOOOxxxxxxxxxxxxxxxxxxxx| Another case is when a sequence is fully included in the other sequence. In this case the result is just a copy of the longest sequence (with the quality updated) E.g. this.sequence : |xxxxxxxxxxxxxxxxxxxxOOOOOOOOOOOOOOOOOOOOOOOO| other.sequence : | OOOOOOOOOOOOOOO | | |start=20 | result : |xxxxxxxxxxxxxxxxxxxxOOOOOOOOOOOOOOOOOOOOOOOO| this.sequence : | OOOOOOOOOOO | other.sequence : |yyyyyyyyyyyyyyyyyyyyyyyyOOOOOOOOOOOOOOOOOOOOOOOO| |start=-20 | result : |yyyyyyyyyyyyyyyyyyyyyyyyOOOOOOOOOOOOOOOOOOOOOOOO| -
read
Read a sequence from a data stream- Throws:
IOException
-
readDataStream
- Throws:
IOException
-
reverseWc
Reverse Watson-Cricks complement -
set
Set sequence from a string- Parameters:
seqStr
-
-
setQuality
public void setQuality(int index, int quality) Set the quality at position 'index' -
write
Write to a binary stream- Throws:
IOException
-