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.
Installation
Section titled “Installation”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:
Via Cargo (Rust's package manager)
Section titled “Via Cargo (Rust's package manager)”cargo install gtars-cli --features "uniwig overlaprs igd bbcache scoring fragsplit"From source
Section titled “From source”git clone https://github.com/databio/gtars.gitcd gtarscargo install --path gtars-cli --features "uniwig overlaprs igd bbcache scoring fragsplit"You can also enable all features with:
cargo install gtars-cli --all-featuresAvailable Commands
Section titled “Available Commands”The CLI provides the following subcommands (availability depends on features enabled during compilation):
Build and query IGD (Integrated Genome Database) indexes:
gtars igd create --input regions.bed --output index.igdgtars igd query --database index.igd --query chr1:1000-2000overlaprs
Section titled “overlaprs”Compute overlaps between genomic intervals:
gtars overlaprs --input1 regions1.bed --input2 regions2.beduniwig
Section titled “uniwig”Generate coverage tracks from BED/BAM files:
gtars uniwig --input reads.bam --output coverage.bwbbcache
Section titled “bbcache”Cache and manage BED files from bedbase.org:
gtars bbcache get --id GSM123456gtars bbcache listscoring
Section titled “scoring”Score fragment overlaps against a reference:
gtars scoring --fragments frags.tsv.gz --universe peaks.bed --output scores.txtfragsplit
Section titled “fragsplit”Split fragment files by cell barcodes or clusters:
gtars fragsplit --fragments frags.tsv.gz --barcodes clusters.csv --output-dir splits/Global Options
Section titled “Global Options”gtars --help # Show helpgtars --version # Show versiongtars <command> --help # Show command-specific helpBuilding with Specific Features
Section titled “Building with Specific Features”To build the CLI with specific tools:
cargo build --release --features "uniwig,overlaprs,igd"