view sanitize_bed.py @ 16:a1c2aecd7a0d draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ivar/ commit dab395b37976a99a62334c3188073ee8b97f451f
author iuc
date Mon, 11 Mar 2024 15:48:15 +0000
parents ee29337f905c
children
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:
        if record.strip():
            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)