pgr is a command-line toolkit for working with genomes and genome-derived
data: sequences, alignments, variation, phylogenies, and related formats.
It is designed as a practical “Swiss Army knife” for day-to-day bioinformatics workflows, with a focus on:
- Format-aware utilities for common genomics file types (FASTA/FASTQ/2bit, AXT/PSL/Chain/Net/MAF, GFF, Newick)
- Interoperable outputs (tabular
cluster/pairconventions, Newick for trees) - Pipeline-friendly behavior (stdin/stdout where possible, predictable output, composable subcommands)
- Performance and robustness (Rust implementation, zero-panic policy for malformed inputs)
High-level capabilities include:
- Sequences: FASTA/FASTQ inspection, filtering, slicing, conversion, and 2bit querying
- Alignments: sorting, filtering, conversion, and coordinate/range utilities across UCSC formats
- Clustering & trees: distance/matrix processing, multiple clustering algorithms, tree cutting and visualization
- Pipelines & plots: integrated workflows (optionally using external tools) and LaTeX/TikZ figure generation
Current release: 0.1.0
cargo install --path . --force #--offline
# test
cargo test -- --test-threads=1After installation, the pgr binary should be available in your PATH:
pgr help
pgr fa --help
pgr fas --helpThis repository contains many subcommands and end-to-end workflows. Extended and curated examples are collected in:
- docs/usage_examples.md
Below are a few quick examples to get started:
# Basic FASTA statistics
pgr fa size tests/fasta/ufasta.fa
# Block FA summary
pgr fas stat tests/fas/example.fas --outgroup
# 2bit range extraction
pgr 2bit range tests/genome/mg1655.2bit NC_000913:1-100Some subcommands depend on external executables:
pgr pl ucscrequires the UCSC kent-tools suite, including programs such asfaToTwoBit,axtChain,chainAntiRepeat,chainMergeSort,chainPreNet,chainNet,netSyntenic,netChainSubset,chainStitchId,netSplit,netToAxt,axtSort,axtToMaf,netFilter,netClass, andchainSplit.pgr pl trfdepends ontrfandspanr.pgr pl reptandpgr pl irdepend onFastK,Profex, andspanr.pgr pl p2mdepends onspanr.pgr fas refinedepends on an external multiple sequence alignment tool such asclustalw(default),muscle, ormafft.
Qiang Wang wang-q@outlook.com
MIT.
Copyright by Qiang Wang.
Written by Qiang Wang wang-q@outlook.com, 2024-