Class Nmer

java.lang.Object
org.snpeff.nmer.Nmer

public class Nmer extends Object
Binary packed N-mer (i.e. DNA sequence of length N) In this implementation N has to be less than 32
Author:
pcingola
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Nmer(int length)
     
    Nmer(String nmer)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Set nmer (binary coded)
    int
     
    int
    Get nmer's length
    int
    read(InputStream outputStream)
     
    void
    rol(char base)
    Rotate sequence left and append a base at the end Note: The first base is dropped, so the total length is still 'n'
    void
    set(String seqStr)
    Set nmer's sequence
    void
    setLength(int length)
    Set nmer's length
    void
    setNmer(long nmer)
    Set nmer (binary coded)
     
    long
    wc()
    Watson-Cricks complement of this nmer Since {A, C, G, T} is translated into binary {00, 01, 10, 11}.
    void
    write(OutputStream outputStream)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • Nmer

      public Nmer(int length)
    • Nmer

      public Nmer(String nmer)
  • Method Details

    • getNmer

      public long getNmer()
      Set nmer (binary coded)
      Parameters:
      nmer -
    • hashCode

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

      public int length()
      Get nmer's length
      Returns:
    • read

      public int read(InputStream outputStream) throws IOException
      Throws:
      IOException
    • rol

      public void rol(char base)
      Rotate sequence left and append a base at the end Note: The first base is dropped, so the total length is still 'n'
      Parameters:
      cq -
    • set

      public void set(String seqStr)
      Set nmer's sequence
      Parameters:
      seqStr -
    • setLength

      public void setLength(int length)
      Set nmer's length
      Parameters:
      length -
    • setNmer

      public void setNmer(long nmer)
      Set nmer (binary coded)
      Parameters:
      nmer -
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • wc

      public long wc()
      Watson-Cricks complement of this nmer Since {A, C, G, T} is translated into binary {00, 01, 10, 11}. The complement is: baseWc = XOR(11, base)
      Returns:
    • write

      public void write(OutputStream outputStream) throws IOException
      Throws:
      IOException