Package org.snpeff.binseq

# Class DnaNSequence

java.lang.Object
org.snpeff.binseq.BinarySequence
org.snpeff.binseq.DnaSequence
org.snpeff.binseq.DnaNSequence

All Implemented Interfaces:
  `Serializable`, `Cloneable`, `Comparable<BinarySequence>`

public class DnaNSequence extends DnaSequence
Binary packed DNA sequence that allows also 'N' bases: {A, C, G, T, N}

Author:
  pcingola
See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`DnaNSequence(int length, long[] codes)`
`DnaNSequence(String seqStr)`

## Method Summary

Modifier and Type
Method
Description
`static DnaNSequence`
`empty()`
Empty sequence singleton
`protected DnaNSequence`
`factory()`
Create sequences
`char`
`getBase(int index)`
Return the base at position 'index'
`String`
`getBases(int index, int len)`
Get a few bases from this sequence
`BinarySequence`
`read(DataInputStream dataInStream)`
Read data in binary format
`protected void`
`readDataStream(DataInputStream dataInStream)`
Read data in binary format
`BinarySequence`
`reverseWc()`
Reverse Watson-Cricks complement
`void`
`set(String seqStr)`
Set sequence
`void`
`setBase(int index, char base)`
Replace a base in the sequence
`String`
`toString()`
`void`
`write(DataOutputStream dataOutStream)`
Write data in binary format

### Methods inherited from class org.snpeff.binseq.DnaSequence

`clone, compareTo, getCode, getCoder, getCodes, getSequence, hashCode, isEmpty, length, overlap, set, setCodes`

### Methods inherited from class org.snpeff.binseq.BinarySequence

`setQuality`

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

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

## Constructor Details

### DnaNSequence

public DnaNSequence(int length, long[] codes)

### DnaNSequence

public DnaNSequence(String seqStr)

## Method Details

### empty

public static DnaNSequence empty()
Empty sequence singleton

### factory

protected DnaNSequence factory()
Create sequences

Overrides:
  `factory` in class `DnaSequence`

### getBase

public char getBase(int index)
Description copied from class: `BinarySequence`
Return the base at position 'index'

Overrides:
  `getBase` in class `DnaSequence`

### getBases

public String getBases(int index, int len)
Get a few bases from this sequence

Overrides:
  `getBases` in class `DnaSequence`

### read

public BinarySequence read(DataInputStream dataInStream) throws IOException
Read data in binary format

Overrides:
  `read` in class `DnaSequence`
Throws:
  `IOException`

### readDataStream

protected void readDataStream(DataInputStream dataInStream) throws IOException
Read data in binary format

Overrides:
  `readDataStream` in class `DnaSequence`
Throws:
  `IOException`

### reverseWc

public BinarySequence reverseWc()
Description copied from class: `BinarySequence`
Reverse Watson-Cricks complement

Overrides:
  `reverseWc` in class `DnaSequence`

### set

public void set(String seqStr)
Description copied from class: `DnaSequence`
Set sequence

Overrides:
  `set` in class `DnaSequence`
Parameters:
  `seqStr` -

### setBase

public void setBase(int index, char base)
Replace a base in the sequence

Overrides:
  `setBase` in class `DnaSequence`

### toString

public String toString()

Overrides:
  `toString` in class `DnaSequence`

### write

public void write(DataOutputStream dataOutStream) throws IOException
Write data in binary format

Overrides:
  `write` in class `DnaSequence`
Throws:
  `IOException`