public final class NucleotideSequence extends Sequence<S> implements NSeq<NucleotideSequence>, Serializable
Sequence,
NucleotideAlphabet,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static NucleotideAlphabet |
ALPHABET
Nucleotide alphabet
|
protected byte[] |
data |
static NucleotideSequence |
EMPTY
Empty instance
|
| Constructor and Description |
|---|
NucleotideSequence(byte[] data)
Creates nucleotide sequence from specified
Bit2Array (will be copied in constructor). |
NucleotideSequence(char[] sequence)
Creates nucleotide sequence from char array of nucleotides (e.g.
|
NucleotideSequence(String sequence)
Creates nucleotide sequence from its string representation (e.g.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
asArray()
Returns an array of bytes that encodes this sequence.
|
byte |
codeAt(int position)
Returns letter code at specified position.
|
boolean |
containsWildcards()
Returns true if sequence contains wildcards.
|
boolean |
containsWildcards(int from,
int to)
Returns true if sequence contains wildcards in specified region.
|
protected static byte[] |
dataFromChars(Alphabet alphabet,
char[] chars) |
boolean |
equals(Object o) |
static NucleotideSequence |
fromSequence(byte[] sequence,
int offset,
int length)
Creates nucleotide sequence from specified byte array.
|
NucleotideAlphabet |
getAlphabet()
Returns the alphabet corresponding to this type of sequence.
|
S |
getRange(int from,
int to)
Returns a subsequence of this starting at
from (inclusive) and ending at to (exclusive). |
NucleotideSequence |
getRange(Range range)
Returns a subsequence of this bounded by specified
range. |
NucleotideSequence |
getReverseComplement()
Returns reverse complement of this sequence.
|
int |
hashCode() |
int |
size()
Returns size of this sequence
|
compareTo, containWildcards, getBuilder, getSequence, indexOf, symbolAt, toMotif, toStringconcatenateclone, finalize, getClass, notify, notifyAll, wait, wait, waitconcatenate, getBuilder, getRange, sizepublic static final NucleotideAlphabet ALPHABET
public static final NucleotideSequence EMPTY
protected final byte[] data
public NucleotideSequence(String sequence)
sequence - string representation of sequence (case insensitive)IllegalArgumentException - if sequence contains unknown nucleotide symbolpublic NucleotideSequence(char[] sequence)
sequence - char array of nucleotidesIllegalArgumentException - if sequence contains unknown nucleotide symbolpublic NucleotideSequence(byte[] data)
Bit2Array (will be copied in constructor).data - Bit2Arraypublic NucleotideSequence getRange(Range range)
Seqrange.getRange in interface Seq<NucleotideSequence>getRange in class AbstractSeq<NucleotideSequence>range - a range that defines starting (inclusive) and ending (exclusive) points of subsequencerange.public NucleotideSequence getReverseComplement()
getReverseComplement in interface NSeq<NucleotideSequence>public boolean containsWildcards(int from,
int to)
public boolean containsWildcards()
public NucleotideAlphabet getAlphabet()
Sequencepublic static NucleotideSequence fromSequence(byte[] sequence, int offset, int length)
sequence - byte arrayoffset - offset in sequencelength - length of resulting sequencepublic byte codeAt(int position)
Sequencepublic int size()
Seqpublic byte[] asArray()
Sequencepublic S getRange(int from,
int to)
Seqfrom (inclusive) and ending at to (exclusive).public final boolean equals(Object o)
public final int hashCode()
protected static byte[] dataFromChars(Alphabet alphabet, char[] chars)
Copyright © 2018. All rights reserved.