|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.unibi.techfak.jpredictor.clustering.RelationMeasure
de.unibi.techfak.jpredictor.clustering.MotifAlignment
de.unibi.techfak.jpredictor.clustering.MultiMotifAlignment
public class MultiMotifAlignment
Defines the alignment between two MultiMotifs. Both given
multi motifs must be of the same length. Thus it is guarantied that
every single motif of the first multi motif has a partner in the second
one. Single motif alignments are forwarded to the
SingleMotifAlignment which must be provided, when this class is
constructed. Since MultiMotifs can be of arbitrary depth
(they can in turn comprise MultiMotif as well) a
MultiMotifAlignment must be provided as well, when instantiating
this class. In the case it may be null the compute()
method will instantiate this MultiMotifAlignment at
need.
Multi motifs as well as single motifs can have a search direction. This
search direction does only affect the outer order of single motifs
comprise in the multi motifs but affects in no way the inner order.
The search direction MotifSearcher.SEARCH_DIRECTION_PLUS
means that the first always comes before the second single motif and
so forth. E.g. the MultiMotif A-B-C with the plus orientation
is only found as A-B-C, and never as C-B-A. To find it as C-B-A as well
MotifSearcher.SEARCH_DIRECTION_MINUS must be set. Normally,
for MultiMotifs MotifSearcher.SEARCH_ALL_ORIENTATIONS
is set. If both given multi motifs are restrited to one search
direction, only one alignment must be calculated, in all other ways,
two. After a succesful computation the orientations yielding the
optimal alignment can be obtained through a call to getOrientation
(int).
The result of the alignment must contain five informations. The first
two are for the whole multi motif alignment, which is, first, the
orientation of the two motifs for which the best alignment was obtained.
It can be got calling function getOrientation(int). Second,
the best alignment result, which can be obtained invoking method
result(). The last three informations regard the single motif
alignments. Third, shift values, fourth, orientations, five, results.
MultiMotif,
DoubleMotif,
SingleMotifAlignment,
MotifSearcher.SEARCH_DIRECTION_PLUS,
MotifSearcher.SEARCH_DIRECTION_MINUS,
MotifSearcher.SEARCH_ALL_ORIENTATIONS| Field Summary | |
|---|---|
(package private) MultiMotifAlignment |
mma
The alignment class between two multi motifs which must be provided when the class is constructed. |
(package private) java.util.Vector |
singleAlignments
After the alignment was computed, stores the alignments for every motif pair belonging to an optimal alignment. |
(package private) SingleMotifAlignment |
sma
The alignment class between two single motifs which must be provided when the class is constructed. |
| Fields inherited from class de.unibi.techfak.jpredictor.clustering.MotifAlignment |
|---|
ml, motifOrientation |
| Fields inherited from class de.unibi.techfak.jpredictor.clustering.RelationMeasure |
|---|
computationResult |
| Fields inherited from interface de.unibi.techfak.jpredictor.clustering.Computable |
|---|
COMPUTATION_FAILED, COMPUTATION_PENDING, COMPUTATION_SUCCESS, COMPUTATION_WAITING |
| Constructor Summary | |
|---|---|
MultiMotifAlignment(SingleMotifAlignment sma,
MultiMotifAlignment mma)
Inits this class with a single motif alignment used to align the single motifs comprised in the multi motifs. |
|
MultiMotifAlignment(SingleMotifAlignment sma,
MultiMotifAlignment mma,
MultiMotif motif1,
MultiMotif motif2)
Inits this class with a single motif alignment and two multi motifs. |
|
| Method Summary | |
|---|---|
boolean |
add(Motif m)
Adds a motif to this alignment class. |
double |
atomicCombine(double rel0,
double rel1)
Two relations measures are combined to one result, which is not stored but returned. |
double |
atomicNormalize(double rel,
double norm)
A relations measures is normalized by a certain amount. |
int |
compute()
Uses all internal informations available and starts and controlls the computational process. |
private double |
computeSingleMotifs(Motif m1,
Motif m2,
double resultSoFar)
Two motifs, either single or multi, are aligned. |
Motif |
consensus(int normX,
int normY)
The returned motif is a multi motif. |
MotifAlignment |
getSingleAlignment(int alignmentNumber)
Returns the alignment for every motif comprised in the
MultiMotifs given to this class. |
RelationMeasure |
newInstance()
Creates a copy of this relation measure as if it was newly instantiated through a call to the constructor. |
int |
optimum(double rel0,
double rel1)
Compares two relation measure results. |
java.lang.String |
toString()
Creates a short string of this relation measure and maybe some results if available. |
| Methods inherited from class de.unibi.techfak.jpredictor.clustering.MotifAlignment |
|---|
clear, consensus, getOrientation |
| Methods inherited from class de.unibi.techfak.jpredictor.clustering.RelationMeasure |
|---|
atomicCombine, compareTo, optimum, result |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
SingleMotifAlignment sma
MultiMotifAlignment mma
this. Must not be null.
In the compute()-method every alignment between two
multi motifs is done by creating a new instance of this field.
java.util.Vector singleAlignments
| Constructor Detail |
|---|
public MultiMotifAlignment(SingleMotifAlignment sma,
MultiMotifAlignment mma)
throws java.lang.NullPointerException
sma - The alignment between two motifs.mma - The alignment between two multi motifs. Can be null
in which case this class is used.
java.lang.NullPointerException - If sma is null.
public MultiMotifAlignment(SingleMotifAlignment sma,
MultiMotifAlignment mma,
MultiMotif motif1,
MultiMotif motif2)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException
sma - The alignment between single motifs.mma - The alignment between two multi motifs. Can be null
, if no multi motif is comprised in the motifs to be aligned
in this class.motif1 - The first multi motif to align against the second.motif2 - The second multi motif to align against the first.
java.lang.NullPointerException - If sma is null.
java.lang.IllegalArgumentException - If one of the two motifs could not
be added.add(Motif)| Method Detail |
|---|
public MotifAlignment getSingleAlignment(int alignmentNumber)
throws java.lang.IndexOutOfBoundsException
Returns the alignment for every motif comprised in the
MultiMotifs given to this class. It depends on the orientation
set for the multi motifs which single motifs belong to the first
alignment. E.g. A-B-C is aligned to D-E-F, but A-B-C is only searched
in the minus orientation, but D-E-F in both. In this case the first
alignment would either be C-D or C-F.
Note, that the alignment returned must not neccessarilly be a
SingleMotifAlignment but can also be a MultiMotifAlignment
.
alignmentNumber - The index within the previously set
MultiMotif.
java.lang.IndexOutOfBoundsException - If alignmentNumber is
less than zero or greater or equal to the number of motifs comprised
in the MultiMotifs set previously.SingleMotifAlignment,
MultiMotifAlignmentpublic boolean add(Motif m)
MotifAlignmentAdds a motif to this alignment class. The motif is always appent to the existing motifs. Depending on the used alignment class other motifs are accepted.
It is recommended that implementing classes should not perform any
time consuming operations here, but rather doing them in the
compute() method.
add in class MotifAlignmentm - The motif to appent to the list.
true, if the motif was added, false
otherwise, e.g. if the motif did not met the constraint,
maybe a MultiMotif was given, where a single one
was expected, or vice versa.MultiMotif,
SequenceMotif,
PSPMotif
public Motif consensus(int normX,
int normY)
consensus in class MotifAlignmentnormX - The normalization for the first motif.normY - The normalization for the second motif.
private double computeSingleMotifs(Motif m1,
Motif m2,
double resultSoFar)
m1 - m2 - resultSoFar -
public int compute()
Computable
COMPUTATION_SUCCESS.Computable.COMPUTATION_SUCCESS,
Computable.COMPUTATION_FAILED
public int optimum(double rel0,
double rel1)
RelationMeasure
Compares two relation measure results. Returns -1, zero or 1, if the
first (rel0) measure is worse, equal, or better than the
second one (rel1). The terms worse and better depend on
the implementation of the RelationMeasure inheriting
this method. Usually, when dealing with distances, the lower the better.
On the other side, when dealing with likelihoods the higher the better.
Note, that it is possible to mix up optimization of different relation measures, e.g. distances and likelihoods, since this method works on any numbers.
optimum in class RelationMeasurerel0 - The first relation measure to be compared to the second.rel1 - The second relation measure to be compared to the first.
public double atomicCombine(double rel0,
double rel1)
RelationMeasureTwo relations measures are combined to one result, which is not stored but returned. This method provides a way to calculate the combined result, when the way how to do this is not known. For instance, distance relation measures normally sum up over single results while likelihood/probabilities are multiplied.
Note, that it is possible to mix up optimization of different relation measures, e.g. distances and likelihoods, since this method works on any numbers.
atomicCombine in class RelationMeasurerel0 - The first relation measure to be compared to the second.rel1 - The second relation measure to be compared to the first.
public double atomicNormalize(double rel,
double norm)
RelationMeasureA relations measures is normalized by a certain amount. This method provides a way to normalize a relation measure after numbers of them were combined. For instance, distance relation measures normally are normalized by dividing through the count, while likelihoods are rooted.
Note, that it is possible to mix up optimization of different relation measures, e.g. distances and likelihoods, since this method works on any numbers.
atomicNormalize in class RelationMeasurerel - The relation measure to be normalized.norm - The normalization value.
Double.NaN in case of error.public RelationMeasure newInstance()
RelationMeasure
newInstance in class RelationMeasurepublic java.lang.String toString()
RelationMeasure
toString in class RelationMeasure
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||