diff --git a/src/cli.rs b/src/cli.rs index 9bec2ec..8aa228c 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -1,3 +1,4 @@ +use std::collections::HashSet; use std::ffi::{OsString, OsStr}; use std::path::PathBuf; use structopt::StructOpt; @@ -15,10 +16,10 @@ pub enum CliError { CompressionLevel(String), /// Indicates a bad combination of input and output files was passed. #[error("Bad combination of input and output files: {0}")] - BadInputOutputCombination(String), + BadInputOutputCombination(String) } -/// MGP-DEPLETE command-line interface +/// Scrubby command-line application #[derive(Debug, StructOpt)] pub struct Cli { #[structopt(subcommand)] @@ -29,7 +30,7 @@ pub struct Cli { pub enum Commands { #[structopt(global_settings = &[AppSettings::ColoredHelp, AppSettings::ArgRequiredElseHelp])] /// Clean seqeunce data by removing background taxa (k-mer) or host reads (alignment) - Scrub { + ScrubReads { /// Input filepath(s) (fa, fq, gz, bz). /// /// For paired Illumina you may either pass this flag twice `-i r1.fq -i r2.fq` or give two @@ -149,7 +150,7 @@ impl Cli { /// - An unequal number of `--input` and `--output` are passed pub fn validate_input_output_combination(&self) -> Result<(), CliError> { match &self.commands { - Commands::Scrub { input, output, .. } => { + Commands::ScrubReads { input, output, .. } => { let out_len = output.len(); let in_len = input.len(); if in_len > 2 { @@ -211,4 +212,3 @@ fn parse_level(s: &str) -> Result { }; Ok(lvl) } - diff --git a/src/main.rs b/src/main.rs index 15522ef..600b952 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,8 +25,7 @@ pub enum ScrubbyError { fn main() -> Result<()> { let cli = cli::Cli::from_args(); - // Command specific checks - scrubbing - + // Command line application specific checks cli.validate_input_output_combination()?; Builder::new() @@ -65,7 +64,7 @@ fn main() -> Result<()> { match cli.commands { - cli::Commands::Scrub { + cli::Commands::ScrubReads { input, output, workdir, @@ -80,8 +79,10 @@ fn main() -> Result<()> { } => { let scrubber = scrub::Scrubber::new(workdir, output_format, compression_level)?; - + + log::info!("============================================="); log::info!("Welcome to Scrubby! You name it, we clean it."); + log::info!("============================================="); let mut read_files = input; for (db_index, db_path) in kraken_db.into_iter().enumerate() { @@ -102,8 +103,9 @@ fn main() -> Result<()> { } } - + log::info!("=============================================================="); log::info!("Thank you for using Scrubby! Your sequence data, only cleaner."); + log::info!("=============================================================="); Ok(()) }