Skip to content

Gtars command line interface (CLI)

We've packaged some gtars functionality into a command line interface (CLI) for easy use in shell scripts and terminal environments. The CLI provides access to various genomic tools and utilities built on top of the core gtars Rust library.

To facilitate fast compilation and broad compatibility, the CLI is feature-gated. You can enable only the tools you need to minimize dependencies, binary size, and build time.

There are two main ways to install the gtars CLI:

Terminal window
cargo install gtars-cli --features "uniwig overlaprs igd bbcache scoring fragsplit"
Terminal window
git clone https://github.com/databio/gtars.git
cd gtars
cargo install --path gtars-cli --features "uniwig overlaprs igd bbcache scoring fragsplit"

You can also enable all features with:

Terminal window
cargo install gtars-cli --all-features

The CLI provides the following subcommands (availability depends on features enabled during compilation):

Build and query IGD (Integrated Genome Database) indexes:

Terminal window
gtars igd create --input regions.bed --output index.igd
gtars igd query --database index.igd --query chr1:1000-2000

Compute overlaps between genomic intervals:

Terminal window
gtars overlaprs --input1 regions1.bed --input2 regions2.bed

Generate coverage tracks from BED/BAM files:

Terminal window
gtars uniwig --input reads.bam --output coverage.bw

Cache and manage BED files from bedbase.org:

Terminal window
gtars bbcache get --id GSM123456
gtars bbcache list

Score fragment overlaps against a reference:

Terminal window
gtars scoring --fragments frags.tsv.gz --universe peaks.bed --output scores.txt

Split fragment files by cell barcodes or clusters:

Terminal window
gtars fragsplit --fragments frags.tsv.gz --barcodes clusters.csv --output-dir splits/
Terminal window
gtars --help # Show help
gtars --version # Show version
gtars <command> --help # Show command-specific help

To build the CLI with specific tools:

Terminal window
cargo build --release --features "uniwig,overlaprs,igd"