Skip to content

Commit

Permalink
prevent overwriting?
Browse files Browse the repository at this point in the history
  • Loading branch information
tibvdm committed Apr 15, 2024
1 parent b5f9ed2 commit 114a2aa
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions sa-mappings/src/functionality.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ impl FunctionAggregator {

for protein in proteins.iter() {
for annotation in protein.get_functional_annotations().split(';') {
let annotation = annotation.to_string();
let annotation_string = annotation.to_string();

match annotation.chars().next() {
Some('E') => ec_numbers.insert(annotation.clone()),
Some('G') => go_terms.insert(annotation.clone()),
Some('I') => interpros.insert(annotation.clone()),
match annotation_string.chars().next() {
Some('E') => ec_numbers.insert(annotation_string.clone()),
Some('G') => go_terms.insert(annotation_string.clone()),
Some('I') => interpros.insert(annotation_string.clone()),
_ => panic!("Invalid annotation")
};

data.entry(annotation).and_modify(|e| *e += 1).or_insert(1);
data.entry(annotation_string).and_modify(|e| *e += 1).or_insert(1);
}
}

Expand Down

0 comments on commit 114a2aa

Please sign in to comment.