iqbal-lab / Mykrobe-predictor

Antibiotic resistance predictions in minutes on a laptop
Other
50 stars 19 forks source link

Seq Fault if best hit doesn't return a valid enum #46

Closed Phelimb closed 9 years ago

Phelimb commented 9 years ago

I've just pulled the latest code from master into my prototype_ont_support branch, which includes your updates to the species code including creating the base_species code etc So now my ONT branch species stuff is broken, which is fine, but I'm a bit cinfused and not sure I can fix it.

Could you take a look please?

The command I am trying to run is

--file /data2/users/phelim/data/staph/nanopore/20150120_MN02148_FAA12662_BOWDEN03_MdC_JR_Brut_v4/reads/downloads/all/2d.fq --install_dir ~/dev/git/myKrobe-predictor

It segfaults, because in line 186 of species.c you have this

species_info->phylo_group_covg_info->percentage_coverage[CoagNeg] = max(species_info->phylo_group_covg_info->percentage_coverage[CoagNeg] , species_info->species_covg_info->percentage_coverage[best_staph_species] );

and best_staph_species is some enormous positive number

and the reason for that is that get_best_hit looks for the best hit and basically decides there is no hit, so curr is left at the initial value of -1, which gets returned - there is no check for what happens if curr=-1 at the end of the loop

Actually I dont see how it can ever be the case that there is no best hit, even if the best os the first zero

iqbal-lab commented 9 years ago

I should have said - this commit 9032996fd1174e83890425c918ca27c5217563ff does work for species id for that dataset

iqbal-lab commented 9 years ago

Phelim - I think this is fixed, so closing.

iqbal-lab commented 9 years ago

Reopen if you diagree