Skip to content

Commit

Permalink
style(derive/instrument): a bit of code clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
a-frantz committed Feb 13, 2024
1 parent 05a53fc commit eae95c7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
2 changes: 0 additions & 2 deletions src/derive/command/instrument.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
23 changes: 12 additions & 11 deletions src/derive/instrument/compute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ pub struct QueryResult {
pub result: HashSet<String>,
}

/// TODO
pub struct Queries {
/// TODO
pub instrument_name_queries: Vec<QueryResult>,

/// TODO
pub flowcell_name_queries: Vec<QueryResult>,
}

/// Metrics related to how read records were processed.
#[derive(Debug, Default, Serialize)]
pub struct RecordMetrics {
Expand All @@ -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<String>,

/// 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 @@ -113,8 +116,7 @@ impl DerivedInstrumentResult {
confidence: String,
evidence: Option<String>,
comment: Option<String>,
instrument_name_queries: Vec<QueryResult>,
flowcell_name_queries: Vec<QueryResult>,
queries: Queries,
records: RecordMetrics,
) -> Self {
DerivedInstrumentResult {
Expand All @@ -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,
}
}
Expand Down Expand Up @@ -176,7 +178,6 @@ pub fn possible_instruments_for_query(
}
}

debug!(" [*] {}, Possible Instruments: {:?}", query, result_set);
QueryResult {
query,
result: result_set,
Expand Down

0 comments on commit eae95c7

Please sign in to comment.