Skip to content
Browse files

Fix (?) hal2mafMP behavior with empty maf output

May break things... Also fixed an unrelated bug with --splitBySequence
and --sliceSize where seq size < slice size mafs would get appended to
themselves over and over again.
  • Loading branch information...
1 parent bba26fe commit 9766826d88de7b3d8d3212ce2dde59e2fc452716 @joelarmstrong joelarmstrong committed Nov 20, 2013
Showing with 14 additions and 14 deletions.
  1. +14 −14 maf/hal2mafMP.py
View
28 maf/hal2mafMP.py
@@ -103,20 +103,20 @@ def concatenateSlices(sliceOpts, sliceCmds):
for opt, cmd in zip(sliceOpts, sliceCmds):
first = opt.sliceNumber == 0
sliceMafPath = makeOutMafPath(opt)
- assert os.path.isfile(sliceMafPath)
- sliceNum = opt.sliceNumber
- opt.sliceNumber = None
- outMafPath = makeOutMafPath(opt)
- opt.sliceNumber = sliceNum
- if first:
- os.rename(sliceMafPath, outMafPath)
- else:
- with open(outMafPath, "a") as tgt:
- with open(sliceMafPath, "r") as src:
- for line in src:
- if not line[0] == '#':
- tgt.write(line)
- os.remove(sliceMafPath)
+ if os.path.isfile(sliceMafPath) and opt.sliceNumber is not None:
+ sliceNum = opt.sliceNumber
+ opt.sliceNumber = None
+ outMafPath = makeOutMafPath(opt)
+ opt.sliceNumber = sliceNum
+ if first:
+ os.rename(sliceMafPath, outMafPath)
+ else:
+ with open(outMafPath, "a") as tgt:
+ with open(sliceMafPath, "r") as src:
+ for line in src:
+ if not line[0] == '#':
+ tgt.write(line)
+ os.remove(sliceMafPath)
# Decompose HAL file into slices according to the options then launch
# hal2maf in parallel processes.

0 comments on commit 9766826

Please sign in to comment.
Something went wrong with that request. Please try again.