Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
telatin committed Feb 22, 2021
1 parent c2bf9b3 commit 68b1921
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 99 deletions.
17 changes: 6 additions & 11 deletions docs/1_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,17 @@ permalink: /installation

# Installation

## Pre-compiled binaries

Pre-compiled binaries are the fastest and easiest way to get _qax_. To get the latest version,
use the following command, otherwise check the
[stable releases](https://github.com/telatin/bamtocov/releases).


## Install via Miniconda

```note
Miniconda installation has been tested on MacOS and Linux,
but being _qax_ a single binary, if the precompiled works for you we recommend it.
```

Alternatively, you can install _bamtocov_ from BioConda, if you have _conda_ installed:
You can install _bamtocov_ from BioConda, if you have [_conda_](https://docs.conda.io/en/latest/miniconda.html) installed:

```
conda install -c conda-forge -c bioconda bamtocov
```

## Pre-compiled binaries

We release pre-compiled binaries for Linux, that can be downloaded from the
[GitHub releases page](https://github.com/telatin/bamtocov/releases).
109 changes: 22 additions & 87 deletions docs/2_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,98 +2,33 @@
sort: 2
permalink: /usage
---
# General usage

`qax` is composed by five subprogram, and the general syntax is:
# bamtocov

```
qax [program] parameters
```
```text
BamToCov 2.0.2
The programs are:
- **list** (it's the default action and can be omitteed)
- **extract** or **x**
- **citations** or **c**
- **provenance** or **p**
- **view** or **v**
Usage: bamtocov [options] [<BAM>]
## list
Arguments:
<BAM> the alignment file for which to calculate depth (default: STDIN)
Core options:
-p, --physical Calculate physical coverage
-s, --stranded Report coverage separate by strand
-w, --wig <SPAN> Output in wig format (using fixed <SPAN>)
Target files:
-r, --regions <bed> Target file in BED or GFF format (detected with the extension)
-t, --type <feat> GFF feature type to parse [default: CDS]
-i, --id <ID> GFF identifier [default: ID]
This is the default module, and can be used to list the properties of one or more artifacts.
BAM reading options:
-T, --threads <threads> BAM decompression threads [default: 0]
-F, --flag <FLAG> Exclude reads with any of the bits in FLAG set [default: 1796]
-Q, --mapq <mapq> Mapping quality threshold [default: 0]
Some features:
* Supports multiple files at once
* 100X times faster than Qiime2
* Can be used to find an artifact given the ID

Example:
```
qax_mac -b -u input/*.*
┌───────────────────────────┬────────────────┬─────────────────────────┬─────────────────────────────┐
│ ID │ Basename │ Type │ Format │
├───────────────────────────┼────────────────┼─────────────────────────┼─────────────────────────────┤
│ bb1b2e93-...-2afa2110b5fb │ rep-seqs.qza │ FeatureData[Sequence] │ DNASequencesDirectoryFormat │
│ 313a0cf3-...-befad4ebf2f3 │ table.qza │ FeatureTable[Frequency] │ BIOMV210DirFmt │
│ 35c32fe7-...-85ef27545f00 │ taxonomy.qzv │ Visualization │ HTML │
└───────────────────────────┴────────────────┴─────────────────────────┴─────────────────────────────┘
```

## extract



This program extract the content of an artifact. By default, if a single file is present it will be extracted in the specified path. If multiple files are present, a directory containing them will be created instead.

_Example:_
```
# Extract representative sequences (will be called rep-seqs.fasta)
qax x -o ./ rep-seqs.qza
# Extract a visualization (a folder called "taxonomy" will be created)
qax x -o ./ taxonomy.qzv
```

## citations

Each Qiime module provides the citations for the software and resources that it uses, storing the citations in BibTeX format inside the artifacts. The cite module allows to extract all the citations from a list of artifacts, removing the duplicates, thus effectively allowing to prepare the bibliography for a complete Qiime2 analysis.

_Example:_
```
qax c files/*.qza > bibliography.bib
```

## provenance

This program allows to print the provenance of an artifact, or to produce a [publication grade graph](docs/qax-provenance.png) of the provenance.

_Example:_
```
# To view a summary
qax p taxonomy.qzv
# To save the plot
qax p -o graph.dot taxonomy.qza
```


## view

This program allows to print the content of an artifact data file to the terminal.
If the artifact contains a single file, it will be printed. Otherwise the user can specify one or multiple files to be printed, and if none
is specified, a list of files will be printed.

```
# Example: count the number of representative sequences
qax view rep-seqs.qza | grep -c '>'
```

## make

This program converts a directory containing a website (index.html) into a
_visualization_ artifact.

```
qax make -o report.qzv /path/to/webpage/
```
Other options:
--debug Enable diagnostics
-h, --help Show help
```
2 changes: 1 addition & 1 deletion docs/3_examples.md → docs/4_examples.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sort: 3
sort: 4
permalink: /examples
---
# Usage examples
Expand Down
20 changes: 20 additions & 0 deletions docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,23 @@

- :book: Documentation: <https://telatin.github.io/bamtocov/>
- :package: Github: <https://github.com/telatin/bamtocov>

**BamToCov** is a suite of tools for coverage analysis written in Nim and built upon the
memory efficient algorithm of [**covtobed**](https://github.com/telatin/covtobed).

The program uses [_htslib_](https://www.htslib.org) to parse BAM/CRAM files, and specifically the Nim-wrapper
[_hts-nim_](https://github.com/brentp/hts-nim).



We designed **BamToCov** to fill some gaps in coverage analysis:
1. Accepting input streams (i.e. not requiring the BAM index, at the expense of speed)
1. Enabling _per strand_ coverage analysis
1. Enabling the _physical coverage_ analysis
1. Using a minimum amount of memory (minimum memory usage)

This makes **BamToCov** a useful companion especially when testing pipelines on small datasets.

For coverage analysis of large datasets it can be useful to consider [Mosdepth](https://github.com/brentp/mosdepth),
that uses indexed BAM/CRAM files as input and is - to our knowledge - the fastest tool for coverage
analyses.

0 comments on commit 68b1921

Please sign in to comment.