mitoNGS / MToolBox

A bioinformatics pipeline to analyze mtDNA from NGS data
http://sourceforge.net/projects/mtoolbox/?source=navbar
GNU General Public License v3.0
86 stars 37 forks source link

bug in prioritized_variants.py #74

Open psterk opened 5 years ago

psterk commented 5 years ago

Variant prioritization fails when "NA" is encountered, which throws the following error:

prioritization.py priority_tmp.txt Traceback (most recent call last):   File "/path/to/MToolBox/MToolBox/prioritization.py", line 42, in     tmp[3]=float(tmp[3]) ValueError: could not convert string to float: NA

I am a bit surprised that this has not been reported before, as I have come across it during the analysis of two datasets I have. I have written a quick hack in my local installation:

prio=[] for k in dic_var_sam2: samples=dic_var_sam2[k] tmp=[k,samples] tmp.extend(clean[k][1:])

start hack

    if tmp[3] == "NA":
            tmp[3] = 555 # ridiculous number, instantly recognizable in output                                                                                                                                            
   # end hack
    tmp[3]=float(tmp[3])
    prio.append(tmp)
dwuab commented 5 years ago

I have just encountered the same error.