X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=erange.git;a=blobdiff_plain;f=bedtoregion.py;fp=bedtoregion.py;h=a6a344d549b907b98343d731b3a348dd9802d0ec;hp=3bcd554e5406a09f31ecc988e8c60733616d0dd5;hb=77dccd7c98d8cdb60caaf178b1123df71ea662c9;hpb=bc30aca13e5ec397c92e67002fbf7a103130b828 diff --git a/bedtoregion.py b/bedtoregion.py index 3bcd554..a6a344d 100755 --- a/bedtoregion.py +++ b/bedtoregion.py @@ -21,14 +21,16 @@ def main(argv=None): def bedToRegion(factor, infilename, outfilename): index = 1 infile = open(infilename) - outfile = open(outfilename, 'w') + outfile = open(outfilename, "w") for line in infile: - if 'track' in line: + if "track" in line: continue + fields = line.split() - line = string.join(fields, '\t') - outfile.write('%s%d\t%s\n' % (factor, index, line)) + line = string.join(fields, "\t") + outfile.write("%s%d\t%s\n" % (factor, index, line)) index += 1 + infile.close() outfile.close()