Welcome, Guest. Please Login
YaBB - Yet another Bulletin Board
 
  HomeHelpSearchLogin  
 
How to use HyPhy without interactive shell? (Read 5580 times)
CodieR
YaBB Newbies
*
Offline


Curious HyPhy user

Posts: 4
How to use HyPhy without interactive shell?
Nov 5th, 2013 at 10:31am
 
Hello!

I would like to use HyPhy on a HPC, that has no interactive shell.

How do I use the HyPhy-Batch-Language to accomplish this?

I read on the wiki something about this inputRedirect-Array, but I can't get it to work.

Code:
inputRedirect = {};
inputRedirect["01"] = "10"; // (10) Positive Selection
inputRedirect["02"] = "1"; //  (1) Use the random effects branch-site model (2010) to find lineages subject to episodic selection.
inputRedirect["03"] = "1"; //  (1):[Universal] Universal code. (Genebank transl_table=1).
inputRedirect["04"] = "1"; //  (1):[Yes] Both alpha and beta vary along branch-site combinations
inputRedirect["05"] = HYPHY_BASE_DIRECTORY + "inputfile1";
inputRedirect["06"] = HYPHY_BASE_DIRECTORY + "treefile1";
inputRedirect["07"] = HYPHY_BASE_DIRECTORY + "testoutput1";

ExecuteAFile(HYPHY_BASE_DIRECTORY + "test.bf", inputRedirect);
 



My goal is to execute "./HYPHYMP ./mybatchfile.bf" and it should run without interaction. Smiley

Is this possible?

Best Regards,
CodieR
Back to top
 
 
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: How to use HyPhy without interactive shell?
Reply #1 - Nov 5th, 2013 at 10:38am
 
Hi CodieR,

You are on the right track with the input redirect array; what exactly isn't working?

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
 
CodieR
YaBB Newbies
*
Offline


Curious HyPhy user

Posts: 4
Re: How to use HyPhy without interactive shell?
Reply #2 - Nov 6th, 2013 at 3:26am
 
Hi,

if I use the code from above (without the ExecuteAFile-line) and place it in a file called "run.bf" and then execute

./HYPHYMP ./run.bf

nothing happens.

I can't find out, how to tell HyPhy to use the inputredirect-Array.

I tried to use the ExecuteAFile-Command, but I don't know what commands should be placed in the file "test.bf".

Which command tells HyPhy to use the data from the inputRedirect-Array?

Thanks,
CodieR
Back to top
 
 
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: How to use HyPhy without interactive shell?
Reply #3 - Nov 6th, 2013 at 4:06pm
 
Hi CodieR,

You must use the ExecuteAFile command inside a file (like you had in the example) if you want to use the input redirection facility.

If all you want is to bypass the stdin you can always use Unix stream redirections or pipes, like

Code:
$HYPHYMP run.bf < input > output
 



or

Code:
$(echo option1; echo option 2; ... ; echo option N) | HYPHYMP run.bf > output
 



The input file would have to include the inputs you would normally supply interactively, e.g.

Code:
1
/path/to/file
2
/path/to/output/file
 



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
 
CodieR
YaBB Newbies
*
Offline


Curious HyPhy user

Posts: 4
Re: How to use HyPhy without interactive shell?
Reply #4 - Nov 7th, 2013 at 8:03am
 
Hi,

I can't use stream redirection or pipes, because the system is on runlevel 3.

The output of ./HYPHYMP looks just like this:

Code:
[root@hpc hyphy]# ./HYPHYMP

/usr/local/lib/hyphy/Batch file to run::
 



Therefore a Batch file with an inputRedirect-Array is the only solution, I guess.

I played around with this run.bf:

Code:
fprintf(stdout, "Hello!\n");

inputRedirect = {};
inputRedirect["01"] = "10"; // (10) Positive Selection
inputRedirect["02"] = "1";  //  (1) Use the random effects branch-site model (2010) to find lineages subject to episodic selection.
inputRedirect["03"] = "1";  //  (1):[Universal] Universal code. (Genebank transl_table=1).
inputRedirect["04"] = "1";  //  (1):[Yes] Both alpha and beta vary along branch-site combinations
inputRedirect["05"] = HYPHY_BASE_DIRECTORY + "testinput1";
inputRedirect["06"] = HYPHY_BASE_DIRECTORY + "testinput2";
inputRedirect["07"] = HYPHY_BASE_DIRECTORY + "testoutput";
 



It just returns this, but no job is running in the background.

Code:
[root@hpc hyphy]# ./HYPHYMP run.bf
Hello! 



So I am looking for a command to tell HyPhy to read my menu selection from a batch file.

Or am I understanding this wrong?

How do my users can make use of the various options of HyPhy via HyPhy-Batch-File/Language?

I read the documentation, but that chapter is barely explained.

Thanks so far!
CodieR
Back to top
 
 
IP Logged
 
CodieR
YaBB Newbies
*
Offline


Curious HyPhy user

Posts: 4
Re: How to use HyPhy without interactive shell?
Reply #5 - Nov 18th, 2013 at 2:46pm
 
Problem solved!

Solution: (Follow the instructions Wink )

Code:
cmake -DINSTALL_PREFIX=/your/install/path/HyPhy/ .
make MP2
make install
 



Running HYPHYMP from /your/install/path shows me the interactive menu and piping commands works.
It just doesn't run as expected from the folder where it was compiled.

Cheers,
CodieR
Back to top
 
 
IP Logged