Sign inSign up

knowengdev/samples_clustering_pipeline

By knowengdev

•Updated about 8 years ago

image for running samples_clustering_pipeline, listed by creation date

Image
0

4.5K

knowengdev/samples_clustering_pipeline repository overview

⁠KnowEnG's Samples Clustering Pipeline

This is the Knowledge Engine for Genomics (KnowEnG), an NIH BD2K Center of Excellence, Samples Clustering Pipeline.

This pipeline clusters the columns of a given spreadsheet, where spreadsheet's columns correspond to sample-labels and rows correspond to gene-labels.

There are four clustering methods that one can choose from:

OptionsMethodParameters
Clusteringnmfnmf
Consensus Clusteringbootstrapping with nmfcc_nmf
Clustering with network regularizationnetwork-based nmfnet_nmf
Consensus Clustering with network regularizationbootstrapping with network-based nmfcc_net_nmf

Note: all of the clustering methods mentioned above use the non-negative matrix factorization (nmf) as the main clustering algorithm.

If a pheotype data file is included this pipeline evaluates the clustering result.

There are two evaluation methods:

MethodTrait Type
one-way ANOVA(f_oneway)Continuous
one-way chi square test(chisquare)Categorical

⁠How to run this pipeline's docker image with Our data


  1. Install Docker - follow the instructions in this link. ============

Install Docker Engine⁠

  1. Get the current Docker Image. On the command line with internet connection: ============

docker pull knowengdev/samples_clustering_pipeline: 04_09_2018

  1. Create or change to a directory to hold the output data. ============

mkdir local_results and / or cd local_results

  1. Start the docker image connected to the (local_results) directory. =========== docker run -v local_results:/home/test/run_dir -it knowengdev/samples_clustering_pipeline: 04_09_2018

  2. At the docker image command prompt change to the test directory. =========== .../home# cd test

  3. Set up the environment. ============= .../home/test# make env_setup


  1. Use one of the following "make" commands to select and run a clustering option: ===========
CommandOption
make run_nmfClustering
make run_net_nmfClustering with network regularization
make run_cc_nmf_serialConsensus Clustering
make run_cc_nmf_parallel_sharedConsensus Clustering
make run_cc_net_nmf_serialConsensus Clustering with network regularization
make run_cc_net_nmf_parallel_sharedConsensus Clustering with network regularization

⁠How to run this pipeline with Your data.


*** Perform steps 1-3 as described above and use the local_results directory ***

⁠Create a custom YAML file, move that and your spreadsheet to the local_results directory

*** see the git hub directions *** Samples Clustering ReadMe on github⁠

*** make sure file named by YAML key "spreadsheet_name:" is in your local_results directory *** *** the path-names inside docker depend on the way you "mount" the run directory in step 4 *** *** therefore you may have to change the YAML path's to ../../ instead of ../ *** *** make sure your custom YAML file is in the local_results directory ***

  1. Start docker with the container connected to your (local_results) directory. =========== docker run -v local_results:/home/test/run_dir -it knowengdev/samples_clustering_pipeline:04_09_2018

  2. Change to the directory mounted in step 4. =========== .../home# cd ./test/run_dir .../home/test/run_dir# ls

*** the files in the local_results directory will be visible in this directory ***

  1. Run Samples Clustering with the options in your custom YAML file. ========= python3 ../../src/samples_clustering.py -run_directory ./ -run_file your_custom_run_file.yml

⁠Description of "run_parameters" file


KeyValueComments
methodnmf, cc_nmf, net_nmf or cc_net_nmfChoose clustering method
gg_network_name_full_pathdirectory+gg_network_namePath and file name of the 4 col network file
spreadsheet_name_full_pathdirectory+spreadsheet_namePath and file name of user supplied gene sets
phenotype_data_full_pathdirectory+phenotype_data_namePath and file name of user supplied phenotype data
threshold10cluster eval - categorical vs continuous cut off level
results_directorydirectoryDirectory to save the output files
tmp_directorydirectoryDirectory to save the intermediate files
rwr_max_iterations100Maximum number of iterations without convergence in random walk with restart
rwr_convergence_tolerence1.0e-8Frobenius norm tolerence of spreadsheet vector in random walk
rwr_restart_probability0.7alpha in V_(n+1) = alpha * N * Vn + (1-alpha) * Vo
rows_sampling_fraction0.8Select 80% of spreadsheet rows
cols_sampling_fraction0.8Select 80% of spreadsheet columns
number_of_bootstraps4Number of random samplings
number_of_clusters3Estimated number of clusters
nmf_conv_check_freq50Check convergence at given frequency
nmf_max_invariance200Maximum number of invariance
nmf_max_iterations10000Maximum number of iterations
nmf_penalty_parameter1400Penalty parameter
top_number_of_genes100Number of top genes selected
processing_methodserial or parallel or distributeChoose processing method
parallelismnumber of cores to use in processingset for memory or speed

gg_network_name = STRING_experimental_gene_gene.edge spreadsheet_name = ProGENI_rwr20_STExp_GDSC_500.rname.gxc.tsv phenotype_data_name = UCEC_phenotype.txt


⁠Description of Output files saved in results directory


  • Output files of all four methods save genes by sample heatmap variances per row with name

genes_variance_{method}_{timestamp}_viz.tsv

variance
gene 1float
gene ..float
gene mfloat
  • Output files of all four methods save genes by samples heatmap with name

genes_by_samples_heatmp_{method}_{timestamp}_viz.tsv

sample 1...sample n
gene 1float...float
gene ...float...float
gene mfloat...float
  • Output files of all four methods save samples by samples heatmap with name

consensus_matrix_{method}_{timestamp}_viz.tsv

sample 1...sample n
sample 1float...float
............
sample nfloat...float
  • Output files of all four methods save patients to cluster map with name

samples_labeled_by_cluster_{method}_{timestamp}_viz.tsv

cluster
sample 1int
......
sample nint
  • Output files of all four methods save gene scores by cluster with name

genes_averages_by_cluster_{method}_{timestamp}_viz.tsv

cluster 1...cluster k
gene 1float...float
............
gene mfloat...float
  • Output files of all four methods save spreadsheet with top ranked genes per sample with name

top_genes_by_cluster_{method}_{timestamp}_download.tsv

cluster 1...cluster k
gene 11/0...1/0
............
gene m1/0...1/0
  • Output files of all four methods save patients to cluster map with name

phenotypes_labeled_by_cluster_{method}_{timestamp}_viz.tsv

sample idCluster_IDphenotype 1...phenotype k
sample 1intmixed type...mixed type
...............
sample nintmixed type...mixed type
  • The clustering evaluation output file has the name

clustering_evaluation_result_{timestamp}.tsv

MeasureTrait_length_after_dropnaSample_number_after_dropnachi fvalpval
sample 1f_onewayint(more than threshold)intfloatfloat
..................
sample mchisquareint(less than threshold)intfloatfloat

Tag summary

Content type

Image

Digest

Size

444.5 MB

Last updated

about 8 years ago

docker pull knowengdev/samples_clustering_pipeline:08_23_2018