Skip to content
Snippets Groups Projects
Commit f6844ac9 authored by nina.marthe_ird.fr's avatar nina.marthe_ird.fr
Browse files

added check before division to avoid div by 0 in coverage and id computing

parent fc94a057
No related branches found
No related tags found
No related merge requests found
......@@ -666,8 +666,13 @@ def get_id_cov(feature_id,seg_size,target_list): # seg_size has unoriented segme
add=segment_id_cov("end_deletion",seg_size,source_list[i:],'',first,feature,last)
match+=add[0];subs+=add[1];inser+=add[2];delet+=add[3];first=add[4]
cov=round((match+subs)/(match+subs+delet),3)
id=round(match/(match+subs+inser+delet),3)
denom_cov=match+subs+delet
denom_id=denom_cov+inser
[cov,id]=[0,0]
if denom_cov>0:
cov=round((match+subs)/(match+subs+delet),3)
if denom_id>0:
id=round(match/(match+subs+inser+delet),3)
#var_count=count_variations(feature_id,target_list)
return [cov,id]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment