|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jstacs.motifDiscovery.MotifDiscovererToolBox
de.jstacs.motifDiscovery.MutableMotifDiscovererToolbox
public final class MutableMotifDiscovererToolbox
This class contains some important methods for the initiation and optimization of MutableMotifDiscoverer.
| Nested Class Summary | |
|---|---|
static class |
MutableMotifDiscovererToolbox.InitMethodForDiffSM
This enum defines some constants for the method getSortedInitialParameters(DifferentiableSequenceScore[], InitMethodForDiffSM[], DiffSSBasedOptimizableFunction, int, OutputStream, int). |
| Constructor Summary | |
|---|---|
MutableMotifDiscovererToolbox()
|
|
| Method Summary | |
|---|---|
static void |
clearHistoryArray(History[][] history)
This method clears all elements of an History-array, so that it can be used again. |
static History[][] |
createHistoryArray(DifferentiableSequenceScore[] funs,
History template)
This method creates a History-array that can be used in an optimization. |
static int[][] |
createMinimalNewLengthArray(DifferentiableSequenceScore[] funs)
This method creates a minimalNewLength-array that can be used in an optimization. |
static boolean |
doHeuristicSteps(DifferentiableSequenceScore[] funs,
DataSet[] data,
double[][] weights,
DiffSSBasedOptimizableFunction opt,
DifferentiableFunction neg,
byte algorithm,
double linEps,
StartDistanceForecaster startDistance,
SafeOutputStream out,
boolean breakOnChanged,
History[][] hist,
int[][] minimalNewLength,
boolean maxPos)
This method tries to make some heuristic step if at least one DifferentiableSequenceScore is a MutableMotifDiscoverer. |
static Sequence[] |
enumerate(DifferentiableSequenceScore[] funs,
int[] classIndex,
int[] motifIndex,
RecyclableSequenceEnumerator[] rse,
double weight,
DiffSSBasedOptimizableFunction opt,
OutputStream out)
This method allows to enumerate all possible seeds for a number of motifs in the MutableMotifDiscoverers of a specific classes. |
static Sequence |
enumerate(DifferentiableSequenceScore[] funs,
int classIndex,
int motifIndex,
RecyclableSequenceEnumerator rse,
double weight,
DiffSSBasedOptimizableFunction opt,
OutputStream out)
This method allows to enumerate all possible seeds for a motif in the MutableMotifDiscoverer of a specific class. |
static boolean |
findModification(int clazz,
int motif,
MutableMotifDiscoverer mmd,
DifferentiableSequenceScore[] score,
DataSet[] data,
double[][] weights,
DiffSSBasedOptimizableFunction opt,
DifferentiableFunction neg,
byte algo,
double linEps,
StartDistanceForecaster startDistance,
SafeOutputStream out,
History hist,
int minimalNewLength,
boolean maxPos)
This method tries to find a modification, i.e. shifting, shrinking, or expanding a motif, that is promising. |
static ComparableElement<double[],Double>[] |
getSortedInitialParameters(DifferentiableSequenceScore[] funs,
MutableMotifDiscovererToolbox.InitMethodForDiffSM[] init,
DiffSSBasedOptimizableFunction opt,
int n,
OutputStream stream,
int optimizationSteps)
This method allows to initialize the DifferentiableSequenceScore using different MutableMotifDiscovererToolbox.InitMethodForDiffSM. |
static void |
initMotif(int idx,
int[] classIndex,
int[] motifIndex,
DataSet[] s,
double[][] seqWeights,
boolean[] adjust,
MutableMotifDiscoverer[] mmd,
int[] len,
DataSet[] data,
double[][] dataWeights)
This method allows to initialize a number of motifs. |
static double[][] |
optimize(DifferentiableSequenceScore[] funs,
DiffSSBasedOptimizableFunction opt,
byte algorithm,
AbstractTerminationCondition condition,
double linEps,
StartDistanceForecaster startDistance,
SafeOutputStream out,
boolean breakOnChanged,
History[][] hist,
int[][] minimalNewLength,
OptimizableFunction.KindOfParameter plugIn,
boolean maxPos)
This method tries to optimize the problem at hand as good as possible. |
static double[][] |
optimize(DifferentiableSequenceScore[] funs,
DiffSSBasedOptimizableFunction opt,
byte algorithm,
AbstractTerminationCondition condition,
double linEps,
StartDistanceForecaster startDistance,
SafeOutputStream out,
boolean breakOnChanged,
History template,
OptimizableFunction.KindOfParameter plugIn,
boolean maxPos)
This method tries to optimize the problem at hand as good as possible. |
| Methods inherited from class de.jstacs.motifDiscovery.MotifDiscovererToolBox |
|---|
plot, plotAndAnnotate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MutableMotifDiscovererToolbox()
| Method Detail |
|---|
public static Sequence enumerate(DifferentiableSequenceScore[] funs,
int classIndex,
int motifIndex,
RecyclableSequenceEnumerator rse,
double weight,
DiffSSBasedOptimizableFunction opt,
OutputStream out)
throws Exception
MutableMotifDiscoverer of a specific class.
funs - the DifferentiableSequenceScoresclassIndex - the index of the classmotifIndex - the index of the motif in the MutableMotifDiscovererrse - an RecyclableSequenceEnumerator that contains Sequence objects tested for initialization of the motif motifIndexweight - the weight of the seed Sequenceopt - the objective functionout - a stream that allows to write some output if necessary
Sequence with respect to the DiffSSBasedOptimizableFunction
Exception - if something went wrongenumerate(DifferentiableSequenceScore[], int[], int[], RecyclableSequenceEnumerator[], double, DiffSSBasedOptimizableFunction, OutputStream)
public static Sequence[] enumerate(DifferentiableSequenceScore[] funs,
int[] classIndex,
int[] motifIndex,
RecyclableSequenceEnumerator[] rse,
double weight,
DiffSSBasedOptimizableFunction opt,
OutputStream out)
throws Exception
MutableMotifDiscoverers of a specific classes.
funs - the DifferentiableSequenceScoresclassIndex - the indices of the classesmotifIndex - the indices of the motif in the MutableMotifDiscoverersrse - an array of RecyclableSequenceEnumerator that contains Sequence objects tested for initialization of the corresponding motifweight - the weight of the seed Sequenceopt - the objective functionout - a stream that allows to write some output if necessary
Sequences with respect to the DiffSSBasedOptimizableFunction
Exception - if something went wrong
public static void initMotif(int idx,
int[] classIndex,
int[] motifIndex,
DataSet[] s,
double[][] seqWeights,
boolean[] adjust,
MutableMotifDiscoverer[] mmd,
int[] len,
DataSet[] data,
double[][] dataWeights)
throws Exception
idx - the index indicates how many motifs are initializedclassIndex - the indices of the classes of each motifmotifIndex - the indices of each motif within the MutableMotifDiscoverers - the DataSets to be used for the initializationseqWeights - the weights corresponding to the DataSetsadjust - an array of switches indicating whether to adjust hidden parameters of notmmd - the array of MutableMotifDiscoverers to be initializedlen - the length of each motifdata - the complete data setsdataWeights - the weights corresponding to the complete data sets
Exception - if something went wrong
public static ComparableElement<double[],Double>[] getSortedInitialParameters(DifferentiableSequenceScore[] funs,
MutableMotifDiscovererToolbox.InitMethodForDiffSM[] init,
DiffSSBasedOptimizableFunction opt,
int n,
OutputStream stream,
int optimizationSteps)
throws Exception
DifferentiableSequenceScore using different MutableMotifDiscovererToolbox.InitMethodForDiffSM. It returns an array of ComparableElements that contain the parameters and the
funs - the DifferentiableSequenceScoresinit - the specific MutableMotifDiscovererToolbox.InitMethodForDiffSM, the entries correspond one to one to those of funopt - the objective functionn - the number of initializationsstream - a stream that allows to write some output if necessaryoptimizationSteps - the number of initial steps that should be performed before evaluating the function
ComparableElements of parameter arrays and corresponding values of the DiffSSBasedOptimizableFunction
Exception - if something went wrongpublic static int[][] createMinimalNewLengthArray(DifferentiableSequenceScore[] funs)
funs - the DiffSMs used in an optimization
public static History[][] createHistoryArray(DifferentiableSequenceScore[] funs,
History template)
throws CloneNotSupportedException
funs - the DiffSMs used in an optimizationtemplate - the template history instance
CloneNotSupportedException - if the ttemplate could not be clonedpublic static void clearHistoryArray(History[][] history)
history - the array
public static double[][] optimize(DifferentiableSequenceScore[] funs,
DiffSSBasedOptimizableFunction opt,
byte algorithm,
AbstractTerminationCondition condition,
double linEps,
StartDistanceForecaster startDistance,
SafeOutputStream out,
boolean breakOnChanged,
History template,
OptimizableFunction.KindOfParameter plugIn,
boolean maxPos)
throws Exception
MutableMotifDiscoverers it tries to perform modify operations as long as they seem to be promising.
funs - the DifferentiableSequenceScores for scoring sequencesopt - the DiffSSBasedOptimizableFunctionalgorithm - used for the optimizationcondition - used for the optimizationlinEps - used for the optimizationstartDistance - used for the optimizationout - an stream that allows to obtain some information while optimizationbreakOnChanged - a switch that decides whether a new optimization should be started after one successful modify or after all motifs have been tried to modify.template - a history instance used to build an array with this instanceplugIn - a switch whether to take the internal parameters or notmaxPos - a switch whether to take the maximal shift position or not in the heuristic
Exception - if something went wrong while optimizationclearHistoryArray(de.jstacs.motifDiscovery.history.History[][]),
optimize(DifferentiableSequenceScore[], DiffSSBasedOptimizableFunction, byte, AbstractTerminationCondition, double, StartDistanceForecaster, SafeOutputStream, boolean, History[][], int[][], de.jstacs.classifiers.differentiableSequenceScoreBased.OptimizableFunction.KindOfParameter, boolean)
public static double[][] optimize(DifferentiableSequenceScore[] funs,
DiffSSBasedOptimizableFunction opt,
byte algorithm,
AbstractTerminationCondition condition,
double linEps,
StartDistanceForecaster startDistance,
SafeOutputStream out,
boolean breakOnChanged,
History[][] hist,
int[][] minimalNewLength,
OptimizableFunction.KindOfParameter plugIn,
boolean maxPos)
throws Exception
MutableMotifDiscoverers it tries to perform modify operations as long as they seem to be promising.
funs - the DifferentiableSequenceScores for scoring sequencesopt - the DiffSSBasedOptimizableFunctionalgorithm - used for the optimizationcondition - used for the optimizationlinEps - used for the optimizationstartDistance - used for the optimizationout - an stream that allows to obtain some information while optimizationbreakOnChanged - a switch that decides whether a new optimization should be started after one successful modify or after all motifs have been tried to modify.hist - an array that is used to check whether a modify-operation can be performedminimalNewLength - the minimal new length for each motif in each class, that will be used in an expand if the motif was shortened beforeplugIn - a switch whether to take the internal parameters or notmaxPos - a switch whether to take the maximal shift position or not in the heuristic
Exception - if something went wrong while optimization
public static boolean doHeuristicSteps(DifferentiableSequenceScore[] funs,
DataSet[] data,
double[][] weights,
DiffSSBasedOptimizableFunction opt,
DifferentiableFunction neg,
byte algorithm,
double linEps,
StartDistanceForecaster startDistance,
SafeOutputStream out,
boolean breakOnChanged,
History[][] hist,
int[][] minimalNewLength,
boolean maxPos)
throws Exception
DifferentiableSequenceScore is a MutableMotifDiscoverer.
These heuristic steps include shift, shrink, and expand as far as the user allows those operations by the History array.
funs - the DifferentiableSequenceScores for scoring sequencesdata - array of DataSet containing the data for each classweights - the weights corresponding to the Sequences in dataopt - the DiffSSBasedOptimizableFunctionneg - the NegativeDifferentiableFunction used in the optimizationalgorithm - used for the optimizationlinEps - used for the optimizationstartDistance - used for the optimizationout - an stream that allows to obtain some information while optimizationbreakOnChanged - a switch that decides whether a new optimization should be started after one successful modify or after all motifs have been tried to modify.hist - an array that is used to check whether a modify-operation can be performedminimalNewLength - the minimal new length for each motif in each class, that will be used in an expand if the motif was shortened beforemaxPos - a switch whether to take the maximal shift position or not in the heuristic
true if some heuristic steps has been performed otherwise false
Exception - if something went wrong
public static boolean findModification(int clazz,
int motif,
MutableMotifDiscoverer mmd,
DifferentiableSequenceScore[] score,
DataSet[] data,
double[][] weights,
DiffSSBasedOptimizableFunction opt,
DifferentiableFunction neg,
byte algo,
double linEps,
StartDistanceForecaster startDistance,
SafeOutputStream out,
History hist,
int minimalNewLength,
boolean maxPos)
throws Exception
true a modification was found and could be performed.
clazz - the class index for which the Scoring function will be tested for modificationmotif - the motif index for which the Scoring function will be tested for modificationmmd - the MutableMotifDiscoverer that will be testedscore - the DifferentiableSequenceScores for scoring sequencesdata - array of DataSet containing the data for each classweights - array of double[] containing the weights for the data of each classopt - the DiffSSBasedOptimizableFunctionneg - the NegativeDifferentiableFunction used in the optimizationalgo - used for the optimizationlinEps - used for the optimizationstartDistance - used for the optimizationout - an stream that allows to obtain some informationhist - an instance to check whether a modify-operation can be performedminimalNewLength - the minimal new length for each motif in each class, that will be used in an expand if the motif was shortened beforemaxPos - a switch whether to take the maximal shift position or not in the heuristic
true if a modification has been performed
Exception - if something went wrongSignificantMotifOccurrencesFinder.getNumberOfBoundSequences(DataSet, double[], int)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||