Skip to content

Commit

Permalink
Mccalluc/doc tweaks (#52)
Browse files Browse the repository at this point in the history
* Syntax highlighting on bash snippets (grey comments)

* typo: "tests" -> "test"

* Running tests created these, but probably should not be committed?

* Does not seem like it could actually write to output before.
(Docker does not actually run for me: #51)

* Rename to take advantage of MD rendering

* link to examples
  • Loading branch information
mccalluc authored Apr 18, 2019
1 parent 37b304a commit 9aa1b9e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 14 deletions.
10 changes: 10 additions & 0 deletions COMMANDS → COMMANDS.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -10,29 +11,38 @@ 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/
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
```
32 changes: 18 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand All @@ -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,
Expand Down

0 comments on commit 9aa1b9e

Please sign in to comment.