/// Associates nucleotide and aminoacid mutations, such that each nucleotide mutations contains a list of aminoacid
/// mutations it is related to, and each aminoacid mutation contains a list of nucleotide mutations it is related to.
Associates nucleotide and aminoacid mutations, such that each nucleotide mutations contains a list of aminoacid
mutations it is related to, and each aminoacid mutation contains a list of nucleotide mutations it is related to.
Associates nucleotide and aminoacid mutations such that each nucleotide mutations contains a list of aminoacid mutations it is related to and each aminoacid mutation contains a list of nucleotide mutations it is related to .
pub fn link_nuc_and_aa_changes(
  substitutions: &[NucSub],
  deletions: &[NucDel],
  aa_substitutions: &[AaSub],
  aa_deletions: &[AaDel],
) -> LinkedNucAndAaChanges {
  let mut linked = LinkedNucAndAaChanges::new(substitutions, deletions, aa_substitutions, aa_deletions);
  for aa_sub in &mut linked.aa_substitutions {
    for nuc_sub in &mut linked.substitutions {
      if aa_sub.sub.codon_nuc_range.contains(nuc_sub.sub.pos) {
        nuc_sub.aa_substitutions.push(aa_sub.sub.clone());
        aa_sub.nuc_substitutions.push(nuc_sub.sub.clone());
      }
    }
    for nuc_del in &mut linked.deletions {
      if have_intersection(&nuc_del.del.to_range(), &aa_sub.sub.codon_nuc_range) {
        nuc_del.aa_substitutions.push(aa_sub.sub.clone());
        aa_sub.nuc_deletions.push(nuc_del.del.clone());
      }
    }
  }
  for aa_del in &mut linked.aa_deletions {
    for nuc_sub in &mut linked.substitutions {
      if aa_del.del.codon_nuc_range.contains(nuc_sub.sub.pos) {
        nuc_sub.aa_deletions.push(aa_del.del.clone());
        aa_del.nuc_substitutions.push(nuc_sub.sub.clone());
      }
    }
    for nuc_del in &mut linked.deletions {
      if have_intersection(&nuc_del.del.to_range(), &aa_del.del.codon_nuc_range) {
        nuc_del.aa_deletions.push(aa_del.del.clone());
        aa_del.nuc_deletions.push(nuc_del.del.clone());
      }
    }
  }
  linked
}
pub fn link_nuc_and_aa_changes ( substitutions : & [ NucSub ] , deletions : & [ NucDel ] , aa_substitutions : & [ AaSub ] , aa_deletions : & [ AaDel ] , ) -> LinkedNucAndAaChanges { let mut linked = LinkedNucAndAaChanges :: new ( substitutions , deletions , aa_substitutions , aa_deletions ) ; for aa_sub in & mut linked . aa_substitutions { for nuc_sub in & mut linked . substitutions { if aa_sub . sub . codon_nuc_range . contains ( nuc_sub . sub . pos ) { nuc_sub . aa_substitutions . push ( aa_sub . sub . clone ( ) ) ; aa_sub . nuc_substitutions . push ( nuc_sub . sub . clone ( ) ) ; } } for nuc_del in & mut linked . deletions { if have_intersection ( & nuc_del . del . to_range ( ) , & aa_sub . sub . codon_nuc_range ) { nuc_del . aa_substitutions . push ( aa_sub . sub . clone ( ) ) ; aa_sub . nuc_deletions . push ( nuc_del . del . clone ( ) ) ; } } } for aa_del in & mut linked . aa_deletions { for nuc_sub in & mut linked . substitutions { if aa_del . del . codon_nuc_range . contains ( nuc_sub . sub . pos ) { nuc_sub . aa_deletions . push ( aa_del . del . clone ( ) ) ; aa_del . nuc_substitutions . push ( nuc_sub . sub . clone ( ) ) ; } } for nuc_del in & mut linked . deletions { if have_intersection ( & nuc_del . del . to_range ( ) , & aa_del . del . codon_nuc_range ) { nuc_del . aa_deletions . push ( aa_del . del . clone ( ) ) ; aa_del . nuc_deletions . push ( nuc_del . del . clone ( ) ) ; } } } linked }
Associates nucleotide and aminoacid mutations, such that each nucleotide mutations contains a list of aminoacid
mutations it is related to, and each aminoacid mutation contains a list of nucleotide mutations it is related to.
Associates nucleotide and aminoacid mutations such that each nucleotide mutations contains a list of aminoacid mutations it is related to and each aminoacid mutation contains a list of nucleotide mutations it is related to .
substitutions
&[NucSub]
deletions
&[NucDel]
aa_substitutions
&[AaSub]
aa_deletions
&[AaDel]