diff --git a/src/simpleaf_commands.rs b/src/simpleaf_commands.rs index 8f1b0e8..f4e5f7b 100644 --- a/src/simpleaf_commands.rs +++ b/src/simpleaf_commands.rs @@ -479,7 +479,7 @@ pub struct ChemistryAddOpts { /// the geometry to which the chemistry maps, wrapped in quotes. #[arg(short, long)] pub geometry: String, - /// the expected orientation indicating the direction to the reference sequences. + /// the expected orientation indicating the direction of biological reads to reference sequences. #[arg(short, long, value_parser = clap::builder::PossibleValuesParser::new(["fw", "rc", "both"]))] pub expected_ori: String, /// the (fully-qualified) path to a local file that will be copied into diff --git a/src/simpleaf_commands/quant.rs b/src/simpleaf_commands/quant.rs index 760fcc4..d01e449 100644 --- a/src/simpleaf_commands/quant.rs +++ b/src/simpleaf_commands/quant.rs @@ -386,8 +386,8 @@ pub fn map_and_quant(af_home_path: &Path, opts: MapQuantOpts) -> anyhow::Result< let ori: ExpectedOri; // if the user set the orientation, then // use that explicitly - if let Some(o) = opts.expected_ori.clone() { - ori = ExpectedOri::from_str(&o).with_context(|| { + if let Some(o) = &opts.expected_ori { + ori = ExpectedOri::from_str(o).with_context(|| { format!( "Could not parse orientation {}. It must be one of the following: {:?}", o, diff --git a/src/utils/af_utils.rs b/src/utils/af_utils.rs index cda2b5e..1c75cb6 100644 --- a/src/utils/af_utils.rs +++ b/src/utils/af_utils.rs @@ -14,7 +14,7 @@ use strum_macros::EnumIter; use tracing::{error, info, warn}; use crate::atac::commands::AtacChemistry; -use crate::utils::chem_utils::CustomChemistry; +use crate::utils::chem_utils::{get_single_custom_chem_from_file, CustomChemistry}; use crate::utils::{self, prog_utils}; use super::chem_utils::{QueryInRegistry, LOCAL_PL_PATH_KEY, REMOTE_PL_URL_KEY}; @@ -201,6 +201,7 @@ impl Chemistry { // and when we propagate more information about paired-end mappings. ExpectedOri::Forward } + Chemistry::Rna(RnaChemistry::Other(_)) => ExpectedOri::default(), _ => ExpectedOri::default(), } } @@ -225,7 +226,7 @@ impl Chemistry { s => { // first, we check if the chemistry is a known chemistry for the given mapper // Second, we check if its a registered custom chemistry - // Third, we check if its a custom chemistry string + // Third, we check if its a custom geometry string if index_type.is_known_chem(s) { Chemistry::Rna(RnaChemistry::Other(s.to_string())) } else if let Some(chem) = diff --git a/src/utils/chem_utils.rs b/src/utils/chem_utils.rs index c697a26..777e309 100644 --- a/src/utils/chem_utils.rs +++ b/src/utils/chem_utils.rs @@ -107,13 +107,8 @@ impl CustomChemistry { } /// Parse the value that corresponds to a key in the top-level custom chemistry JSON object. - /// The key ONLY is used for error messages and assigning the name field of the CustomChemistry struct. + /// The key is ONLY used for error messages and assigning the name field of the CustomChemistry struct. /// The value must be an json value object with a valid geometry field that can be parsed into a CustomChemistry struct. - /// The value corresponding to this key can be either - /// 1. An object having the associated / expected keys - /// 2. A string representing the geometry - /// The second case here is legacy from older versions of simpleaf and deprecated, so we should - /// warn by default when we see it. pub fn from_value(key: &str, value: &Value) -> Result { match value { // deprecated case. Need to warn and return an error