Created
April 14, 2010 15:33
-
-
Save daler/365946 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
usage = """ | |
Ensures start/stop coords in a BED file are integers | |
and not in exponential notation (like 9.3e+07) | |
Usage: | |
python fix_coords.py input.bed > fixed.bed | |
""" | |
import sys | |
if len(sys.argv)<2: | |
print usage | |
sys.exit() | |
for line in open(sys.argv[1]): | |
L = line.strip().split('\t') | |
start = float(L[1]) | |
stop = float(L[2]) | |
L[1] = '%d' % start | |
L[2] = '%d' % stop | |
sys.stdout.write('\t'.join(L)+'\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment