public class SequenceScoreDistance extends DistanceMetric<StatisticalModel>
StatisticalModel
s based on the correlation of score
profiles on De Bruijn sequences.
For two StatisticalModel
s Modifier and Type | Field and Description |
---|---|
protected boolean |
exp
if exponential scores should be used
|
protected CyclicSequenceAdaptor[] |
seqs
The De Bruijn sequences
|
Modifier | Constructor and Description |
---|---|
protected |
SequenceScoreDistance(CyclicSequenceAdaptor[] seqs,
boolean exp)
Creates a new distance for a given set of sequences.
|
|
SequenceScoreDistance(DiscreteAlphabet alphabet,
int n,
boolean exp)
Creates a new distance.
|
Modifier and Type | Method and Description |
---|---|
double |
getDistance(double[][] profiles1,
double[][] profiles1Rc,
double[][] profiles2,
int maxShift)
Returns the distance between the two score profiles.
|
double |
getDistance(double[][] profiles1,
double[][] profiles1Rc,
StatisticalModel o2,
int motif1Length)
Returns the distance between a score profile and a model.
|
double |
getDistance(StatisticalModel o1,
StatisticalModel o2)
Returns the distance according to the metric of the two supplied objects.
|
double[][] |
getPairwiseDistanceMatrix(int numThreads,
StatisticalModel... objects)
Multi-threaded computation of the pairwise distance matrix.
|
double[][] |
getProfile(StatisticalModel o,
boolean rc)
Returns the score profile for the model.
|
getPairwiseDistanceMatrix
protected CyclicSequenceAdaptor[] seqs
protected boolean exp
public SequenceScoreDistance(DiscreteAlphabet alphabet, int n, boolean exp) throws WrongAlphabetException, WrongSequenceTypeException
alphabet
- the alphabet of the models that may be comparedn
- the length of n-mers represented in the De Bruijn sequenceexp
- if exponential scores should be usedWrongAlphabetException
- if the sequence of this alphabet could not be createdWrongSequenceTypeException
- if the sequence could not be createdprotected SequenceScoreDistance(CyclicSequenceAdaptor[] seqs, boolean exp)
seqs
- the sequencesexp
- if exponential scores should be usedpublic double[][] getProfile(StatisticalModel o, boolean rc) throws Exception
o
- the moderc
- if the reverse complement should be consideredException
- if the score could not be computedpublic double getDistance(double[][] profiles1, double[][] profiles1Rc, double[][] profiles2, int maxShift) throws Exception
profiles1
- the first profileprofiles1Rc
- the reverse complementary version of the first profileprofiles2
- the second profilemaxShift
- the maximum allowed shift between the profilesException
- if the distance could not be computedpublic double getDistance(double[][] profiles1, double[][] profiles1Rc, StatisticalModel o2, int motif1Length) throws Exception
profiles1
- the first profileprofiles1Rc
- the reverse complementary version of the first profileo2
- the modelmotif1Length
- the length of the motif used to compute the first profileException
- if the distance could not be computedpublic double getDistance(StatisticalModel o1, StatisticalModel o2) throws Exception
DistanceMetric
getDistance
in class DistanceMetric<StatisticalModel>
o1
- the first objecto2
- the second objectException
- if the distance could not be computedpublic double[][] getPairwiseDistanceMatrix(int numThreads, StatisticalModel... objects) throws Exception
numThreads
- the number of threadsobjects
- the modelsException
- if the distance could not be computed