fn label_private_mutations(
  non_reversion_substitutions: &[NucSub],
  substitution_label_map: &NucLabelMap,
) -> (Vec<NucSubLabeled>, Vec<NucSub>) {
  let mut labeled_substitutions = Vec::<NucSubLabeled>::new();
  let mut unlabeled_substitutions = Vec::<NucSub>::new();

  for substitution in non_reversion_substitutions {
    // If there's a match in the label map, add mutation to the labelled list, and attach the corresponding labels.
    // If not, add it to the unlabelled list.
    match substitution_label_map.get(&substitution.genotype()) {
      Some(labels) => labeled_substitutions.push(NucSubLabeled {
        sub: substitution.clone(),
        labels: labels.clone(),
      }),
      None => {
        unlabeled_substitutions.push(substitution.clone());
      }
    }
  }

  labeled_substitutions.sort();
  unlabeled_substitutions.dedup();

  (labeled_substitutions, unlabeled_substitutions)
}
/// Subdivides private mutations into labeled and unlabeled, according to label map.
Subdivides private mutations into labeled and unlabeled, according to label map.
Subdivides private mutations into labeled and unlabeled according to label map .
fn label_private_mutations(
  non_reversion_substitutions: &[NucSub],
  substitution_label_map: &NucLabelMap,
) -> (Vec<NucSubLabeled>, Vec<NucSub>) {
  let mut labeled_substitutions = Vec::<NucSubLabeled>::new();
  let mut unlabeled_substitutions = Vec::<NucSub>::new();
  for substitution in non_reversion_substitutions {
    // If there's a match in the label map, add mutation to the labelled list, and attach the corresponding labels.
    // If not, add it to the unlabelled list.
    match substitution_label_map.get(&substitution.genotype()) {
      Some(labels) => labeled_substitutions.push(NucSubLabeled {
        sub: substitution.clone(),
        labels: labels.clone(),
      }),
      None => {
        unlabeled_substitutions.push(substitution.clone());
      }
    }
  }
  labeled_substitutions.sort();
  unlabeled_substitutions.dedup();
  (labeled_substitutions, unlabeled_substitutions)
}
fn label_private_mutations ( non_reversion_substitutions : & [ NucSub ] , substitution_label_map : & NucLabelMap , ) -> ( Vec < NucSubLabeled > , Vec < NucSub > ) { let mut labeled_substitutions = Vec :: < NucSubLabeled > :: new ( ) ; let mut unlabeled_substitutions = Vec :: < NucSub > :: new ( ) ; for substitution in non_reversion_substitutions { // If there's a match in the label map, add mutation to the labelled list, and attach the corresponding labels. // If not, add it to the unlabelled list. match substitution_label_map . get ( & substitution . genotype ( ) ) { Some ( labels ) => labeled_substitutions . push ( NucSubLabeled { sub : substitution . clone ( ) , labels : labels . clone ( ) , } ) , None => { unlabeled_substitutions . push ( substitution . clone ( ) ) ; } } } labeled_substitutions . sort ( ) ; unlabeled_substitutions . dedup ( ) ; ( labeled_substitutions , unlabeled_substitutions ) }
Subdivides private mutations into labeled and unlabeled, according to label map.
Subdivides private mutations into labeled and unlabeled according to label map .
non_reversion_substitutions
&[NucSub]
substitution_label_map
&NucLabelMap
non_reversion_substitutions
&[NucSub]
substitution_label_map
&NucLabelMap