|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.cs.sb.drem.DREM_Timeiohmm
public class DREM_Timeiohmm
This class implements the core methods for learning the DREM maps
Constructor Summary | |
---|---|
DREM_Timeiohmm(DREM_DataSet theDataSet,
java.lang.String szbinding,
java.lang.String sznumchildval,
java.lang.String szepsilonval,
java.lang.String szprunepathval,
java.lang.String szdelaypathval,
java.lang.String szmergepathval,
java.lang.String szepsilonvaldiff,
java.lang.String szprunepathvaldiff,
java.lang.String szdelaypathvaldiff,
java.lang.String szmergepathvaldiff,
java.lang.String szseedval,
boolean bstaticcheckval,
boolean ballowmergeval,
int ninitsearchval,
java.lang.String szinitfileval,
javax.swing.JLabel statusLabel,
javax.swing.JLabel statusLabel15,
javax.swing.JLabel statusLabel2,
javax.swing.JLabel statusLabel3,
javax.swing.JLabel statuscountLabel,
javax.swing.JButton endSearchButton,
boolean bstaticsearchval,
boolean brealXaxisDEF,
double dYaxisDEF,
double dXaxisDEF,
double dnodekDEF,
int nKeyInputTypeDEF,
double dKeyInputXDEF,
double dpercentDEF,
javax.swing.JButton currentButton,
java.lang.String szexpname,
java.lang.String sznodepenaltyval,
boolean bpenalizedmodel,
java.lang.String szconvergenceval)
Class constructor - provides the execution control on the method |
Method Summary | |
---|---|
void |
averageChildrenSigmas(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode root)
Forces children of a parent to both have the average of their standard deviations |
void |
backalg(double[] vals,
int[] pma,
int[] theInstanceIndex,
int[] theInstance,
int ni,
edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode node,
int nrec,
boolean bforward)
Executes the backward portion of the baum-welch algorithm |
void |
buildEmptyTree(int ncurrdepth,
edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode currnode,
double[] dsigma,
double[] dmean)
Builds the initial tree which is just a single chain with mean and standard deviation for each node being the global mean and standard deviation at the time point |
void |
buildFilteredClassifier()
Uses DREM_NaiveBayes to build a classifier which predicts given the set of transcription factors predicted to regulate a gene whether it would appear filtered or not |
void |
clearCounts(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode ptr)
Clears any prior assignments of genes to paths through the model |
void |
combineTrainAndTest()
Sets up the stored data so that the training data includes all data except any external held out validation data, meaning the data which might otherwise used for model selection is just for parameter learning |
void |
computeDataStats(double[][] data,
int[][] pma,
double[] dsigmas,
double[] dmeans)
Computes the average and standard deviation expression level at each time point |
void |
computeminparentlevel(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode ptr)
Assigns to the nminparentlevel in all nodes the level of the most immediate ancestor with two or more children |
int |
computeNumLeaves(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode ptr)
Computes the number of paths to leaves accessible from each node in the tree pointed to by ptr |
void |
computeOrders(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode treeptr)
Sorts the children of each node in treeptr and descendants based on OrderRecCompare |
double |
computepval(int[][] vals,
double diff)
Computes the fraction of combinations for vals that could lead to a greater difference than ddiff |
void |
computeStats(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode treeptr,
edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode rootptr)
Computes association scores for the transcription factors overall on paths and on paths out of splits conditional on the set of genes going into the split |
double |
computevlogit(double[] vals,
int[] pma,
int[] theInstance,
int[] theInstanceIndex,
int ndepth,
edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode node,
int[] bestpath)
Recursively determines the best path through the model and its likelihood |
int |
countNodes(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode root,
int ncurrtime)
Returns the number of nodes in the tree pointed by root for which its ncurrtime field does not equal the ncurrtime parameter |
void |
deleteMinPath(int[] path,
int ndesiredlevel,
edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode root)
Deletes the specificed path from the model starting from ndesiredlevel |
edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode |
deletepath(int[] path,
int ndesiredlevel,
edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode root)
Deletes a child from the specified path on a cloned version of the root node |
void |
displayTempMap()
Displays the current temporary DREM model, from which a search is performed for an improved model |
boolean |
findnodesAtLevel(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode treeptr,
int nleveltogo,
java.util.HashSet hsLevel)
Returns true iff all nodes at nleveltogo only have one path to the leaves Stores in hsLevel all nodes at nleveltogo is 0 |
void |
forwardalg(double[] vals,
int[] pma,
int[] theInstanceIndex,
int[] theInstance,
int ni,
double da,
edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode node,
int nrec,
edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode parentptr)
Executes the forward algorithm portion of the baum-welch algorithm |
boolean |
hasMerge(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode treeptr)
Returns true iff treeptr or a descendent has two or more parents |
void |
initAE(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode root)
Initializes all the fields that will be used by instanceAE |
void |
initAEV(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode root)
Initializes all the fields that will be used by instanceAEV |
void |
instanceAE(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode root,
int ndepth,
double[] vals,
int[] pma,
int[] bpvals,
double dpj,
int nrec)
Combines the results of the forward and backward algorithm to obtain the probability of each gene going through each state when using baum-welch training |
void |
instanceAEV(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode root,
double[] vals,
int[] pma,
int[] bpvals,
int[] bestpath,
double dpj,
int nrec)
Combines the results of the forward and backward algorithm to obtain the probability of each gene going through each state when using viterbi training |
void |
loadBinding(java.lang.String szid,
int[] nonzeroindex,
int[] nonzerovals,
int numnonzero)
Stores into htbinding the mapping of the gene szid to its non-zero TF-gene interactions given by nonzeroindex and nonzerovals |
void |
makeTFindex(int[][] pval,
int[][] pvalindex,
int[][] pvalTF,
int[][] pvalTFindex)
Generates pvalTF and pvalTFindex based on pval and pvalindex so that the rows correspond to each TF and each entry in a row pvalTFindex corresponds to an index of a gene the TF regulates and the corresponding entry in pvalTF corresponds to the interaction value |
edu.cmu.cs.sb.drem.DREM_Timeiohmm.PredictRec |
predictTime(int[] binding,
double dclassprob,
edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode treeptr)
Used to set probability of each state a gene with a TF-binding signature of binding will be in Also computes a record of other statistics based on these predictions |
void |
printMinPvals()
Prints the most significant TF-association scores for each TF |
void |
readColors(java.io.BufferedReader brinit)
Loads saved colors for a DREM map |
void |
readInitTree(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode currnode)
Initializes the model parameters to those in szinitfileval |
void |
readTFGeneData(java.lang.String szbinding)
Responsible for loading the TF-gene interaction input data from the file into the variable fields |
java.lang.String |
saveString(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode treecopy)
Returns a string with the model parameters |
void |
searchstage1()
Executes the first phase of the structure search Considers adding and deleting paths, does not consider merges or delays |
void |
splitdata()
Splits the non-held out validation data into a training set for learning the model parameters and a test set for model selection |
double |
testhmm(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode treehmm)
Evaluates the likelihood of the testdata under the current settings of the model parameters |
double |
testhmmHoldOut(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode treehmm)
Evaluates the likelihood of the holdoutdata under the current settings of the model parameters |
double |
testhmmV(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode treehmm)
Evaluates the likelihood of the viterbi assignments of the testdata under the current settings of the model parameters |
double |
testhmmVHoldOut(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode treehmm)
Evaluates the likelihood of the viterbi assignments of the holdoutdata under the current settings of the model parameters |
double |
trainhmm(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode treehmm,
boolean bpruneexempt)
Implements a baum-welch method for training the parameters with the current model structure |
double |
trainhmmV(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode treehmm,
boolean bpruneexempt)
Implements a viterbi training method for the parameters with the current model structure |
void |
traverse(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode root,
int ndepth,
boolean bprintC)
Used for debugging to see the contents of the model |
void |
traverseandadd(int[] path,
edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode ptr,
edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode origroot)
With its helper functions adds the specified path to the model |
boolean |
traverseanddelay(int[] path,
edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode ptr,
int ndesiredlevel,
edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode origroot,
boolean bresplit)
With its helper method traverseanddelayhelp searches for splits to delay one time point Returns true if an eligible split to delay was found |
boolean |
traverseanddelete(int[] path,
edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode ptr,
edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode origroot,
boolean bresplit,
double dimprovemin,
double dimprovemindiff)
With its helper function searches for the best path to delete Returns true if an eligible path to delete was found |
edu.cmu.cs.sb.drem.DREM_Timeiohmm.MinPathRec |
traverseanddeleteMinPath(int[] path,
int[] bestpath,
edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode ptr)
With its helper function finds the path with the fewest genes assigned this will become a candidate for deletion |
void |
traverseandmerge(int[] path)
Responsible with helper functions for merging paths. |
void |
updateParams(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode root,
int nchildnum,
double[][] data,
int[][] pma,
int ndepth)
Updates the mean, standard deviation, and classifier parameters based on the current expectation of which genes will go through which paths |
void |
viterbi(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode treeptr)
Determines the most likely path of each gene through the model |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DREM_Timeiohmm(DREM_DataSet theDataSet, java.lang.String szbinding, java.lang.String sznumchildval, java.lang.String szepsilonval, java.lang.String szprunepathval, java.lang.String szdelaypathval, java.lang.String szmergepathval, java.lang.String szepsilonvaldiff, java.lang.String szprunepathvaldiff, java.lang.String szdelaypathvaldiff, java.lang.String szmergepathvaldiff, java.lang.String szseedval, boolean bstaticcheckval, boolean ballowmergeval, int ninitsearchval, java.lang.String szinitfileval, javax.swing.JLabel statusLabel, javax.swing.JLabel statusLabel15, javax.swing.JLabel statusLabel2, javax.swing.JLabel statusLabel3, javax.swing.JLabel statuscountLabel, javax.swing.JButton endSearchButton, boolean bstaticsearchval, boolean brealXaxisDEF, double dYaxisDEF, double dXaxisDEF, double dnodekDEF, int nKeyInputTypeDEF, double dKeyInputXDEF, double dpercentDEF, javax.swing.JButton currentButton, java.lang.String szexpname, java.lang.String sznodepenaltyval, boolean bpenalizedmodel, java.lang.String szconvergenceval) throws java.lang.Exception
java.lang.Exception
Method Detail |
---|
public void combineTrainAndTest()
public void splitdata()
public void makeTFindex(int[][] pval, int[][] pvalindex, int[][] pvalTF, int[][] pvalTFindex)
public void readTFGeneData(java.lang.String szbinding) throws java.io.IOException
java.io.IOException
public void loadBinding(java.lang.String szid, int[] nonzeroindex, int[] nonzerovals, int numnonzero)
public void computeDataStats(double[][] data, int[][] pma, double[] dsigmas, double[] dmeans)
public void buildFilteredClassifier()
public void displayTempMap() throws java.lang.Exception
java.lang.Exception
public void searchstage1() throws java.lang.Exception
java.lang.Exception
public void computeminparentlevel(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode ptr)
public void traverseandmerge(int[] path) throws java.lang.Exception
java.lang.Exception
public int computeNumLeaves(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode ptr)
public boolean findnodesAtLevel(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode treeptr, int nleveltogo, java.util.HashSet hsLevel)
public void computeOrders(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode treeptr)
public void buildEmptyTree(int ncurrdepth, edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode currnode, double[] dsigma, double[] dmean)
public void readInitTree(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode currnode) throws java.io.IOException
java.io.IOException
public void readColors(java.io.BufferedReader brinit) throws java.io.IOException
java.io.IOException
public edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode deletepath(int[] path, int ndesiredlevel, edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode root)
public void traverseandadd(int[] path, edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode ptr, edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode origroot) throws java.lang.Exception
java.lang.Exception
public edu.cmu.cs.sb.drem.DREM_Timeiohmm.MinPathRec traverseanddeleteMinPath(int[] path, int[] bestpath, edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode ptr) throws java.lang.Exception
java.lang.Exception
public void deleteMinPath(int[] path, int ndesiredlevel, edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode root)
public boolean traverseanddelay(int[] path, edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode ptr, int ndesiredlevel, edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode origroot, boolean bresplit) throws java.lang.Exception
java.lang.Exception
public boolean traverseanddelete(int[] path, edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode ptr, edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode origroot, boolean bresplit, double dimprovemin, double dimprovemindiff) throws java.lang.Exception
java.lang.Exception
public void printMinPvals()
public boolean hasMerge(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode treeptr)
public java.lang.String saveString(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode treecopy)
public edu.cmu.cs.sb.drem.DREM_Timeiohmm.PredictRec predictTime(int[] binding, double dclassprob, edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode treeptr) throws java.lang.Exception
java.lang.Exception
public void traverse(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode root, int ndepth, boolean bprintC)
public void instanceAEV(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode root, double[] vals, int[] pma, int[] bpvals, int[] bestpath, double dpj, int nrec) throws java.lang.Exception
java.lang.Exception
public void initAE(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode root)
public void instanceAE(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode root, int ndepth, double[] vals, int[] pma, int[] bpvals, double dpj, int nrec) throws java.lang.Exception
java.lang.Exception
public void initAEV(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode root)
public void averageChildrenSigmas(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode root)
public void updateParams(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode root, int nchildnum, double[][] data, int[][] pma, int ndepth) throws java.lang.Exception
java.lang.Exception
public void forwardalg(double[] vals, int[] pma, int[] theInstanceIndex, int[] theInstance, int ni, double da, edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode node, int nrec, edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode parentptr) throws java.lang.Exception
java.lang.Exception
public void backalg(double[] vals, int[] pma, int[] theInstanceIndex, int[] theInstance, int ni, edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode node, int nrec, boolean bforward) throws java.lang.Exception
java.lang.Exception
public void clearCounts(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode ptr)
public void viterbi(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode treeptr) throws java.lang.Exception
java.lang.Exception
public void computeStats(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode treeptr, edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode rootptr)
public double computepval(int[][] vals, double diff)
public double computevlogit(double[] vals, int[] pma, int[] theInstance, int[] theInstanceIndex, int ndepth, edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode node, int[] bestpath) throws java.lang.Exception
java.lang.Exception
public double testhmmVHoldOut(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode treehmm) throws java.lang.Exception
java.lang.Exception
public double testhmmV(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode treehmm) throws java.lang.Exception
java.lang.Exception
public double testhmmHoldOut(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode treehmm) throws java.lang.Exception
java.lang.Exception
public double testhmm(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode treehmm) throws java.lang.Exception
java.lang.Exception
public int countNodes(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode root, int ncurrtime)
public double trainhmmV(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode treehmm, boolean bpruneexempt) throws java.lang.Exception
java.lang.Exception
public double trainhmm(edu.cmu.cs.sb.drem.DREM_Timeiohmm.Treenode treehmm, boolean bpruneexempt) throws java.lang.Exception
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |