树结构隐马尔可夫模型的变分推理
treehmm的Python项目详细描述
快速启动
# INSTALLATION # If you're on Ubuntu sudo apt-get install python-pip python-scipy python-matplotlib cython git # OR if you're on a mac ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" brew install python scipy matplotlib cython git # don't forget python prerequisite `pysam` sudo pip install -U pysam # grab and build the tree-hmm code # easiest way first: sudo pip install -U treehmm # OR using the latest development version git clone https://github.com/uci-cbcl/tree-hmm.git cd tree-hmm # building the package: # don't install-- just test: python setup.py build_ext --inplace export PYTHONPATH=$PYTHONPATH:`pwd` export PATH=$PATH:`pwd`/bin # OR go ahead and install sudo pip install -e . # RUNNING # download some sample .bam files from our server and histogram them to binary .npy mkdir data && cd data tree-hmm convert --download_first \ --base_url "https://cbcl.ics.uci.edu/public_data/tree-hmm-sample-data/%s" \ --chromosomes chr19 \ --bam_template "wgEncodeBroadHistone{species}{mark}StdAlnRep{repnum}.REF_chr19.bam" \ --marks Ctcf H3k27me3 H3k36me3 H4k20me1 H3k4me1 H3k4me2 H3k4me3 H3k27ac H3k9ac \ --species H1hesc K562 Gm12878 Huvec Hsmm Nhlf Nhek Hmec # split chr19 into smaller pieces tree-hmm split observations.chr19.npy # do inference on the resulting chunks (creates infer_out directory) tree-hmm infer 5 --max_iter 3 --approx poc --run_local "observations.chr19.chunk*.npy" # convert the inferred states into BED format for viewing on the genome browser tree-hmm q_to_bed infer_out/mf/* # upload the BED files to UCSC, analyze, etc