view sanitize_bed.py @ 5:5e668dc9f379 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ivar/ commit a5ff06c631a2a5a0d5d44edd6cb58a599d50918b"
author iuc
date Wed, 19 May 2021 16:50:43 +0000
parents 78bbd17d0703
children e319b5b65879
line wrap: on
line source

#!/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)