Mercurial > repos > iuc > ivar_trim
view sanitize_bed.py @ 9:c092052ed673 draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ivar/ commit f09d0bee3e957564beccb1bdb3610de02f639ec7"
author | iuc |
---|---|
date | Fri, 20 Aug 2021 20:35:46 +0000 |
parents | db536ad45f28 |
children | 5671e1d3d5ee |
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)