prepare_fasta 0.2.0

Compute hash-based signatures of sequence, and perform pre-processing
Documentation
use clap::Parser;
use prepare_fasta::{parse_records, RecordParseConfig};
use std::path::PathBuf;

/// Prepare reference sequences for indexing
/// and compute their signature.
#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
struct Args {
    #[arg(short, long, value_delimiter = ',')]
    /// Input files to process
    input: Vec<PathBuf>,

    /// The length a polyA must be to clip it
    #[arg(short, long)]
    polya_clip_length: Option<usize>,

    /// Stem of the output files. The result will
    /// be a new reference (ending in `.fa.gz`) and
    /// a file with the reference signatures
    /// (ending in `.json`).
    #[arg(short, long)]
    output_prefix: PathBuf,
}

fn main() -> anyhow::Result<()> {
    let cli = Args::parse();
    let Args {
        input,
        polya_clip_length,
        output_prefix,
    } = cli;
    parse_records(RecordParseConfig {
        input,
        polya_clip_length,
        output_stem: output_prefix,
    })?;
    Ok(())
}