fn map_aa_muts(
  node: &AuspiceTreeNode,
  ref_peptides: &BTreeMap<String, Translation>,
  parent_aa_muts: &BTreeMap<String, BTreeMap<usize, Aa>>,
) -> BTreeMap<String, BTreeMap<usize, Aa>> {
  ref_peptides
    .iter()
    //We iterate over all genes that we have ref_peptides for
    .filter_map(|(gene_name, ref_peptide)| match parent_aa_muts.get(gene_name) {
      Some(aa_muts) => Some((
        gene_name.clone(),
        map_aa_muts_for_one_gene(gene_name, node, &ref_peptide.seq, &aa_muts),
      )),
      // Initialize aa_muts, default dictionary style
      None => Some((gene_name.clone(), BTreeMap::new())),
    })
    .collect()
}
/// Takes a node, and adds that nodes aa mutations to the mutations from the parent
/// This function is necessary as there are many genes
// TODO: Treat "nuc" just as another gene, thus reduce duplicate
Takes a node, and adds that nodes aa mutations to the mutations from the parent
This function is necessary as there are many genes
TODO: Treat "nuc" just as another gene, thus reduce duplicate
Takes a node and adds that nodes aa mutations to the mutations from the parent This function is necessary as there are many genes TODO : Treat " nuc " just as another gene thus reduce duplicate
fn map_aa_muts(
  node: &AuspiceTreeNode,
  ref_peptides: &BTreeMap<String, Translation>,
  parent_aa_muts: &BTreeMap<String, BTreeMap<usize, Aa>>,
) -> BTreeMap<String, BTreeMap<usize, Aa>> {
  ref_peptides
    .iter()
    //We iterate over all genes that we have ref_peptides for
    .filter_map(|(gene_name, ref_peptide)| match parent_aa_muts.get(gene_name) {
      Some(aa_muts) => Some((
        gene_name.clone(),
        map_aa_muts_for_one_gene(gene_name, node, &ref_peptide.seq, &aa_muts),
      )),
      // Initialize aa_muts, default dictionary style
      None => Some((gene_name.clone(), BTreeMap::new())),
    })
    .collect()
}
fn map_aa_muts ( node : & AuspiceTreeNode , ref_peptides : & BTreeMap < String , Translation > , parent_aa_muts : & BTreeMap < String , BTreeMap < usize , Aa > > , ) -> BTreeMap < String , BTreeMap < usize , Aa > > { ref_peptides . iter ( ) //We iterate over all genes that we have ref_peptides for . filter_map ( | ( gene_name , ref_peptide ) | match parent_aa_muts . get ( gene_name ) { Some ( aa_muts ) => Some ( ( gene_name . clone ( ) , map_aa_muts_for_one_gene ( gene_name , node , & ref_peptide . seq , & aa_muts ) , ) ) , // Initialize aa_muts, default dictionary style None => Some ( ( gene_name . clone ( ) , BTreeMap :: new ( ) ) ) , } ) . collect ( ) }
Takes a node, and adds that nodes aa mutations to the mutations from the parent
This function is necessary as there are many genes
TODO: Treat "nuc" just as another gene, thus reduce duplicate
Takes a node and adds that nodes aa mutations to the mutations from the parent This function is necessary as there are many genes TODO : Treat " nuc " just as another gene thus reduce duplicate
node
&AuspiceTreeNode
ref_peptides
&BTreeMap<String, Translation>
parent_aa_muts
&BTreeMap<String, BTreeMap<usize, Aa>>
node
&AuspiceTreeNode
ref_peptides
&BTreeMap<String, Translation>
parent_aa_muts
&BTreeMap<String, BTreeMap<usize, Aa>>