diff sanitize_bed.py @ 4:f95f403841ad draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ivar/ commit 693df287d23b0fd9dfd134b41d401a438c3f5ad6"
author iuc
date Mon, 22 Jun 2020 07:29:41 -0400
parents
children 584beffa972b
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sanitize_bed.py	Mon Jun 22 07:29:41 2020 -0400
@@ -0,0 +1,20 @@
+#!/usr/bin/env python
+
+import sys
+
+
+with open(sys.argv[1]) as i:
+    bed_data = i.readlines()
+
+sanitized_data = []
+try:
+    for record in bed_data:
+        fields = record.split('\t')
+        sanitized_data.append(
+            '\t'.join(fields[:4] + ['60'] + fields[5:])
+        )
+except IndexError:
+    pass  # leave column number issue to getmasked
+else:
+    with open(sys.argv[1], 'w') as o:
+        o.writelines(sanitized_data)