diff --git a/README.md b/README.md index 44b0b64..29fed10 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,25 @@ With the MAP graph, we can use the "principal bundle decomposition" to study com ## Documentation, Usage and Examples +Command Line Tools: + +PGR-TK provides the following tool to + +- create the PGR-TK sequence and index database + - `pgr-mdb`: create pgr minimizer database with AGC backend + - `pgr-make-frgdb`: create PGR-TK fragment minimizer database with frg format backend +- query the database to fetch sequences + - `pgr-query`: query a PGR-TK pangenome sequence database, ouput the hit summary and generate fasta files from the target sequences +- generate MAP-graph in GFA format and principal bundle decomposition bed file + - `pgr-pbundle-decomp`: generat the principal bundle decomposition though MAP Graph from a fasta file +- generate SVG from the principal bundle decomposition bed file + - `pgr-pbundle-bed2svg`: generate SVG from a principal bundle bed file +- auxiliary tools + - `pgr-pbundle-bed2sorted`: generate annotation file with a sorting order from the principal bundle decomposition + - `pgr-pbundle-bed2dist`: generate alignment scores between sequences using bundle decomposition from a principal bundle bed file + +For each comannd, `command --help` provides the detail usage information. + The API documentation is at https://sema4-research.github.io/pgr-tk/ A collection of Jupyter Notebooks are at https://github.com/sema4-Research/pgr-tk-notebooks/ diff --git a/pgr-bin/src/bin/pgr-fetch-seqs.rs b/pgr-bin/src/bin/pgr-fetch-seqs.rs index 290b046..28fc76d 100644 --- a/pgr-bin/src/bin/pgr-fetch-seqs.rs +++ b/pgr-bin/src/bin/pgr-fetch-seqs.rs @@ -6,10 +6,11 @@ use std::fs::File; use std::io::{self, BufRead, BufReader, BufWriter, Write}; use std::path::Path; +/// List or fetch sequences from a PGR-TK database #[derive(Parser, Debug)] #[clap(name = "pgr-fetch-seqs")] #[clap(author, version)] -#[clap(about = "list or fetch sequences from a pgr database", long_about = None)] +#[clap(about, long_about = None)] struct CmdOptions { /// the prefix to a PGR-TK sequence database pgr_db_prefix: String, diff --git a/pgr-bin/src/bin/pgr-make-frgdb.rs b/pgr-bin/src/bin/pgr-make-frgdb.rs index 311d406..028ad4c 100644 --- a/pgr-bin/src/bin/pgr-make-frgdb.rs +++ b/pgr-bin/src/bin/pgr-make-frgdb.rs @@ -8,10 +8,11 @@ use std::fs::File; use std::io::{BufRead, BufReader}; use std::path::Path; +/// Create PGR-TK fragment minimizer database with frg format backend #[derive(Parser, Debug)] #[clap(name = "pgr-make-frgdb")] #[clap(author, version)] -#[clap(about = "create PGR-TK fragment minimizer database with frg format backend", long_about = None)] +#[clap(about, long_about = None)] struct CmdOptions { /// the path to the file contains the paths to the fastx files to load filepath: String, diff --git a/pgr-bin/src/bin/pgr-mdb.rs b/pgr-bin/src/bin/pgr-mdb.rs index 4999ecf..ae5ae3f 100644 --- a/pgr-bin/src/bin/pgr-mdb.rs +++ b/pgr-bin/src/bin/pgr-mdb.rs @@ -10,10 +10,11 @@ use std::io::{BufRead, BufReader}; use pgr_db::seq_db; +/// Create pgr minimizer database with AGC backend #[derive(Parser, Debug)] #[clap(name = "pgr-mdb")] #[clap(author, version)] -#[clap(about = "create pgr minimizer db", long_about = None)] +#[clap(about, long_about = None)] struct CmdOptions { filepath: String, prefix: String, diff --git a/pgr-bin/src/bin/pgr-pbundle-bed2dist.rs b/pgr-bin/src/bin/pgr-pbundle-bed2dist.rs index ff3aa18..23aec5c 100644 --- a/pgr-bin/src/bin/pgr-pbundle-bed2dist.rs +++ b/pgr-bin/src/bin/pgr-pbundle-bed2dist.rs @@ -6,12 +6,15 @@ use std::io::{BufRead, BufReader, BufWriter, Write}; use std::path::Path; use std::{fs::File, path}; +/// Generate alignment scores between sequences using bundle decomposition from a principal bundle bed file #[derive(Parser, Debug)] #[clap(name = "pgr-pbundle-bed2dist")] #[clap(author, version)] -#[clap(about = "generate alignment scores between contigs using bundle decomposition from a principal bundle bed file", long_about = None)] +#[clap(about, long_about = None)] struct CmdOptions { + /// the path to the pricipal bundle bed file bed_file_path: String, + /// the prefix of the output file output_prefix: String, } diff --git a/pgr-bin/src/bin/pgr-pbundle-bed2sorted.rs b/pgr-bin/src/bin/pgr-pbundle-bed2sorted.rs index a083452..8bfd758 100644 --- a/pgr-bin/src/bin/pgr-pbundle-bed2sorted.rs +++ b/pgr-bin/src/bin/pgr-pbundle-bed2sorted.rs @@ -5,10 +5,11 @@ use std::io::{BufRead, BufReader, BufWriter, Write}; use std::path::Path; use std::{fs::File, path}; +/// Generate annotation file with a sorting order from the principal bundle decomposition #[derive(Parser, Debug)] #[clap(name = "pgr-pbundle-bed2sorted")] #[clap(author, version)] -#[clap(about = "sort the contig by bunldes", long_about = None)] +#[clap(about, long_about = None)] struct CmdOptions { /// the path to the pricipal bundle bed file bed_file_path: String, diff --git a/pgr-bin/src/bin/pgr-pbundle-bed2svg.rs b/pgr-bin/src/bin/pgr-pbundle-bed2svg.rs index 9aae543..1bc9305 100644 --- a/pgr-bin/src/bin/pgr-pbundle-bed2svg.rs +++ b/pgr-bin/src/bin/pgr-pbundle-bed2svg.rs @@ -6,10 +6,11 @@ use std::{fs::File, path}; use svg::node::{self, element, Node}; use svg::Document; +/// Generate SVG from a principal bundle bed file #[derive(Parser, Debug)] #[clap(name = "pgr-pbundle-bed2svg")] #[clap(author, version)] -#[clap(about = "generate SVG from a principal bundle bed file", long_about = None)] +#[clap(about, long_about = None)] struct CmdOptions { /// the path to the pricipal bundle bed file bed_file_path: String, diff --git a/pgr-bin/src/bin/pgr-pbundle-decomp.rs b/pgr-bin/src/bin/pgr-pbundle-decomp.rs index 77f0a61..1732220 100644 --- a/pgr-bin/src/bin/pgr-pbundle-decomp.rs +++ b/pgr-bin/src/bin/pgr-pbundle-decomp.rs @@ -10,10 +10,11 @@ use std::{ path::Path, }; +/// Generat the principal bundle decomposition though MAP Graph from a fasta file #[derive(Parser, Debug)] #[clap(name = "pgr-pbundle-decomp")] #[clap(author, version)] -#[clap(about = "take a fasta file and output the principal bundle decomposition though MAP Graph", long_about = None)] +#[clap(about, long_about = None)] struct CmdOptions { /// the path to the input fasta file fastx_path: String, diff --git a/pgr-bin/src/bin/pgr-query.rs b/pgr-bin/src/bin/pgr-query.rs index 3f33f28..fe6674f 100644 --- a/pgr-bin/src/bin/pgr-query.rs +++ b/pgr-bin/src/bin/pgr-query.rs @@ -7,10 +7,12 @@ use std::fs::File; use std::io::{self, BufWriter, Write}; use std::path::Path; +/// Query a PGR-TK pangenome sequence database, +/// ouput the hit summary and generate fasta files from the target sequences #[derive(Parser, Debug)] #[clap(name = "pgr-query")] #[clap(author, version)] -#[clap(about = "query a pgr pangenome database and ouput the hits", long_about = None)] +#[clap(about, long_about = None)] struct CmdOptions { /// the prefix to a PGR-TK sequence database pgr_db_prefix: String,