de.jstacs.motifDiscovery
Interface MutableMotifDiscoverer

All Superinterfaces:
Cloneable, MotifDiscoverer, Storable
All Known Implementing Classes:
ExtendedZOOPSDiffSM, IndependentProductDiffSM, MappingDiffSM, MixtureDiffSM, VariableLengthMixtureDiffSM

public interface MutableMotifDiscoverer
extends MotifDiscoverer

This is the interface that any tool for de-novo motif discovery should implement that allows any modify-operations like shift, shrink and expand. These operations are possible if the motif is mutable.

Author:
Jan Grau, Jens Keilwagen
See Also:
Mutable

Nested Class Summary
 
Nested classes/interfaces inherited from interface de.jstacs.motifDiscovery.MotifDiscoverer
MotifDiscoverer.KindOfProfile
 
Method Summary
 void adjustHiddenParameters(int index, DataSet[] data, double[][] weights)
          Adjusts all hidden parameters including duration and mixture parameters according to the current values of the remaining parameters.
 void initializeMotif(int motifIndex, DataSet data, double[] weights)
          This method allows to initialize the model of a motif manually using a weighted data set.
 void initializeMotifRandomly(int motif)
          This method initializes the motif with index motif randomly using for instance DifferentiableSequenceScore.initializeFunctionRandomly(boolean).
 boolean modifyMotif(int motifIndex, int offsetLeft, int offsetRight)
          Manually modifies the motif model with index motifIndex.
 
Methods inherited from interface de.jstacs.motifDiscovery.MotifDiscoverer
clone, getGlobalIndexOfMotifInComponent, getIndexOfMaximalComponentFor, getMotifLength, getNumberOfComponents, getNumberOfMotifs, getNumberOfMotifsInComponent, getProfileOfScoresFor, getStrandProbabilitiesFor
 
Methods inherited from interface de.jstacs.Storable
toXML
 

Method Detail

modifyMotif

boolean modifyMotif(int motifIndex,
                    int offsetLeft,
                    int offsetRight)
                    throws Exception
Manually modifies the motif model with index motifIndex. The two offsets offsetLeft and offsetRight define how many positions the left or right border positions shall be moved. Negative numbers indicate moves to the left while positive numbers correspond to moves to the right. The distribution for sequences to the left and right side of the motif shall be computed internally.

Parameters:
motifIndex - the index of the motif in the motif discoverer
offsetLeft - the offset on the left side
offsetRight - the offset on the right side
Returns:
true if the motif model was modified otherwise false
Throws:
Exception - if some unexpected error occurred during the modification
See Also:
modifyMotif(int, int, int), Mutable.modify(int, int)

initializeMotif

void initializeMotif(int motifIndex,
                     DataSet data,
                     double[] weights)
                     throws Exception
This method allows to initialize the model of a motif manually using a weighted data set.

Parameters:
motifIndex - the index of the motif in the motif discoverer
data - the data set of sequences
weights - either null or an array of length data.getNumberofElements() with non-negative weights.
Throws:
Exception - if initialize was not possible

initializeMotifRandomly

void initializeMotifRandomly(int motif)
                             throws Exception
This method initializes the motif with index motif randomly using for instance DifferentiableSequenceScore.initializeFunctionRandomly(boolean). Furthermore, if available, it also initializes the positional distribution.

Parameters:
motif - the index of the motif
Throws:
Exception - either if the index is wrong or if it is thrown by the method DifferentiableSequenceScore.initializeFunctionRandomly(boolean)

adjustHiddenParameters

void adjustHiddenParameters(int index,
                            DataSet[] data,
                            double[][] weights)
                            throws Exception
Adjusts all hidden parameters including duration and mixture parameters according to the current values of the remaining parameters.

Parameters:
index - the index of the class of this MutableMotifDiscoverer
data - the array of data for all classes
weights - the weights for all sequences in data
Throws:
Exception - thrown if the hidden parameters could not be adjusted