Welcome, Guest. Please Login
YaBB - Yet another Bulletin Board
 
  HomeHelpSearchLogin  
 
Error: Invalid Matrix Index [0][0] in a 0 by 1 mat (Read 4302 times)
jose
YaBB Newbies
*
Offline


Feed your monkey!

Posts: 7
Error: Invalid Matrix Index [0][0] in a 0 by 1 mat
Feb 22nd, 2010 at 9:43am
 
Hello,
I get the error shown below when trying to run dNdSRateAnalysis.bf for only the Constant model:

Error:
Invalid Matrix Index [0][0] in a 0 by 1 matrix.
Call stack
3 : rateStrMx[0]="RN_1"
2 : ExecuteAFile from file "2RatesAnalyses/discreteGenerator.bf" using basepath /home/jose/hyphy/HYPHY/TemplateBatchFiles/.
1 : ExecuteAFile from file HYPHY_BASE_DIRECTORY+"TemplateBatchFiles"+DIRECTORY_SEPARATOR+"dNdSRateAnalysis.
bf" using basepath /home/jose/. reading input from inputRedirect

I use version 2.0. When i run all the Rate Variation Models (option "Run all") it works. But i would prefer to run only constant for speed reasons.

Thanks.
Back to top
 
Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login (0 KB | )
 
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: Error: Invalid Matrix Index [0][0] in a 0 by 1 mat
Reply #1 - Feb 22nd, 2010 at 12:17pm
 
Hi Jose,

There was a bug in the HyPhy dNdSRateAnalysis.bf code; I updated the file on SVN; you can download the replacement and drop it into TemplateBatchFiles (make sure the file is REPLACED; the default download will add .txt to the name of the file - remove that).

Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login

Note, that you also need to modify your wrapper file, because HyPhy will not prompt for any of the distributional options for the constant rate model.

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


Feed your monkey!

Posts: 7
Re: Error: Invalid Matrix Index [0][0] in a 0 by 1 mat
Reply #2 - Feb 23rd, 2010 at 7:39am
 
Hi Sergei,

Yes now it works. I will bear in mind that link. I have removed the distributional options also in the wrapper file.

I would like to get the w rates, however I only get the synRates (but not the nonSynRates) in the output.Constant.fit file:

     givenTree.Node2.synRate=0.2498200842255637;
     givenTree.FBgn0224725_Dwil.synRate=1.748285438938617;
     givenTree.FBgn0081989_Dpse.synRate=0.8752885212323878;
     ...

Moreover, is it possible to run dNdSRateAnalysis.bf with "local" branch rates? I think it performs only global analysis. I have tried with AnalyzeCodonData.bf but I can´t get that. I would like to do in command line the same I do in HYPHY GUI when I  do:

File>Open>Open Data File > partition > tree > subs model > parameters (local) > build function > optimize function

which returns synRate and nonSynRates for each branch.

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


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: Error: Invalid Matrix Index [0][0] in a 0 by 1 mat
Reply #3 - Feb 23rd, 2010 at 9:44am
 
Hi Jose,

You can get the "local" model from AnalyzeCodonData.bf if you select "Local" (instead of "Global") from the model parameter dialog, e.g. for MG94Custom.

Cheers,
Sergei

Code:
fileName = "/Users/sergei/hyphy/TestSuite/data/HIVenvSweden.seq";

localCodon = {"0" : "Universal",
			  "1" : fileName,
			  "2" : "MG94CUSTOM",
			  "3" : "Local",
			  "4" : "012345",
			  "5" : "y"};

ExecuteAFile (HYPHY_BASE_DIRECTORY + "TemplateBatchFiles" + DIRECTORY_SEPARATOR + "AnalyzeCodonData.bf",
			  localCodon);
 

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


Feed your monkey!

Posts: 7
Re: Error: Invalid Matrix Index [0][0] in a 0 by 1 mat
Reply #4 - Feb 23rd, 2010 at 1:41pm
 
Thanks it works ... So now how can I get synRate and nonsynRates?

In the GUI I would do: Analyses> Results > view results > filename_LF > Parameters + values

Do I need to add some code into AnalyzeCodonData.bf?

cheers,
jose
Back to top
 
 
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: Error: Invalid Matrix Index [0][0] in a 0 by 1 mat
Reply #5 - Feb 23rd, 2010 at 3:28pm
 
Hi Jose,

You can access all parameter names programmatically; in this case the standard analysis has 'preset' names for the tree variable, so it can be hard-coded.

Try:

Code:
fileName = "/Users/sergei/hyphy/TestSuite/data/HIVenvSweden.seq";

localCodon = {"0" : "Universal",
			  "1" : fileName,
			  "2" : "MG94CUSTOM",
			  "3" : "Local",
			  "4" : "012345",
			  "5" : "y"};

ExecuteAFile (HYPHY_BASE_DIRECTORY + "TemplateBatchFiles" + DIRECTORY_SEPARATOR + "AnalyzeCodonData.bf",
			  localCodon);

branchNames = BranchName (givenTree, -1);

synName    := "givenTree." + branchNames[branchIndex] + ".synRate";
nonSynName := "givenTree." + branchNames[branchIndex] + ".nonSynRate";

fprintf (stdout, "\n");

for (branchIndex = 0; branchIndex < Columns (branchNames); branchIndex = branchIndex + 1)
{
	fprintf (stdout, synName, " = ", getParameterValue (synName), "\n");
	fprintf (stdout, nonSynName, " = ", getParameterValue (nonSynName), "\n");
}

function getParameterValue (parameterName)
{
	ExecuteCommands ("pv=" + parameterName);
	return pv;
}

 

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


Feed your monkey!

Posts: 7
Re: Error: Invalid Matrix Index [0][0] in a 0 by 1 mat
Reply #6 - Feb 24th, 2010 at 4:27am
 
Awesome!
The synRates  (and nonSynRates) are arbitrary parameters of the model, do they have units?. Can I compare directly local synRates among lineages and genes?

How can I get in batch language the syn and non-syn trees? (In GUI: analysis> results > syn and non-syn trees).

e.g:

Total nucleotide sites :4191
Total sense codon sites:4050.8
Synonymous  sites      :996.426
Nonsynonymous  sites   :3054.38

E[Syn subs/nucleotide site] tree:
     …
E[Non-syn subs/nucleotide site] tree:
     …

dS tree:
     …

dN tree:
     ...

Thanks very much. (hopefully) me done with this thread  Lips Sealed  ...
Back to top
 
 
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: Error: Invalid Matrix Index [0][0] in a 0 by 1 mat
Reply #7 - Feb 24th, 2010 at 10:45am
 
Hi Jose,

You can just call the appropriate dN/dS calculator from your script, as in

Code:
fileName = "/Users/sergei/hyphy/TestSuite/data/HIVenvSweden.seq";

localCodon = {"0" : "Universal",
			  "1" : fileName,
			  "2" : "MG94CUSTOM",
			  "3" : "Local",
			  "4" : "012345",
			  "5" : "y"};

ExecuteAFile (HYPHY_BASE_DIRECTORY + "TemplateBatchFiles" + DIRECTORY_SEPARATOR + "AnalyzeCodonData.bf",
			  localCodon);

branchNames = BranchName (givenTree, -1);

synName    := "givenTree." + branchNames[branchIndex] + ".synRate";
nonSynName := "givenTree." + branchNames[branchIndex] + ".nonSynRate";

fprintf (stdout, "\n");

for (branchIndex = 0; branchIndex < Columns (branchNames); branchIndex = branchIndex + 1)
{
	fprintf (stdout, synName, " = ", getParameterValue (synName), "\n");
	fprintf (stdout, nonSynName, " = ", getParameterValue (nonSynName), "\n");
}

dNdSOptions = {"0":"Display"};

ExecuteAFile (HYPHY_BASE_DIRECTORY + "TemplateBatchFiles" + DIRECTORY_SEPARATOR + "post_sns.bf",
			  dNdSOptions);


function getParameterValue (parameterName)
{
	ExecuteCommands ("pv=" + parameterName);
	return pv;
}


 



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