From f6426c9c501e8f3c7447bc529949ff42a436ead4 Mon Sep 17 00:00:00 2001 From: Daniel DW Kim Date: Thu, 9 Jan 2025 13:12:45 +0900 Subject: [PATCH] replace m8 with tsv --- src/modules/profile.rs | 8 ++++---- src/util/arg_parser.rs | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/modules/profile.rs b/src/modules/profile.rs index 1b2a414..9430277 100644 --- a/src/modules/profile.rs +++ b/src/modules/profile.rs @@ -8,7 +8,7 @@ use std::fs::File; use std::io::{self, BufRead, BufReader, BufWriter, Write}; use std::path::Path; -fn profile(m8_file: &str, mapping: &str, output_dir: &str, threshold: usize, print_copiness: bool) -> io::Result<()> { +fn profile(tsv_file: &str, mapping: &str, output_dir: &str, threshold: usize, print_copiness: bool) -> io::Result<()> { let mut gene_to_spe: HashMap> = HashMap::new(); let mut species_set: HashSet = HashSet::new(); @@ -32,7 +32,7 @@ fn profile(m8_file: &str, mapping: &str, output_dir: &str, threshold: usize, pri if let Some(output) = output.as_mut() { writeln!(output, "Query\tMultipleCopyPercent\tSingleCopyPercent")?; } - let file = File::open(m8_file)?; + let file = File::open(tsv_file)?; let reader = BufReader::new(file); let mut curr_query: Option = None; let mut spe_cnt: HashMap = HashMap::new(); @@ -99,7 +99,7 @@ fn output_statistics_and_genes(output: &mut Option, query: &str, sp pub fn run(args: &Args, _: &var::BinaryPaths) -> Result<(), Box> { // Retrieve arguments let input_db = args.profile_input_db.clone().unwrap_or_else(|| { crate::envs::error_handler::error(crate::envs::error_handler::ERR_ARGPARSE, Some("profile - input".to_string())); }); - let input_m8 = args.profile_input_m8.clone().unwrap_or_else(|| { crate::envs::error_handler::error(crate::envs::error_handler::ERR_ARGPARSE, Some("profile - mapping".to_string())); }); + let input_tsv = args.profile_input_tsv.clone().unwrap_or_else(|| { crate::envs::error_handler::error(crate::envs::error_handler::ERR_ARGPARSE, Some("profile - mapping".to_string())); }); let output = args.profile_output.clone().unwrap_or_else(|| { crate::envs::error_handler::error(crate::envs::error_handler::ERR_ARGPARSE, Some("profile - output".to_string())); }); let threshold = args.profile_threshold.unwrap_or_else(|| { crate::envs::error_handler::error(crate::envs::error_handler::ERR_ARGPARSE, Some("profile - threshold".to_string())); }); let print_copiness = args.profile_print_copiness.unwrap_or_else(|| { crate::envs::error_handler::error(crate::envs::error_handler::ERR_ARGPARSE, Some("profile - print_copiness".to_string())); }); @@ -113,7 +113,7 @@ pub fn run(args: &Args, _: &var::BinaryPaths) -> Result<(), Box>, pub profile_input_db: Option, - pub profile_input_m8: Option, + pub profile_input_tsv: Option, pub profile_output: Option, pub profile_threshold: Option, pub profile_print_copiness: Option, @@ -448,8 +448,8 @@ impl Args { Some(EasyCore { output, .. }) => Some(format!("{}/proteome/proteome_db", own(output))), Some(EasySearch { output, .. }) => Some(format!("{}/proteome/proteome_db", own(output))), _ => None, }; - let profile_input_m8 = match &args.command { - Some(Profile { input_m8, .. }) => Some(own(input_m8)), + let profile_input_tsv = match &args.command { + Some(Profile { input_tsv, .. }) => Some(own(input_tsv)), Some(EasyCore { output, .. }) => Some(format!("{}/cluster/clust.tsv", own(output))), Some(EasySearch { output, .. }) => Some(format!("{}/search/search.m8", own(output))), _ => None, }; @@ -559,7 +559,7 @@ impl Args { Args { command: args.command, version: args.version, threads, verbosity, createdb_input, createdb_output, createdb_model, createdb_keep, createdb_overwrite, createdb_max_len, createdb_gpu, createdb_use_python, createdb_use_foldseek, createdb_afdb_lookup, createdb_afdb_local, - profile_input_db, profile_input_m8, profile_output, profile_threshold, profile_print_copiness, + profile_input_db, profile_input_tsv, profile_output, profile_threshold, profile_print_copiness, search_input, search_target, search_output, search_tmp, search_keep_aln_db, search_search_options, cluster_input, cluster_output, cluster_tmp, cluster_keep_cluster_db, cluster_cluster_options, tree_db, tree_input, tree_output, tree_aligner, tree_tree_builder, tree_aligner_options, tree_tree_options, tree_threshold,