Skip to content

Releases: vineet1992/tetrad-vineet

Preferential Diversity (Variable Selection)

Choose a tag to compare

@vineet1992 vineet1992 released this 17 Jun 17:24

THE VARIABLE SELECTION JAR

The purpose of this jar file is to allow users to run the Preferential Diversity variable selection method with or without prior knowledge.
Graphical modeling structure learning algorithms can then be run on the selected variables.
Prior knowledge on relationships between variables can (optionally) be included in the analysis.

NOTE: THE INPUT FILE MUST BE A TAB-DELIMITED .TXT FILE

Usage: java -jar PrefDiv.jar

See Excel sheet for detailed description of parameters

Examples!

1. Select the top-50 variables without using prior knowledge

java -jar PrefDiv.jar -data data.txt -numSelect 50 -t Target

2. Select the top-50 variables using piPref-Div

java -jar PrefDiv.jar -data data.txt -numSelect 50 -t Target -priors Prior_Directory

3. Use an internal cross-validation to choose the number of variables to select based on prediction accuracy

java -jar PrefDiv.jar -data data.txt -cv 5 1,5,10,25,50,100 -t Target -priors Prior_Directory

4. Select the top-50 variables using piPref-Div but keep demographic data

java -jar PrefDiv.jar -data data.txt -numSelect 50 -t Target -priors Prior_Directory -keep Gender Age Race

5. Select the top-50 variables using piPref-Div and run StEPS to get a causal graph

java -jar PrefDiv.jar -data data.txt -numSelect 50 -t Target -priors Prior_Directory -keep Gender Age Race -useCausalGraph

6. Select the top-50 variables using piPref-Div and run piMGM to get a causal graph

java -jar PrefDiv.jar -data data.txt -numSelect 50 -t Target -priors Prior_Directory -keep Gender Age Race -useCausalGraph piMGM

7. Select the top-50 variables using piPref-Div and run StEPS to get a causal graph of the PCA summarized clusters

java -jar PrefDiv.jar -data data.txt -numSelect 50 -t Target -priors Prior_Directory -keep Gender Age Race -useCausalGraph -ctype pca

Causal Discovery Jar

Choose a tag to compare

@vineet1992 vineet1992 released this 27 Sep 19:30

Your Causal Discovery jar

The purpose of this jar file is to have a single suite in which to run all mixed data causal discovery algorithms including those suitable for data with potentially latent variables.

You may also perform bootstrapping, complimentary pairs stability selection, and StARS in order to use stability for model selection.

This also gives the option of outputting stabilities for every causal prediction in the graph structure and orientation frequencies for each causal direction to determine if the causal predictions made are reliable.

Usage: java -jar causalDiscovery.jar

See Excel sheet for detailed description of parameters

Examples!

1. Run MGM to find an undirected model specifying your own parameters

java -jar causalDiscovery.jar -d data.txt -mgm -l 0.25 0.2 0.4 -o output.txt

2. Run StEPS to get a stability-based lambda parameter set to run MGM and examine edge stabilities

java -jar causalDiscovery.jar -d data.txt -mgm -steps -stabs stabilities.txt -o output.txt

3. Run MGM-PCS with specified parameters

java -jar causalDiscovery.jar -d data.txt -mgm -l 0.25 0.2 0.4 -a 0.05 -alg PCS

4. Run MGM with CPSS and get edge frequencies

java -jar causalDiscovery.jar -d data.txt -mgm -l 0.25 0.2 0.4 -cpss 0.05 -orientStabs orients.txt -o output.txt

5. Run MGM with bootstrap and get edge frequencies

java -jar causalDiscovery.jar -d data.txt -mgm -l 0.25 0.2 0.5 -bootstrap -numBoots 100 -bootBound 50 -orientStabs orients.txt -o output.txt

6. Run Vanilla CPC and get orientation frequencies from StARS

java -jar causalDiscovery.jar -d data.txt -alg CPC -stars 25 -orientStabs orients.txt -o output.txt

7. Run FCI with bootstrapping to get orientation frequencies

java -jar causalDiscovery.jar -d data.txt -alg FCI -bootstrap -orientStabs orients.txt -o output.txt

8. Run FCI-MAX using your own initial undirected skeleton

java -jar causalDiscovery.jar -d data.txt -alg FCI-MAX -initGraph graph.txt -o ouput.txt -a 0.01

9. Run FCI with bootstrapping to get orientation frequencies and use the full dataset as the output graph

java -jar causalDiscovery.jar -d data.txt -alg FCI -bootstrap full -orientStabs orients.txt -o output.txt

Coming soon...

  1. Including your own true data generating graph or another graph for automatic comparisons
  2. Bootstrapping or using CPSS on an entire procedure (MGM-PCS or MGM-FCI-MAX)

Mixed Data Simulation

Choose a tag to compare

@vineet1992 vineet1992 released this 09 Oct 21:42

Mixed Data Simulation Script

This jar file simulates mixed continuous and categorical data from an underlying causal graph with specified simulation parameters. The user must specify the type of simulation to use, as well as whether to randomly generate causal graphs or to use a pre-specified causal graph from which to generate several datasets. Please see the parameters spreadsheet as well as the examples listed below for further details.

Examples!

1. Simulate 50 Mixed Lee and Hastie Datasets with 50 variables and 500 samples from a pre-specified graph

java -jar simulateData.jar -d . -simulation LH -v 50 -s 500 -r 50 -graph init_graph.txt

2. Same as above with 50 random graphs and edge amounts normally distributed with mean 200 and standard deviation 25

java -jar simulateData.jar -d . -simulation LH -v 50 -s 500 -r 50 -diff -er 200 25

3. Same as (2) with specified coefficients and specified edge variance

java -jar simulateData.jar -d . -simulation LH -coefLow 0.1 -coefHigh 3 -varLow 1 -varHigh 2 -v 50 -s 500 -r 50 -diff

4. Same as (2) with specified number of categories and percentage of discrete variables

java -jar simulateData.jar -d . -simulation LH -v 50 -s 500 -r 50 -diff -percentDisc 25 -minC 3 -maxC 5

5. Same as (2) but with Scale-free graphs with specified parameters

java -jar simulateData.jar -d . -simulation LH -v 50 -s 500 -r 50 -diff -graphSim S -alpha 0.25 -beta 0.1 -deltaIn 0.05 -deltaOut 0.08

6. Simulate all Continuous datasets

java -jar simulateData.jar -d . -simulation SEM -v 50 -s 500 -r 50

7. Simulate all Categorical datasets

java -jar simulateData.jar -d . -simulation BAYES -v 50 -s 500 -r 50

Prior Information Mixed Graphical Models (piMGM)

Choose a tag to compare

@vineet1992 vineet1992 released this 09 Oct 21:43

Learning a Mixed Graphical Model with Prior Information

This release describes a method called piMGM which learns an undirected graphical model from data with categorical and continuous variables. The method uses prior knowledge in the forms of edge probabilities, which can be curated from several different sources. Instead of using the knowledge as definite "truth" the method attempts to evaluate how reliable each source is before integrating the knowledge from each to learn a final model.
Thus the prior knowledge used can be both unreliable and incomplete.

Usage java -jar runPriors.jar

Parameters

Required Arguments:

-run
Name of the current job, all results will be placed in a folder with this name

-priors
This is the path to the directory where the prior knowledge files are stored. Prior knowledge can either be in the form of .sif files or tsv matrices. See example prior knowledge files for details.

-data
The filename of the dataset, genes (variables) should be in columns, and samples in rows

Optional Arguments:

-ns
Number of subsamples to use to compute edge stabilities
Usually you will set this around 10-20 depending upon the number of samples you have
Default: 20

-nl
Number of sparsity parameter values to test
A larger number may increase accuracy, but will greatly increase runtime
Default: 40

-sif
Specify this switch if the prior information is in the form of an .sif file instead of a matrix

-loocv
Use this switch if you have less than 50 or so samples to do Leave-one-out cross validation instead of subsampling

-rm <Variable_1>, ..., <Variable_N>
Remove the listed variables from the dataset to be analyzed

Examples

Please download "Data for piMGM Examples" in order to run the following examples. These examples use All_Data.txt as pseudo gene expression data with just one clinical variable, "Outcome."

1. Running piMGM with Co-Expression prior information to learned a more informed graphical model

java -jar runPriors.jar -run exampleRun -priors Example_Coexpression_Priors -data All_Data.txt

The output of this will be printed in the "exampleRun" directory. This includes a list of connections among genes and between genes and the outcome of interest, along with an evaluation of each prior knowledge source. This evaluation is in a tabular format with the following four fields.

Prior Weight

Prior Weight refers to the normalized weight given to each prior. These weights should sum to one, and specify the relative confidence the algorithm has in each prior information source.

Corrected p-Value

The p-value here is the probability of having a piMGM deviance score given that the prior is a random prior of the same size. This can be thought of as a probability of seeing a prior pathway being equally poor given that it was truly random.

Uncorrected p-Value

This has the same meaning as the corrected p-value but is uncorrected for multiple comparisons

Normalized Deviance Score

This score reflects how much more present in the data, the information contained in this prior is, compared to a random prior of equal size. A deviance score of 1 indicates a prior deviance equal to the mean of all random priors, whereas less than 1 indicates a prior with better information than random about the data.

2. Running piMGM with Pathways as Prior Knowledge Sources to Evaluate Pathways on Good Outcome patients

java -jar runPriors.jar -run examplePositive -priors Example_Pathway_Priors -data Good_Outcome.txt -sif -rm Outcome

Note that -sif must be specified since the pathways in this case are presented as .sif files (lists of edges). Also, the outcome variable must be removed since it is constant among the patients with Good Outcomes.

The output of this run of piMGM can be used to determine "active" pathways in the good outcome patients. A similar procedure can be run on the poor outcome patients in order to find differences in pathway activities among the two groups.

Notes to Run piMGM

  1. If the goal is to evaluate pathway activity, all included pathways should have at least 20 or so pieces of information (gene-gene associations) where both genes are present in the final expression data. All other pathways should be excluded

  2. If the goal is to evaluate pathway activity, pathways should have a reasonable percentage of their information present in the expression data (~25 % of edges should have both genes included in the expression data).

  3. If the goal is to learn an informed graphical model only, then the quantity of the prior information is not so important, and smaller priors can be used without harm.

  4. For datasets larger than 500 genes in the expression data, we recommend using a computing cluster to run piMGM. This will take too long on a laptop.