Package org.snpeff.binseq

# Class DnaSequenceByte

java.lang.Object
org.snpeff.binseq.DnaSequenceByte

public class DnaSequenceByte extends Object
Binary packed DNA sequence.

Notes: - This is designed for short sequences (such as "short reads") - Every base is encoded in 2 bits {a, c, g, t} invalid input: '<'=> {0, 1, 2, 3} - All bits are stored in an array of 'bytes; - Most significant bits are the first bases in the sequence (makes comparison easier)

Author:
  pcingola

## Field Summary

Fields
Modifier and Type
Field
Description
`static final byte[]`
`BASE2CODE`
`static final char[]`
`BASES`
`static final int`
`BASES_PER_BYTE`
`static final int`
`BITS_PER_BASE`
`static final byte[]`
`MASK`

## Constructor Summary

Constructors
Constructor
Description
`DnaSequenceByte(int length, byte[] codes)`
`DnaSequenceByte(String seqStr)`

## Method Summary

Modifier and Type
Method
Description
`char`
`getBase(int index)`
`byte[]`
`getCodes()`
`int`
`getLength()`
`int`
`hashCode()`
`int`
`length()`
Sequence lenth
`void`
`set(String seqStr)`
Set sequence
`String`
`toString()`
`String`
`toStringHex()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### BASES_PER_BYTE

public static final int BASES_PER_BYTE

See Also:
  - Constant Field Values

### BITS_PER_BASE

public static final int BITS_PER_BASE

See Also:
  - Constant Field Values

### MASK

public static final byte[] MASK

### BASES

public static final char[] BASES

### BASE2CODE

public static final byte[] BASE2CODE

## Constructor Details

### DnaSequenceByte

public DnaSequenceByte(int length, byte[] codes)

### DnaSequenceByte

public DnaSequenceByte(String seqStr)

## Method Details

### getBase

public char getBase(int index)

### getCodes

public byte[] getCodes()

### getLength

public int getLength()

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### length

public int length()
Sequence lenth

### set

public void set(String seqStr)
Set sequence

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### toStringHex

public String toStringHex()