Skip to content

Commit

Permalink
feat(derive/instrument): in output, report found unique names
Browse files Browse the repository at this point in the history
  • Loading branch information
a-frantz committed Feb 13, 2024
1 parent 780d3bc commit 09a2be2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/derive/command/instrument.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ 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.len();
metrics.unique_flowcell_names = flowcell_names.len();
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.
Expand Down
18 changes: 6 additions & 12 deletions src/derive/instrument/compute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ pub struct RecordMetrics {
/// flowcell name in their read name.
pub found_flowcell_name: usize,

/// The number of unique instrument names that were detected.
pub unique_instrument_names: usize,
/// The unique instrument names that were detected.
pub unique_instrument_names: HashSet<String>,

/// The number of unique flowcell names that were detected.
pub unique_flowcell_names: usize,
/// The unique flowcell names that were detected.
pub unique_flowcell_names: HashSet<String>,
}

/// Struct holding the final results for an `ngs derive instrument` subcommand
Expand Down Expand Up @@ -297,16 +297,10 @@ pub fn predict(
let instruments = instruments::build_instrument_lookup_table();
let flowcells = flowcells::build_flowcell_lookup_table();

debug!(
"Predicting instruments from instrument names: {:?}",
instrument_names
);
debug!("Predicting instruments from instrument names");
let iid_results = predict_instrument(instrument_names, &instruments);

debug!(
"Predicting instruments from flowcell names: {:?}",
flowcell_names
);
debug!("Predicting instruments from flowcell names");
let fcid_results = predict_instrument(flowcell_names, &flowcells);

resolve_instrument_prediction(iid_results, fcid_results)
Expand Down

0 comments on commit 09a2be2

Please sign in to comment.