comparison sanitize_bed.py @ 4:7fe36019c073 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:30:17 -0400
parents
children 0135f1d487a0
comparison
equal deleted inserted replaced
3:2c47c138176e 4:7fe36019c073
1 #!/usr/bin/env python
2
3 import sys
4
5
6 with open(sys.argv[1]) as i:
7 bed_data = i.readlines()
8
9 sanitized_data = []
10 try:
11 for record in bed_data:
12 fields = record.split('\t')
13 sanitized_data.append(
14 '\t'.join(fields[:4] + ['60'] + fields[5:])
15 )
16 except IndexError:
17 pass # leave column number issue to getmasked
18 else:
19 with open(sys.argv[1], 'w') as o:
20 o.writelines(sanitized_data)