Skip to content

Commit

Permalink
add --tree option to override the tree in the hal file
Browse files Browse the repository at this point in the history
  • Loading branch information
glennhickey committed Jul 19, 2013
1 parent 12d2b92 commit b75a1da
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions phyloP/halPhyloPTrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def extractGeneMAFs(options):
os.remove(mafFile)
else:
remove2ndLine(mafFile)
#runShellCommand("msa_view -o SS --in-format MAF %s > %s" % (
#runShellCommand("msa_view -o SS -z --in-format MAF %s > %s" % (
#mafFile, mafFile.replace(".maf", ".SS")))
if len(glob.glob(options.outMafAllPaths)) < 1:
raise RuntimeError("Given BED files do not overlap alignment")
Expand Down Expand Up @@ -138,8 +138,12 @@ def computeAgMAFStats(options):
".maf-e"))

def computeFit(options):
if options.tree is not None:
tree = options.tree
else:
tree = getHalTree(options.hal)
runShellCommand("phyloFit --tree \"%s\" --subst-mod SSREV --sym-freqs %s --out-root %s" % (
getHalTree(options.hal), options.outMafSS,
tree, options.outMafSS,
os.path.splitext(options.outMod)[0]))
runShellCommand("rm -f %s" % options.outMafSS)

Expand Down Expand Up @@ -199,8 +203,14 @@ def main(argv=None):
parser.add_argument("--sliceSize",
help="Slice size for hal2maf.",
type=int, default=None)
parser.add_argument("--tree",
help="String describing phylogeny in NEWICK format "
"that will be used instead of the tree stored in the"
" HAL file. This tree should contain all the species"
" in the alignment. Note that it is best to enclose"
" this string in quotes",
default=None)


args = parser.parse_args()

if not os.path.isfile(args.hal):
Expand Down

0 comments on commit b75a1da

Please sign in to comment.