public class BWT
extends java.lang.Object
BWT
object represents a Burrows-Wheeler
Transform of a sequence in a Fasta file.Modifier and Type | Field and Description |
---|---|
static int |
NUM_CHARS
The number of nucleotide characters in our alphabet: A, C, G, T, $
|
Constructor and Description |
---|
BWT(java.lang.String filename)
Creates a
BWT object from the sequence in a Fasta file. |
Modifier and Type | Method and Description |
---|---|
static int |
charToInt(char c)
Returns an integer representation of the specified character.
|
int |
getLength()
Returns the length of the genome sequence (plus 1 to account for '$').
|
int |
getNumberCharactersLessThan(char c)
Returns number of characters lexographically less than c.
|
int |
getNumberOccurrencesPriorToIndex(char c,
int i)
Returns number of occurrences of character c up to but not including index i.
|
static void |
main(java.lang.String[] args)
The
main method tests the BWT class by
creating a BWT based on the
sequence in the specified Fasta file. |
public static final int NUM_CHARS
public BWT(java.lang.String filename)
BWT
object from the sequence in a Fasta file.filename
- the name of the Fasta filepublic int getLength()
public int getNumberCharactersLessThan(char c)
public int getNumberOccurrencesPriorToIndex(char c, int i)
public static int charToInt(char c)
'A' returns 0
'C' returns 1
'G' returns 2
'T' returns 3
'$' returns 4
Otherwise, -1 is returned.
c
- character to be converted to an integerpublic static void main(java.lang.String[] args)
main
method tests the BWT
class by
creating a BWT based on the
sequence in the specified Fasta file. The original sequence is
output along with the BWT sequene and the unpermuted BWT (i.e., the
original sequence re-created).args
- a String
array of any command line arguments