HyPhy message board
http://www.hyphy.org/cgi-bin/hyphy_forums/YaBB.pl
Methodology Questions >> How to >> Mac OS X hyphy in "batch" mode?
http://www.hyphy.org/cgi-bin/hyphy_forums/YaBB.pl?num=1127913842

Message started by jamescotton on Sep 28th, 2005 at 6:24am

Title: Mac OS X hyphy in "batch" mode?
Post by jamescotton on Sep 28th, 2005 at 6:24am
Is there any way to run HyPhy on OS X as a "batch program" - i.e. to pass it a batch file on the command line, and for it to quit cleanly once it's finished executing it (a bit like PAUP's -n option, if you're familiar with that)..

Ideally, i'd like to run hyphy lots of times from a perl script, and parse the log files hyphy makes in the script too - i'm sure I could do the same thing in a single hyphy batch file, but I already have perl code to do everything I need, so that seems silly.

I guess the other option is to try and build the source code distribution on OS X.

James

Title: Re: Mac OS X hyphy in "batch" mode?
Post by Sergei on Sep 28th, 2005 at 7:40am
Dear James,

The easiest thing to do is to compile HyPhy from source (if you have developer tools installed) - it should compile cleanly. Download the source, ungzip/untar, then open a terminal window, cd to the source directory and type

Code (]
bash build.sh SP
[/code):


or (for multi-processor build)
[code]
bash build.sh MP2

This will make a command line tool that you can then invoke from Perl. The syntax is:

$/pathto/HYPHY BASEPATH=/pathtohyphy/ batchfile

or

$/pathto/HYPHYMP CPU=2 BASEPATH=/pathtohyphy/ batchfile

for dual processor machines. HyPhy will execute the batch file you pass on the command line and then quit. The BASEPATH argument may be needed if your batch file relies on any standard batch files (in TemplateBatchFiles etc), otherwise you can skip it.

Cheers,
Sergei

Title: Re: Mac OS X hyphy in "batch" mode?
Post by jamescotton on Sep 28th, 2005 at 9:09am
Thanks.. I've build it from source without any problems earlier today.

J

Title: Re: Mac OS X hyphy in "batch" mode?
Post by luobin on Nov 1st, 2005 at 4:33pm
I've got some questions about using the command line version of HYPHY:

1) Is this BASEPATH an environment variable that HYPHY reads when it starts?

2) Is there anyway I can find out what kind of parameters that HYPHY takes when it starts? for example, can I type HYPHY --help or something else to get all the possible arguments?

3) Can I use the standard input redirect to make HYPHY run in real "batch"? for example, HYPHY batchfile < input_redirect, so all the options that HYPHY reads are from input_redirect?

Thanks,
Luobin

Title: Re: Mac OS X hyphy in "batch" mode?
Post by Sergei on Nov 2nd, 2005 at 10:31am
Dear Luobin,

wrote on Nov 1st, 2005 at 4:33pm:
1) Is this BASEPATH an environment variable that HYPHY reads when it starts?

2) Is there anyway I can find out what kind of parameters that HYPHY takes when it starts? for example, can I type HYPHY --help or something else to get all the possible arguments?

3) Can I use the standard input redirect to make HYPHY run in real "batch"? for example, HYPHY batchfile < input_redirect, so all the options that HYPHY reads are from input_redirect?


1). By default HyPhy will assume that it's directory is the same one as returned by 'pwd'. BASEPATH command line argument overrides this behavior, but it is not an environment variable (just a command line argument)

2). No (but there should be). Here's a brief list:

[code]
BASEPATH=absolute path (set base HyPhy directory where it looks to template files and such)

USEPATH=absolute path (tell HyPhy to write log files to this path, and also set it as a relative base for for subsequent batch file command line argument).

CPU=number (number of threads to spawn for an MP build)

-c (run in calulator mode)

-p (invoke a result post processing module)

-u (run web update, if curl has been linked in)

MPIOPTIMIZER (for MPI builds, tries to spread some of the optimization over multiple MPI nodes; works well if the function being optimized has N rate categories and there are N+1 available processors)

MPIPARTITIONS (for MPI builds, tries to spread optimization of likelihood functions on multiple partitions among MPI nodes. Needs at least N partitions if there are N nodes)

[/code]

3). Input redirect should work fine, provided all the options are valid (otherwise HyPhy may go into an infinite prompt loop).

Cheers,
Sergei

HyPhy message board » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2024. All Rights Reserved.