Welcome, Guest. Please Login
YaBB - Yet another Bulletin Board
 
  HomeHelpSearchLogin  
 
Mac OS X hyphy in "batch" mode? (Read 6688 times)
jamescotton
YaBB Newbies
*
Offline



Posts: 28
London
Gender: male
Mac OS X hyphy in "batch" mode?
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
Back to top
 

James Cotton&&School of Biological and Chemical Sciences&&Queen Mary, University of London&&+44 (0)207 882 3645&&j.a.cotton@qmul.ac.uk&&Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login
WWW WWW  
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: Mac OS X hyphy in "batch" mode?
Reply #1 - 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
 


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
Back to top
 

Associate Professor
Division of Infectious Diseases
Division of Biomedical Informatics
School of Medicine
University of California San Diego
WWW WWW  
IP Logged
 
jamescotton
YaBB Newbies
*
Offline



Posts: 28
London
Gender: male
Re: Mac OS X hyphy in "batch" mode?
Reply #2 - Sep 28th, 2005 at 9:09am
 
Thanks.. I've build it from source without any problems earlier today.

J
Back to top
 

James Cotton&&School of Biological and Chemical Sciences&&Queen Mary, University of London&&+44 (0)207 882 3645&&j.a.cotton@qmul.ac.uk&&Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login
WWW WWW  
IP Logged
 
luobin
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Gender: male
Re: Mac OS X hyphy in "batch" mode?
Reply #3 - 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
Back to top
 
WWW WWW  
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: Mac OS X hyphy in "batch" mode?
Reply #4 - Nov 2nd, 2005 at 10:31am
 
Dear Luobin,
Quote:
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)

 



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

Cheers,
Sergei
Back to top
 

Associate Professor
Division of Infectious Diseases
Division of Biomedical Informatics
School of Medicine
University of California San Diego
WWW WWW  
IP Logged