diff --git a/COMMANDS b/COMMANDS.md similarity index 98% rename from COMMANDS rename to COMMANDS.md index 659b769c..ab9cdf48 100644 --- a/COMMANDS +++ b/COMMANDS.md @@ -1,5 +1,6 @@ ### Calculating gene coverage +``` bedtools makewindows -g ~/projects/negspy/negspy/data/hg19/chromInfo.txt -w 1000 > ~/data/genbank-data/hg19/bins_hg19_1000.bed awk '{ if ($6 == "-") print }' ~/data/genbank-data/hg19/geneAnnotationsExonUnions.bed > ~/data/genbank-data/hg19/geneAnnotationsExonUnions.-.bed @@ -10,18 +11,24 @@ bedtools coverage -b ~/data/genbank-data/hg19/geneAnnotationsExonUnions.-.bed -a clodius convert bedfile_to_multivec ~/data/genbank-data/hg19/annotationsCoverage.+.bed --assembly hg19 --starting-resolution 1000 clodius convert bedfile_to_multivec ~/data/genbank-data/hg19/annotationsCoverage.-.bed --assembly hg19 --starting-resolution 1000 +``` ### Converting bedfile to multivec +``` clodius convert bedfile_to_multivec test/sample_data/sample.bed.gz --has-header --assembly hg38 --base-resolution 10 clodius aggregate multivec test/sample_data/sample.bed.multivec --assembly hg38 --base-resolution 10 +``` ### Getting gene summaries +``` cat ~/data/genbank-data/mm9/gene_summaries_*.tsv > ~/data/genbank-data/mm9/all_gene_summaries.tsv +``` ### Building the documentation +``` make publish # upload to PyPI sphinx-build -b html docs docs/_build/html/ @@ -29,10 +36,13 @@ sphinx-build -b html docs docs/_build/html/ for file in $(ls ~/projects/francesco-tad-calls/TADcalls/Rao/GM12878/*.txt); do clodius aggregate bedpe --assembly hg19 --chr1-col 1 --from1-col 2 --to1-col 3 --chr2-col 1 --from2-col 2 --to2-col 3 $file; done; for file in $(ls ~/projects/francesco-tad-calls/TADcalls/Rao/IMR90/*.txt); do clodius aggregate bedpe --assembly hg19 --chr1-col 1 --from1-col 2 --to1-col 3 --chr2-col 1 --from2-col 2 --to2-col 3 $file; done; +``` ### Multivec files +``` cat ~/Dropbox/paper-data/Danielles-data/drosophila.chromSizes.orig | awk '{print $1 "\t" $NF}' > ~/Dropbox/paper-data/Danielles-data/drosophila.chromSizes clodius aggregate multivec --output-file ~/Dropbox/paper-data/Danielles-data/drosophila.multivec.hdf5 --chromsizes-filename ~/Dropbox/paper-data/Danielles-data/drosophila.chromSizes ~/Dropbox/paper-data/Danielles-data/drosophila.hdf5 python setup.py sdist upload -r pypi +``` diff --git a/README.md b/README.md index 8e5abb96..b544e135 100644 --- a/README.md +++ b/README.md @@ -4,32 +4,34 @@ Install the clodius package: -``` +```shell pip install clodius ``` And use it aggregate a bigWig file: -``` +```shell clodius aggregate bigwig ~/Downloads/E116-DNase.fc.signal.bigwig ``` The output files can then be displayed using the [higlass-docker container](https://github.com/hms-dbmi/higlass-docker). For more information about viewing these types of files take a look at the [higlass wiki](https://github.com/hms-dbmi/higlass/wiki#bigwig-files). +[More examples](COMMANDS.md) are available. + ## Development The recommended way to develop `clodius` is to use a [conda](https://conda.io/docs/intro.html) environment and install `clodius` with develop mode: -``` +```shell python setup.py develop ``` Note that making changes to the `clodius/fast.pyx` [cython](http://docs.cython.org/en/latest/src/quickstart/cythonize.html) module requires an explicit recompile step: -``` +```shell python setup.py build_ext --inplace ``` @@ -38,36 +40,38 @@ python setup.py build_ext --inplace The unit tests for clodius can be run using [nosetests](http://nose.readthedocs.io/en/latest/): - nosetests tests +```shell +nosetests test +``` Individual unit tests can be specified by indicating the file and function they are defined in: -``` +```shell nosetests test/cli_test.py:test_clodius_aggregate_bedgraph ``` ## Quick start with Docker If you don't have your own, get some sample data: -``` +```shell mkdir -p /tmp/clodius/input mkdir -p /tmp/clodius/output curl https://raw.githubusercontent.com/hms-dbmi/clodius/develop/test/sample_data/geneAnnotationsExonsUnions.short.bed \ - > /tmp/clodius/input/sample.short.bed + > /tmp/clodius/input/sample.short.bed ``` Then install Docker, and pull and run the Clodius image: -``` -docker stop clodius; +```shell +docker stop clodius; docker rm clodius; docker pull gehlenborglab/clodius # Ensure that you have the latest. -docker run -v /tmp/clodius/input:/tmp/ \ +docker run -v /tmp/clodius/:/tmp/ \ gehlenborglab/clodius \ - clodius aggregate bigwig /tmp/file.bigwig - -ls /tmp/clodius/input # Should contain the output file + clodius aggregate bigwig /tmp/input/file.bigwig + +ls /tmp/clodius/output # Should contain the output file ``` If you already have a good location for your input and output files,