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 Details

    • BinarySequence

      public BinarySequence()
  • Method Details

    • getBase

      public char getBase(int index)
      Return the base at position 'index'
    • clone

      public BinarySequence clone()
      Overrides:
      clone in class Object
    • getCode

      public abstract int getCode(int index)
      Return the code at position 'index'
    • getCoder

      public abstract Coder getCoder()
      Get sequence encoder & decoder
    • getSequence

      public abstract String getSequence()
      Get the sequence as a String
    • hashCode

      public abstract int hashCode()
      Overrides:
      hashCode in class Object
    • length

      public abstract int length()
      Get sequence length
    • overlap

      public BinarySequence overlap(BinarySequence sequence, int start)
      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

      public abstract BinarySequence read(DataInputStream dataInStream) throws IOException
      Read a sequence from a data stream
      Throws:
      IOException
    • readDataStream

      protected abstract void readDataStream(DataInputStream dataInStream) throws IOException
      Throws:
      IOException
    • reverseWc

      public abstract BinarySequence reverseWc()
      Reverse Watson-Cricks complement
    • set

      public abstract void set(String seqStr)
      Set sequence from a string
      Parameters:
      seqStr -
    • setQuality

      public void setQuality(int index, int quality)
      Set the quality at position 'index'
    • write

      public abstract void write(DataOutputStream dataOutStream) throws IOException
      Write to a binary stream
      Throws:
      IOException