changeset 8:6ca28e6144fa draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/medaka commit ed5a3aadbecc0decf9a797447f3ac7700683ea9a"
author iuc
date Mon, 22 Feb 2021 19:59:42 +0000
parents fbf007713188
children eb1f4ba66dc6
files convert_VCF_info_fields.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/convert_VCF_info_fields.py	Wed Feb 10 08:28:25 2021 +0000
+++ b/convert_VCF_info_fields.py	Mon Feb 22 19:59:42 2021 +0000
@@ -15,7 +15,11 @@
 
 
 def pval_to_phredqual(pval):
-    return round(-10 * log10(pval))
+    try:
+        ret = round(-10 * log10(pval))
+    except ValueError:
+        ret = 2147483647  # transform pval of 0.0 to max signed 32 bit int
+    return ret
 
 
 def parseInfoField(info):
@@ -33,7 +37,7 @@
     to_skip = set(['SC', 'SR'])
     for i, line in enumerate(in_vcf):
         if i == 1:
-            out_vcf.write("##convert_VCF_info_fields=0.1\n")
+            out_vcf.write("##convert_VCF_info_fields=0.2\n")
         if line[0:2] == "##":
             if line[0:11] == "##INFO=<ID=":
                 id_ = line[11:].split(',')[0]