public class BioJavaPherogramProvider extends java.lang.Object implements PherogramProvider
Chromatogram
from BioJava 1
as a PherogramProvider
.
You can use this class together with ChromatogramFactory
to load ABI or SCF files into LibrAlign.
Note that base call indices in LibrAlign start with 0 whereas the BioJava indices in the underlying
Chromatogram
instance start with 1. (This class converts the indices accordingly.)
Trace indices (x-values) start with 0 in LibrAlign and in BioJava.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
QUALITY_LABEL_PREFIX |
LABEL_OVERCALL_PROBABILITY, LABEL_SUBSTITUTION_PROBABILITY, LABEL_UNDERCALL_PROBABILITY, PROBABILITY_LABELS, TRACE_CURVE_NUCLEOTIDES
Constructor and Description |
---|
BioJavaPherogramProvider(Chromatogram chromatogram)
Creates a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
int |
getAnnotation(java.lang.String label,
int baseIndex)
Returns the specified annotation (e.g.
|
char |
getBaseCall(int baseIndex)
Returns a base from the DNA sequence associated with the stored trace.
|
int |
getBaseCallPosition(int baseIndex)
Returns the position in the trace where the base at the specified index was observed.
|
double |
getMaxTraceValue(char nucleotide)
Returns the maximum trace value the specified curve contains.
|
int |
getQuality(char nucleotide,
int baseIndex)
Returns the quality score associated with the specified nucleotide.
|
int |
getSequenceLength()
Returns the length of the sequence associated with the stored trace.
|
int |
getTraceLength()
Returns the length of the stored trace.
|
double |
getTraceValue(char nucleotide,
int x)
Returns the y value of the specified trace curve at the specified position.
|
PherogramProvider |
reverseComplement()
Returns a new instance of this class which uses the reverse complemented version of the underlying BioJava 1
chromatogram.
|
public static final java.lang.String QUALITY_LABEL_PREFIX
public BioJavaPherogramProvider(Chromatogram chromatogram)
chromatogram
- the BioJava pherogram instancepublic double getTraceValue(char nucleotide, int x)
PherogramProvider
getTraceValue
in interface PherogramProvider
nucleotide
- the type of trace curve (A, T, C or G)x
- the x position of the curve (The first position is 0 and the last is
PherogramProvider.getTraceLength()
- 1
.)public int getTraceLength()
PherogramProvider
getTraceLength
in interface PherogramProvider
public double getMaxTraceValue(char nucleotide)
PherogramProvider
#getTraceValue(TraceCurve, int)
.)getMaxTraceValue
in interface PherogramProvider
nucleotide
- the type of trace curve (A, T, C or G)public char getBaseCall(int baseIndex)
PherogramProvider
getBaseCall
in interface PherogramProvider
baseIndex
- the index of the base in the pherogram (base call) sequence (This might differ
from the index of the base in the associated sequence in the alignment. Indices start with 0.)public int getBaseCallPosition(int baseIndex)
PherogramProvider
getBaseCallPosition
in interface PherogramProvider
baseIndex
- the index of the base in the pherogram (base call) sequence (This might differ
from the index of the base in the associated sequence in the alignment. Indices start with 0.)PherogramProvider.getTraceLength()
- 1
public int getQuality(char nucleotide, int baseIndex)
PherogramProvider
getQuality
in interface PherogramProvider
nucleotide
- the nucleotide identifying the trace curve for the quality scorebaseIndex
- the index of the base call position to which the quality score belongs (Indices start with 0.)public int getAnnotation(java.lang.String label, int baseIndex)
PherogramProvider
getAnnotation
in interface PherogramProvider
label
- the name of the attachment to be returnedbaseIndex
- the index of base call to which the returned attachment score belongs (Indices start with 0.)public int getSequenceLength()
PherogramProvider
getSequenceLength
in interface PherogramProvider
public PherogramProvider reverseComplement()
reverseComplement
in interface PherogramProvider