Package org.snpeff.nmer
Class Nmer
- java.lang.Object
-
- org.snpeff.nmer.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
-
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 lengthint
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 sequencevoid
setLength(int length)
Set nmer's lengthvoid
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)
-
-
-
Field Detail
-
MAX_NMER_SIZE
public static final int MAX_NMER_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getNmer
public long getNmer()
Set nmer (binary coded)- Parameters:
nmer
-
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.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 classjava.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
-
-