Class Nmer


  • public class Nmer
    extends java.lang.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 int MAX_NMER_SIZE  
    • Constructor Summary

      Constructors 
      Constructor Description
      Nmer​(int length)  
      Nmer​(java.lang.String nmer)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getNmer()
      Set nmer (binary coded)
      int hashCode()  
      int length()
      Get nmer's length
      int read​(java.io.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​(java.lang.String seqStr)
      Set nmer's sequence
      void setLength​(int length)
      Set nmer's length
      void setNmer​(long nmer)
      Set nmer (binary coded)
      java.lang.String toString()  
      long wc()
      Watson-Cricks complement of this nmer Since {A, C, G, T} is translated into binary {00, 01, 10, 11}.
      void write​(java.io.OutputStream outputStream)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Nmer

        public Nmer​(int length)
      • Nmer

        public Nmer​(java.lang.String nmer)
    • Method Detail

      • getNmer

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

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

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

        public int read​(java.io.InputStream outputStream)
                 throws java.io.IOException
        Throws:
        java.io.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​(java.lang.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 java.lang.String toString()
        Overrides:
        toString in class java.lang.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​(java.io.OutputStream outputStream)
                   throws java.io.IOException
        Throws:
        java.io.IOException