Miguel
Junior Member
Offline
Hi Hyphy!
Posts: 53
CBMSO, CSIC (Spain)
Gender:
|
Hi Sergei,
I am just trying to reroot many trees using a batch file, those trees come from a previous NJ. Then I want to use those trees for an analysis with the PAML package.
I find a strange problem, the output rerooted trees of the batch file cannot be readed by PAML, however if I do the same in the GUI of Hyphy, the output rerooted trees can be readed by PAML. For example: Tree from GUI: (outgroup:0.10175,((((seq00002:0.00712982,seq00005:0.00294759):0.000123234,seq00 007:0.00289186):0.0118193,(seq00003:1e-05,seq00010:1e-05):0.0210865):0.00905762, ((seq00001:0.00278719,(seq00004:0.00598958,seq00008:0.00815702):0.000217613):0.0 0276009,(seq00006:0.00100167,seq00009:1e-05):0.0103881):0.0227801)); Tree from Batch file: ((((((seq00002:0.00712982,seq00005:0.00294759):0.000123234,seq00007:0.00289186): 0.0118193,(seq00003:1e-05,seq00010:1e-05):0.0210865):0.00905762):0.00905762,((se q00001:0.00278719,(seq00004:0.00598958,seq00008:0.00815702):0.000217613):0.00276 009,(seq00006:0.00100167,seq00009:1e-05):0.0103881):0.0227801):0.10175,outgroup: 0.10175);
I think both of trees are good, the only one difference is the position of the outgroup. However PAML only likes the first of them, for the other writes: Error: check #seqs and tree: perhaps too many '('?.
So, maybe it is a bag of PAML. But well, I think perhaps there is a way for obtaining the first rooted tree using a batch file of Hyphy because with the GUI that is possible, is there any way?.
Below, I send you the part of my batch file about this: [code]/* 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 */ treeString = RerootTree (treeString,0); fprintf (stdout,"\nInferred NJ tree: ", treeString);
OutFile = inputfile + "_tree.tre"; fprintf (OutFile,CLEAR_FILE);
fprintf (stdout, "\t[WRITING tree TO ",OutFile,"]\n"); fprintf (stdout, "\n\nTree NO Rooted:"); fprintf (stdout,"\n", treeString); NICETY_LEVEL = 3;
fprintf (stdout, "\n\nOther trees:");
Tree treeRoot_outg = treeString; fprintf (stdout,"\nInferred NJ tree (before rooting with outgroup, without branch lengths): ", treeRoot_outg); fprintf (stdout,"\n");
treeRoot = RerootTree(treeRoot_outg,"outgroup"); fprintf (stdout,"\nInferred NJ tree (after rooting with outgroup): ", treeRoot); fprintf (stdout,"\n"); [/code]
Thanks a lot. :D Regards,
Miguel
|