Add a more user-friendly error message to maf to interval converter.

This commit is contained in:
Daniel Blankenberg
2008-03-19 15:58:05 +00:00
parent 11040a4616
commit 4d3c8fd595
@@ -13,11 +13,14 @@ def __main__():
count = 0
#write interval header line
out.write( "#chrom\tstart\tend\tstrand\n" )
for maf in bx.align.maf.Reader( open(input_name, 'r') ):
c = maf.get_component_by_src_start(species)
if c is not None:
out.write( "%s\t%i\t%i\t%s\n" % (bx.align.src_split(c.src)[-1], c.get_forward_strand_start(), c.get_forward_strand_end(), c.strand) )
count += 1
try:
for maf in bx.align.maf.Reader( open(input_name, 'r') ):
c = maf.get_component_by_src_start(species)
if c is not None:
out.write( "%s\t%i\t%i\t%s\n" % (bx.align.src_split(c.src)[-1], c.get_forward_strand_start(), c.get_forward_strand_end(), c.strand) )
count += 1
except Exception, e:
print >> sys.stderr, "There was a problem processing your input: %s" % e
out.close()
print "%i MAF blocks converted to Genomic Intervals for species %s." % (count, species)