Error checking
lskatz opened this issue · comments
Hi, I'd recommend some error checking on the accession string in src/build_index.rs
. This seemed to work for me around line 600:
if ! lookup.contains_key(&accession_plus_root) {
panic!("Could not find {} in lookup hash", &accession_plus_root);
}
let accession_lineage = lookup[&accession_plus_root]; //now a u32, original when we have complete taxonomy_string
Yes, writing informative error messages throughout sepia is on my to do list! I will look into this and may add your suggested error check.
I'll change line 600 in src/build_index.rs
to:
let accession_lineage = lookup.get(&accession_plus_root).expect(&format!("Could not find {} in lookup hash", &accession_plus_root));
That should have the same result. Do you have the files to recreate the error? I tried to mess up my reference file with empty tax strings/lineages, but that didn't do the trick (probably another thing to 'error' check, because no taxonomy information does not give an error, but may have bigger consequences)
Sounds good! It was when we had the wrong bacillus