Welcome, Guest. Please Login
YaBB - Yet another Bulletin Board
 
  HomeHelpSearchLogin  
 
Including Codon Models in batch files (Read 2952 times)
Ricardo Tiburcio
YaBB Newbies
*
Offline


Feed your monkey!

Posts: 4
Including Codon Models in batch files
Aug 19th, 2008 at 1:27pm
 
Hi!

I'm trying to inlude the .bf file "MG94.mdl", located at ".../HYPHY_Source/SubstitutionModels/Codon" in another batch analysis. To do this I use the #include command, but the result is justa a segmentation error and the following error messages:

Operation MAccess is not defined for 0
Current BL Command:Branch  under condition h<64 to 4 else 8

How can I use the models avaiable at ../HYPHY_Source/SubstitutionModels in my own analysis?

Thanks

Ps.: I'm running the analysis in a linux operating system.
Back to top
 
 
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: Including Codon Models in batch files
Reply #1 - Aug 19th, 2008 at 4:27pm
 
Dear Ricardo,

Files in HYPHY_Source/SubstitutionModels/Codon are only meaningful for GUI based analyses. You can make use of standard models by including a

Code:
SelectTemplateModel(datafilter);
 



batch command. Take a look at TemplateBatchFiles/AnalyzeCodonData.bf for an example.

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


Feed your monkey!

Posts: 4
Re: Including Codon Models in batch files
Reply #2 - Aug 19th, 2008 at 6:33pm
 
Dear Sergei

Thanks for your help. The command that you recomends
Code:
SelectTemplateModel(datafilter) 


help me to solve my currents problems.
Future I will need to run batch files entirely in backround in a linux server, using a comand like:

> nohup ./HYPHY batch_file.bf &

I believe that, in order to make it possible, I will need to define the evolutionary model inside the batch file code.      
Is there some way to make this possible using codon models without define explicitly a 64x64 matrix, as can be done with DNA evolutionary models by define, for example:

F81ratematrix = {{*,a,a,a}{a,*,a,a}{a,a,*,a}{a,a,a,*}};?

Thanks



Back to top
 
 
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: Including Codon Models in batch files
Reply #3 - Aug 19th, 2008 at 9:32pm
 
Dear Ricardo,

You can use stdin redirection to automate the choices required by SelectTemplateModel. Do a search on ExecuteAFile on these boards for some examples. Alternatively, something as simple as

Code:
$(echo choice 1; echo choice 2; ... ; echo choice n) | nohup ./HYPHYMP ... &
 



should work with sh or bash

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


Feed your monkey!

Posts: 4
Re: Including Codon Models in batch files
Reply #4 - Aug 20th, 2008 at 7:07am
 
Dear Sergei

Thanks again for your sugestions. I try stdin redirection and my batch files worked perfectly.

Ricardo Tiburcio
Back to top
 
 
IP Logged
 
Ricardo Tiburcio
YaBB Newbies
*
Offline


Feed your monkey!

Posts: 4
Re: Including Codon Models in batch files
Reply #5 - Aug 20th, 2008 at 1:06pm
 
Dear Sergei

SelectTemplateModel(datafilter) works nice with nucleotide data, but not with codon data. When I use the code
Code:
/*Le os dados*/
DataSet myData = ReadDataFile ("../data/demo.seq");
/*Cria um filtro*/
DataSetFilter filteredData = CreateFilter (myData,3);
SelectTemplateModel(filteredData);
/*lê a árvore*/
Tree myTree = ((a,b),c,d);
/*Maximiza a verossimilhança*/
LikelihoodFunction theLikFun = (filteredData, myTree);
Optimize (paramValues, theLikFun);
fprintf  (stdout, "\nDados totais: ", theLikFun, "\n"); 


the batch file correctely prompts for user imput codon model, but then returns this error messages:
Code:
Error:
Operation MAccess is not defined for 0
Current BL Command:Branch  under condition h<64 to 4 else 8

Check errors.log for details on execution errors.

Check messages.log details of this run.
 


This appears to occours with any data file or model.

I also observed that the DataSetId must to be filteredData. Is it correct?

Thanks again
Back to top
 
 
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: Including Codon Models in batch files
Reply #6 - Aug 20th, 2008 at 1:33pm
 
Dear Ricardo,

Codon models assume that a genetic code has been defined. Include
Code:
ExecuteAFile(HYPHY_BASE_DIRECTORY+"TemplateBatchFiles"+DIRECTORY_SEPARATOR+"TemplateModels"+DIRECTORY_SEPARATOR+"chooseGeneticCode.def");
 



somewhere in your file prior to calling DataSetFilter filteredData = CreateFilter (myData,3); and also use

Code:
DataSetFilter filteredData = CreateFilter (myData,3,"","",GeneticCodeExclusions);
 



to make sure that stop codons are properly handled.
The filter indeed must be called filteredData if you use the SelectTemplateModel command.

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