how to use recoded protein alignments (for instance dayhoff4) with IQtree

692 views
Skip to first unread message

joran...@gmail.com

unread,
Jun 25, 2016, 6:42:13 AM6/25/16
to IQTREE
Hi,

To reduce overall compositional heterogeneity across taxa, I often recode my protein alignments to dayhoff4 groups or SR4 (susko&roger, 4groups), using the nucleotide characters representing each group.

When I then use that as input for PhyloBayes (CAT or CAT-GTR), it accepts the alignment because it believes its dealing with a nucleotide alignment. And as far as I understand, it doesnt matter if you use a protein alignment or nucleotide alignment for the CAT or CAT-GTR model.

Now I would like to try out a mixture model from IQtree (C60, for instance), and I'm not sure whether its okay to use that on a recoded alignment. I'm guessing no, but I'm not sure.

Kind regards,

Joran

Bui Quang Minh

unread,
Jun 27, 2016, 5:41:56 AM6/27/16
to iqt...@googlegroups.com, joran...@gmail.com

Dear Joran
There is currently no such "nucleotide" mixture model in iqtree, i.e. C60 is only valid for protein data.

However if you insist on using such model there is a way to specify it in iqtree. C60 consists of 60 aa frequency vectors. When you convert aa to nt as you described, you can also transform aa frequencies to nt frequencies, by summing up the aa freq belonging to the same nt character. Then specify such C60 transformed frequencies in a Nexus model file, see documentation on mixture models:

http://www.cibiv.at/software/iqtree/doc/Complex-Models/#mixture-models

 and input it into iqtree via -mdef option. It may look something like this:

#nexus

begin sets;

frequency C60NT1= piA1 piC1 piG1 piT1;

frequency C60NT2= piA2 piC2 piG2 piT2;

...

frequency C60NT60= piA60 piC60 piG60 piT60;

model C60NT=POISSON+G+FMIX{C60NT1,C60NT2,...,C60NT60};

end;


(here replace piA1,..., piT60 with the transformed frequencies explained above)

then run iqtree with command like:

iqtree -mdef this_model_file.nex -m C60NT ...


If you need more help let me know

Minh


--
You received this message because you are subscribed to the Google Groups "IQTREE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iqtree+un...@googlegroups.com.
To post to this group, send email to iqt...@googlegroups.com.
Visit this group at https://groups.google.com/group/iqtree.
For more options, visit https://groups.google.com/d/optout.

Bui Quang Minh

unread,
Jun 27, 2016, 5:43:54 AM6/27/16
to iqt...@googlegroups.com, joran...@gmail.com
sorry there was a typo, please replace "begin sets;" by "begin models;"
Minh

joran...@gmail.com

unread,
Jun 27, 2016, 8:53:22 AM6/27/16
to IQTREE, joran...@gmail.com
Aha I see that is a clever way of doing it! I'll look into it

katarzyna.zarem...@gmail.com

unread,
Aug 3, 2016, 7:19:25 AM8/3/16
to IQTREE, joran...@gmail.com
Dear Minh,

I am also interested in running a recoded tree. The model I use for the protein runs is

-m LG+C60+F

So I can not really get an equivalent on the recoded data, since I will not optimize the frequencies but I need to give them instead. I was wondering if I could get them from the run I did on the protein alignment but the optimized frequencies are not output in the log file. Or are they perhaps in one of the other output files?

So the next available option is to look what are the set frequencies for the LG+C60 so that I could sum them the way they belong to the categories of the recoding I want to use (sr4, Susko and Roger). Could you help me out where to look for those numbers, I am not sure.

thanks,
Kasia

Bui Quang Minh

unread,
Aug 3, 2016, 7:38:39 AM8/3/16
to iqt...@googlegroups.com, joran...@gmail.com, katarzyna.zarem...@gmail.com
Dear Kasia,

Joran might have produced such a transformed frequencies already. Thus, best is to ask Joran: can you pls provide us the transformed model? Also, the mapping from amino-acids to nucleotides. It would be good to have the transformed models for all C10 to C60 models. Then I may integrate it into the next release of IQ-TREE.

Minh
> --
> You received this message because you are subscribed to the Google Groups "IQTREE" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to iqtree+un...@googlegroups.com.
> To post to this group, send email to iqt...@googlegroups.com.
> Visit this group at https://groups.google.com/group/iqtree.
> For more options, visit https://groups.google.com/d/optout.

--
Bui Quang Minh
Center for Integrative Bioinformatics Vienna (CIBIV)
Campus Vienna Biocenter 5, VBC5, Ebene 1
A-1030 Vienna, Austria
Phone: ++43 1 4277 74326
Email: minh.bui (AT) univie.ac.at







katarzyna.zarem...@gmail.com

unread,
Aug 3, 2016, 10:19:49 AM8/3/16
to IQTREE, joran...@gmail.com, katarzyna.zarem...@gmail.com, minh...@univie.ac.at
Dear Minh!

the sr4 recoding is the following:

A,G,N,P,S,T = A;
C,H,W,Y = C;
D,E,K,Q,R = G;
F,I,L,M,V = T

http://mbe.oxfordjournals.org/content/24/9/2139.long

Joran is actually sitting next door. No he did not calculate it. I would do that but I still do not know where to take the frequencies from. I thought perhaps you simply had the numbers somewhere one could import them easily. I have now checked the publication:

Quang, Le Si, Olivier Gascuel, and Nicolas Lartillot. 2008. Empirical profile mixture models for phylogenetic reconstruction. Bioinformatics 24:2317-2323.

and I can see there are matrices in the supplementary tables. But first of all I am not sure which one is actually THE one used, since they differ slightly and there is more than one per mixture. Secondly, it is not frequencies, so I would like to make sure that what I am thinking is the proper way of turning these numbers into frequencies is actually what people do. Thirdly, one would want that in electronic format do easily do the calculations and not as pdf.

http://bioinformatics.oxfordjournals.org/content/suppl/2008/08/21/btn445.DC1/bioinf-2008-0768-File009.pdf

There is an excel sheet available at

http://www.atgc-montpellier.fr/models/index.php?model=mixture

but unfortunately it does not cover C20-C60.

Should email the authors for the files that I would like to have?
I guess you must have it as part of Iqtree, right?

Also, I realized that once I am done with this, I CAN actually optimize the frequencies because it will simply be adding '+F' at the end of the specified model. Is that right?

thanks a lot for your helpful and fast responses!

Kasia

Bui Quang Minh

unread,
Aug 3, 2016, 10:43:15 AM8/3/16
to katarzyna.zarem...@gmail.com, IQTREE, joran...@gmail.com
Oh I see,
then have a look at IQ-TREE code:

https://github.com/Cibiv/IQ-TREE/blob/master/model/modelmixture.cpp

there you will see entries like:

frequency C10pi1 = 0.4082573125 0.0081783015 0.0096285438 0.0069870889 0.0349388179 0.0075279735 0.0097846653 0.1221613215 0.0039151830 0.0125784287 0.0158338663 0.0059670150 0.0081313216 0.0061604332 0.0394155867 0.1682450664 0.0658132542 0.0018751587 0.0041579747 0.0604426865;\n\
….

note that the order of amino-acids is:

A R N D C Q E G H I L K M F P S T W Y V

Hope that you can proceed further with this.

Minh

katarzyna.zarem...@gmail.com

unread,
Aug 4, 2016, 6:34:38 AM8/4/16
to IQTREE, katarzyna.zarem...@gmail.com, joran...@gmail.com, minh...@univie.ac.at
Dear Minh!

I have now created the nexus file, that looks like this (I attach the file to the post):

-------------
#nexus

begin models;

frequency C60NT1= 0.6671684132 0.0296031604 0.263873245 0.0393551815;

frequency C60NT2= 0.1276338907 0.0209812196 0.7927062299 0.0586786597;

frequency C60NT3= 0.0163962994 0.0051413956 0.0030074531 0.975454852;

...

frequency C60NT60= 0.0386456469 0.0058035261 0.0121187396 0.9434320874;

model C60SR4=POISSON+G+FMIX{C60NT1, C60NT2, C60NT3, C60NT4, C60NT5, C60NT6, C60NT7, C60NT8, C60NT9, C60NT10, C60NT11, C60NT12, C60NT13, C60NT14, C60NT15, C60NT16, C60NT17, C60NT18, C60NT19, C60NT20, C60NT21, C60NT22, C60NT23, C60NT24, C60NT25, C60NT26, C60NT27, C60NT28, C60NT29, C60NT30, C60NT31, C60NT32, C60NT33, C60NT34, C60NT35, C60NT36, C60NT37, C60NT38, C60NT39, C60NT40, C60NT41, C60NT42, C60NT43, C60NT44, C60NT45, C60NT46, C60NT47, C60NT48, C60NT49, C60NT50, C60NT51, C60NT52, C60NT53, C60NT54, C60NT55, C60NT56, C60NT57, C60NT58, C60NT59, C60NT60}+F;

end;
-------------

you can see the frequencies calculated from the C60 LG in the google sheet:

https://docs.google.com/spreadsheets/d/1hj0OSlSPKPgg02R4p_hZdH3O-pHEvWYj4Cj64ihWaxg/edit?usp=sharing

Everyone having this link should be able to edit, so go ahead if you would like to add other C-series. My model testing always pick C60 (which is no suprise knowing that in phylobayes it actually has 300-900 mixtures).

I get an error though that seems to be complaining about the name of the frequency vector:

-------------
Create initial parsimony tree by phylogenetic likelihood library (PLL)... 0.493 seconds
Reading model definition file /local/bin/Iqtree_C60sr4.nex ... 48 models and 274 frequency vectors loaded
Generating 1000 samples for ultrafast bootstrap (seed: 521544)...
Model C60SR4 is alias for POISSON+G+FMIX{C60NT1, C60NT2, C60NT3, C60NT4, C60NT5, C60NT6, C60NT7, C60NT8, C60NT9, C60NT10, C60NT11, C60NT12, C60NT13, C60NT14, C60NT15, C60NT16, C60NT17, C60NT18, C60NT19, C60NT20, C60NT21, C60NT22, C60NT23, C60NT24, C60NT25, C60NT26, C60NT27, C60NT28, C60NT29, C60NT30, C60NT31, C60NT32, C60NT33, C60NT34, C60NT35, C60NT36, C60NT37, C60NT38, C60NT39, C60NT40, C60NT41, C60NT42, C60NT43, C60NT44, C60NT45, C60NT46, C60NT47, C60NT48, C60NT49, C60NT50, C60NT51, C60NT52, C60NT53, C60NT54, C60NT55, C60NT56, C60NT57, C60NT58, C60NT59, C60NT60}+F
ERROR: Frequency mixture name not found C60NT2.
-------------

I am not sure why it says 48 models, since I only define one, and 274 frequency vectors when it should only be 60. Perhaps something is wrong with the formatting, although I tried to follow your example. It seems to be reading first vector fine but not the next one and I am not sure why. Something should be different in the new line separation...?

I have also tried model definition without '+F' but obviously this is not what the error is about so it does not make a difference.

thanks a lot for your helpful assistance!

Kasia

Iqtree_C60sr4.nex

katarzyna.zarem...@gmail.com

unread,
Aug 4, 2016, 6:51:20 AM8/4/16
to IQTREE, katarzyna.zarem...@gmail.com, joran...@gmail.com, minh...@univie.ac.at
SILLY
I just noticed there was an extra space, so this is corrected now

------------------
C60SR4=POISSON+G+FMIX{C60NT1,C60NT2,C60NT3,C60NT4,C60NT5,C60NT6,C60NT7,C60NT8,C60NT9,C60NT10,C60NT11,C60NT12,C60NT13,C60NT14,C60NT15,C60NT16,C60NT17,C60NT18,C60NT19,C60NT20,C60NT21,C60NT22,C60NT23,C60NT24,C60NT25,C60NT26,C60NT27,C60NT28,C60NT29,C60NT30,C60NT31,C60NT32,C60NT33,C60NT34,C60NT35,C60NT36,C60NT37,C60NT38,C60NT39,C60NT40,C60NT41,C60NT42,C60NT43,C60NT44,C60NT45,C60NT46,C60NT47,C60NT48,C60NT49,C60NT50,C60NT51,C60NT52,C60NT53,C60NT54,C60NT55,C60NT56,C60NT57,C60NT58,C60NT59,C60NT60}+F;
------------------

and I end up with the following error instead:

------------------
Create initial parsimony tree by phylogenetic likelihood library (PLL)... 0.262 seconds
Reading model definition file /local/bin/Iqtree_C60sr4.nex ... 48 models and 274 frequency vectors loaded
Generating 1000 samples for ultrafast bootstrap (seed: 581828)...
Model C60SR4 is alias for POISSON+G+FMIX{C60NT1,C60NT2,C60NT3,C60NT4,C60NT5,C60NT6,C60NT7,C60NT8,C60NT9,C60NT10,C60NT11,C60NT12,C60NT13,C60NT14,C60NT15,C60NT16,C60NT17,C60NT18,C60NT19,C60NT20,C60NT21,C60NT22,C60NT23,C60NT24,C60NT25,C60NT26,C60NT27,C60NT28,C60NT29,C60NT30,C60NT31,C60NT32,C60NT33,C60NT34,C60NT35,C60NT36,C60NT37,C60NT38,C60NT39,C60NT40,C60NT41,C60NT42,C60NT43,C60NT44,C60NT45,C60NT46,C60NT47,C60NT48,C60NT49,C60NT50,C60NT51,C60NT52,C60NT53,C60NT54,C60NT55,C60NT56,C60NT57,C60NT58,C60NT59,C60NT60}+F
ERROR: Invalid model name POISSON
------------------

which I guess is understandable considering that it is guessing that the alignment is DNA. But now I tried instead:

------------------
model C60SR4=GTR+G+FMIX{C60NT1,C60NT2,C60NT3,C60NT4,C60NT5,C60NT6,C60NT7,C60NT8,C60NT9,C60NT10,C60NT11,C60NT12,C60NT13,C60NT14,C60NT15,C60NT16,C60NT17,C60NT18,C60NT19,C60NT20,C60NT21,C60NT22,C60NT23,C60NT24,C60NT25,C60NT26,C60NT27,C60NT28,C60NT29,C60NT30,C60NT31,C60NT32,C60NT33,C60NT34,C60NT35,C60NT36,C60NT37,C60NT38,C60NT39,C60NT40,C60NT41,C60NT42,C60NT43,C60NT44,C60NT45,C60NT46,C60NT47,C60NT48,C60NT49,C60NT50,C60NT51,C60NT52,C60NT53,C60NT54,C60NT55,C60NT56,C60NT57,C60NT58,C60NT59,C60NT60}+F;
------------------

which is running and I think will do what I want!

So I attach the final nexus file in case someone want to use it.

cheers,
Kasia
Iqtree_C60sr4.nex

Bui Quang Minh

unread,
Aug 4, 2016, 11:16:27 AM8/4/16
to katarzyna.zarem...@gmail.com, IQTREE, joran...@gmail.com
that’s cool, thanks!

regarding this line:

> Reading model definition file /local/bin/Iqtree_C60sr4.nex ... 48 models and 274 frequency vectors loaded

this is the total number of builtin models (like C10, EX, EHO, etc) and the user-defined models. That’s why it is much more than the number of models you specified.

Minh
> <Iqtree_C60sr4.nex>
Reply all
Reply to author
Forward
0 new messages