Welcome, Guest. Please Login
YaBB - Yet another Bulletin Board
 
  HomeHelpSearchLogin  
 
Getting info on datasets / datasetfilters (Read 1503 times)
sn
YaBB Newbies
*
Offline


Feed your monkey!

Posts: 5
Getting info on datasets / datasetfilters
Aug 8th, 2008 at 2:44am
 
Hi,

a very simple question that for some reason I haven't been able to figure out via the docs:

Is there a command /variable that will output the order and identity of the characters in a dataset/datasetfilter?  (eg 'A','C','G','T' for nucleotide alignment, unit length 1). I know it's ordered alphabetically, so it's simple to get from an outside script, but I would prefer to get it from Hyphy directly.

A related question, what are the values listed for each parameter by fprintf  (stdout,LIST_ALL_VARIABLES);? I thought it would be the current value for the given parameter, but that is clearly not the case. Does it just list default / example values?

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


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: Getting info on datasets / datasetfilters
Reply #1 - Aug 8th, 2008 at 10:50am
 
Dear Sanne,

The GetDataInfo command is the one you are looking for. Sadly, our documentation is quite out of data, so you won't find it there:(

Here's a code snippet:

Code:
GetURL 			   (dataString, "http://www.hyphy.org/phylohandbook/data/Drosophila_adh.nex");
DataSet ds		 =  ReadFromString (dataString);
DataSetFilter		  filteredData = CreateFilter (ds,1);

GetDataInfo			(charInfo, filteredData, "CHARACTERS");
fprintf 			(stdout, charInfo);
GetDataInfo			(paramInfo, filteredData, "PARAMETERS");
fprintf 			(stdout, paramInfo);
 



Secondly,
Code:
fprintf  (stdout,LIST_ALL_VARIABLES);
 



lists all currently defined variables (alphabetically), along with their internal index (which only tells you something about the order the variables were created in).

If you want to scan all variables, use the
Code:
GetInformation(".*",varInfo);
 



The first parameter can be any regular expression, and the second parameter will hold a matrix with variable ids that match the regular expression.

You can use

Code:
ExecuteCommands("varValue = " + someVariableIDString);
 



to place the value of the variable whose ID is in someVariableIDString into varValue

HTH,
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
 
sn
YaBB Newbies
*
Offline


Feed your monkey!

Posts: 5
Re: Getting info on datasets / datasetfilters
Reply #2 - Aug 8th, 2008 at 12:36pm
 
This looks perfect, thanks a lot Smiley

-Sanne
Back to top
 
 
IP Logged