From eae95c751cdbdd102196a3961987df0c78638030 Mon Sep 17 00:00:00 2001 From: Andrew Frantz Date: Tue, 13 Feb 2024 12:35:05 -0500 Subject: [PATCH] style(derive/instrument): a bit of code clean up --- src/derive/command/instrument.rs | 2 -- src/derive/instrument/compute.rs | 23 ++++++++++++----------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/derive/command/instrument.rs b/src/derive/command/instrument.rs index 48de551..a0776f8 100644 --- a/src/derive/command/instrument.rs +++ b/src/derive/command/instrument.rs @@ -81,8 +81,6 @@ pub fn derive(args: DeriveInstrumentArgs) -> anyhow::Result<()> { counter.get().to_formatted_string(&Locale::en) ); metrics.total_records = counter.get(); - metrics.unique_instrument_names = instrument_names.clone(); - metrics.unique_flowcell_names = flowcell_names.clone(); // (2) Derive the predict instrument results based on these detected // instrument names and flowcell names. diff --git a/src/derive/instrument/compute.rs b/src/derive/instrument/compute.rs index 83b69bb..c875aba 100644 --- a/src/derive/instrument/compute.rs +++ b/src/derive/instrument/compute.rs @@ -49,6 +49,15 @@ pub struct QueryResult { pub result: HashSet, } +/// TODO +pub struct Queries { + /// TODO + pub instrument_name_queries: Vec, + + /// TODO + pub flowcell_name_queries: Vec, +} + /// Metrics related to how read records were processed. #[derive(Debug, Default, Serialize)] pub struct RecordMetrics { @@ -66,12 +75,6 @@ pub struct RecordMetrics { /// The total number of records that contained a valid /// flowcell name in their read name. pub found_flowcell_name: usize, - - /// The unique instrument names that were detected. - pub unique_instrument_names: HashSet, - - /// The unique flowcell names that were detected. - pub unique_flowcell_names: HashSet, } /// Struct holding the final results for an `ngs derive instrument` subcommand @@ -113,8 +116,7 @@ impl DerivedInstrumentResult { confidence: String, evidence: Option, comment: Option, - instrument_name_queries: Vec, - flowcell_name_queries: Vec, + queries: Queries, records: RecordMetrics, ) -> Self { DerivedInstrumentResult { @@ -123,8 +125,8 @@ impl DerivedInstrumentResult { confidence, evidence, comment, - instrument_name_queries, - flowcell_name_queries, + instrument_name_queries: queries.instrument_name_queries, + flowcell_name_queries: queries.flowcell_name_queries, records, } } @@ -176,7 +178,6 @@ pub fn possible_instruments_for_query( } } - debug!(" [*] {}, Possible Instruments: {:?}", query, result_set); QueryResult { query, result: result_set,