Permalink
Browse files

dont run phylop on inserts in leaves. they will just be 0 anyway

  • Loading branch information...
1 parent d6e89da commit e789f92a3508ad3fcda4ea4c4bce8bbc5b310719 @glennhickey glennhickey committed Nov 1, 2013
Showing with 9 additions and 4 deletions.
  1. +9 −4 phyloP/halTreePhyloP.py
@@ -42,14 +42,20 @@ def computeTreePhyloP(args):
bigwigCmds = []
while len(visitQueue) > 0:
genome = visitQueue.pop()
+ children = getHalChildrenNames(args.hal, genome)
bedFlags = ""
# Generate a bed file of all regions of
# genome that dont align to parent
bedInsertsFile = outFileName(args, genome, "bed", "inserts", True)
if genome != args.root:
- runShellCommand(
- "halAlignedExtract %s %s --alignedFile %s --complement" % (
- args.hal, genome, bedInsertsFile))
+ if True or len(children) > 0:
+ runShellCommand(
+ "halAlignedExtract %s %s --alignedFile %s --complement" % (
+ args.hal, genome, bedInsertsFile))
+ else:
+ #empty file for leaves (ie we dont want to phyloP anything
+ #-- it all gets lifted down)
+ runShellCommand("rm -f %s && touch %s" % (bedInsertsFile, bedInsertsFile))
bedFlags = "--refBed %s" % bedInsertsFile
# Run halPhyloP on the inserts
@@ -85,7 +91,6 @@ def computeTreePhyloP(args):
bigwigCmds.append(bwCmd)
# Recurse on children.
- children = getHalChildrenNames(args.hal, genome)
for child in children:
visitQueue.append(child)

0 comments on commit e789f92

Please sign in to comment.