mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Add a more user-friendly error message to maf to interval converter.
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user