Miguel
Junior Member
Offline
Hi Hyphy!
Posts: 53
CBMSO, CSIC (Spain)
Gender:
|
Dear Sergei,
For changing the model (from GY94 codon model to JC nucleotide model), I introduced the JC69.mdl file. However, I still have an output error:
Not a valid option: 'Global' passed to Choice List 'Model Options' using redirected stdin input Current BL Command:Choice List for Model Options with choice list:SKIP_NONE. Store result in modelType
I know I must change 'Global' for 'Local', but in analysisOptions lines (lines 63 and 70) I have to introduce a number for 'Local' (0 is for 'Global') and I am not sure about what is that number. Well, I do not know if I have to introduce more changes in this batchfile for the reconstruction of the ancestor sequence by JC nucleotide model. Below you can see the batch file that I am working about.
Regards, Miguel
/*SetDialogPrompt ("CSV file with pathnames and genetic codes");*/ ExecuteAFile (HYPHY_BASE_DIRECTORY+ "TemplateBatchFiles" + DIRECTORY_SEPARATOR + "Utility" + DIRECTORY_SEPARATOR + "ReadDelimitedFiles.bf");
/*fscanf (PROMPT_FOR_FILE,"Lines",listOfFiles);*/ fscanf (test.csv,"Lines",listOfFiles);
linesRead = Columns (listOfFiles);
fileNames = {}; fileCodes = {};
fprintf (stdout, "\n");
for (k=0; k<linesRead; k=k+1) { aLine = splitOnRegExp (listOfFiles[k], "\\ *\\,\\ *"); if (Abs (aLine) == 2) { fileNames [Abs(fileNames)] = aLine[0]; fileCodes [Abs(fileCodes)] = aLine[1]; fprintf (stdout, "[FILE ", Abs(fileNames), " ", aLine[0], " - ", aLine[1], "]\n"); } }
DATA_FILE_PRINT_FORMAT = 9; /* FASTA */
for (fileCount = 0; fileCount < Abs(fileNames); fileCount = fileCount + 1) {
/* MA */
#include "myFunctions.bf";
/* load data in */ inputfile = fileNames[fileCount]; DataSet ds = ReadDataFile (inputfile); DataSetFilter filteredData = CreateFilter (ds,1); dataType = 0; /* DNA sequences */ fprintf (stdout, "\n\n*********** NEW DATA: ",inputfile," ***********");
/* define the model JC */ equalFreqs = {{.25}{.25}{.25}{.25}}; JC69 = {{*,a,a,a}{a,*,a,a}{a,a,*,a}{a,a,a,*}}; Model JC69model = (JC69, equalFreqs); UseModel (JC69model);
/* build NJ */ distanceChoice = 0; /* raw distances */ modelType = 0; /* no rate variation*/ methodIndex = 1; /* Negative Branch Lengths are Allowed */ p = InferTreeTopology(1.0); /* in myFunctions.bf */ treeString = TreeMatrix2TreeString (1); /* treeString stores the tree in Newick format */ fprintf (stdout,"\nInferred NJ tree before rerooting: ", treeString); treeString = RerootTree (treeString,0); fprintf (stdout,"\nInferred NJ tree: ", treeString);
/* MA */
analysisOptions = {}; analysisOptions["0"] = fileCodes[fileCount]; ExecuteAFile (HYPHY_BASE_DIRECTORY+ "TemplateBatchFiles" + DIRECTORY_SEPARATOR + "TemplateModels" + DIRECTORY_SEPARATOR + "chooseGeneticCode.def", analysisOptions);
DataSet ds = ReadDataFile (fileNames[fileCount]); DataSetFilter filteredData = CreateFilter (ds,3,"","",GeneticCodeExclusions); analysisOptions["0"] = "Global"; ExecuteAFile (HYPHY_BASE_DIRECTORY+ "TemplateBatchFiles" + DIRECTORY_SEPARATOR + "TemplateModels" + DIRECTORY_SEPARATOR + "JC69.mdl", analysisOptions); kappa := 1; fprintf (stdout, "[WORKING ON FILE ", fileNames[fileCount], "]\n"); /*Tree givenTree = DATAFILE_TREE;*/ Tree givenTree = treeString; fprintf (stdout, "\t[FITTING THE JC69 MODEL]\n"); LikelihoodFunction lf = (filteredData, givenTree); Optimize (res, lf); fprintf (stdout, "\n\nResults from the likelihood optimization:\n",lf); fprintf (stdout, "\t[RECONSTRUCTING ANCESTORS]\n"); DataSet ancestors = ReconstructAncestors(lf); DataSetFilter recFilter = CreateFilter(ancestors,1); ancestorOutFile = fileNames[fileCount] + "_ancestors.fas"; fprintf (stdout, "\t[WRITING ANCESTORS TO ",ancestorOutFile,"]\n"); fprintf (ancestorOutFile,CLEAR_FILE,recFilter); fprintf (ancestorOutFile, "\nNJtree (NJ): ",treeString); fprintf (ancestorOutFile, "\n\nTreeUsed: ",givenTree); }
|