SEMIN- Dessine-moi un arbre : représentation graphique des arbres phylogénétiques avec le package ape

Similar documents
Personnalisez votre intérieur avec les revêtements imprimés ALYOS design

POB-JAVA Documentation

Langages Orientés Objet Java

Introduction ToIP/Asterisk Quelques applications Trixbox/FOP Autres distributions Conclusion. Asterisk et la ToIP. Projet tuteuré

Thursday, February 7, DOM via PHP

Installation troubleshooting guide

Donnez des couleurs à votre évènement. Give your event more colours

Introduction au BIM. ESEB Seyssinet-Pariset Economie de la construction contact@eseb.fr

Sun Management Center Change Manager Release Notes

Introduction. GEAL Bibliothèque Java pour écrire des algorithmes évolutionnaires. Objectifs. Simplicité Evolution et coévolution Parallélisme

Archived Content. Contenu archivé

Introduction à OpenSSH

Lesson 2. Une Promenade... (Disc 1, Track 3)

Level 2 French, 2014

Solaris 10 Documentation README

Modifier le texte d'un élément d'un feuillet, en le spécifiant par son numéro d'index:

RAPPORT FINANCIER ANNUEL PORTANT SUR LES COMPTES 2014

N1 Grid Service Provisioning System 5.0 User s Guide for the Linux Plug-In

Calcul parallèle avec R

Memory Eye SSTIC Yoann Guillot. Sogeti / ESEC R&D yoann.guillot(at)sogeti.com

«Object-Oriented Multi-Methods in Cecil» Craig Chambers (Cours IFT6310, H08)

sept-2002 Computer architecture and software cells for broadband networks Va avec

LS6300 Lecteur de code-barres laser

Sun Management Center 3.5 Update 1b Release Notes

How To Create A Tree In R

Raconte-moi : Les deux petites souris

DHI a.s. Na Vrsich 51490/5, , Prague 10, Czech Republic ( t.metelka@dhi.cz, z.svitak@dhi.cz )

Générer des graphiques 3D - Cours Université de Sfax

Vincent Rullier Technology specialist Microsoft Suisse Romande

Comparative Methods and Data Analysis in R

June 2016 Language and cultural workshops In-between session workshops à la carte June weeks All levels

Sun Cluster 2.2 7/00 Data Services Update: Apache Web Server

Upgrading the Solaris PC NetLink Software

SunFDDI 6.0 on the Sun Enterprise Server

Each function call carries out a single task associated with drawing the graph.

Sun Enterprise Optional Power Sequencer Installation Guide

CSS : petits compléments

Hours: The hours for the class are divided between practicum and in-class activities. The dates and hours are as follows:

PRMS.

Temporary Supplement Stamps, Templates & Chipboards. Janvier Supplément temporaire Étampes, pochoirs & chipboards

Introduction Les failles les plus courantes Les injections SQL. Failles Web. Maxime Arthaud. net7. Jeudi 03 avril 2014.

Veritas Storage Foundation 5.0 Software for SPARC

Enterprise Risk Management & Board members. GUBERNA Alumni Event June 19 th 2014 Prepared by Gaëtan LEFEVRE

SAT Easy Print Label printing software

Sun StorEdge A5000 Installation Guide

TABLECLOTHS TEMPLATES

Archived Content. Contenu archivé

Optimizing Solaris Resources Through Load Balancing

Reconstruction d un modèle géométrique à partir d un maillage 3D issu d un scanner surfacique

PostGIS Integration Tips

Remote Method Invocation

Scrubbing Disks Using the Solaris Operating Environment Format Program

Maharaja Sawai Man Singh Vidyalaya, Jaipur

General Certificate of Education Advanced Level Examination June 2012

READ AND FOLLOW ALL SAFETY INSTRUCTIONS 1. DANGER RISK OF SHOCK DISCONNECT POWER BEFORE INSTALLATION

Survey on Conference Services provided by the United Nations Office at Geneva

Licence Informatique Année Exceptions

Molecular Clocks and Tree Dating with r8s and BEAST

System Requirements Orion

Sun StorEdge RAID Manager Release Notes

Applying this template to your existing presentation

EPREUVE D EXPRESSION ORALE. SAVOIR et SAVOIR-FAIRE

Tool & Asset Manager 2.0. User's guide 2015

ANIMATION OF CONTINUOUS COMPUTER SIMULATIONS C.M. Woodside and Richard Mallet Computer Center, Carleton University ABSTRACT

Troncatures dans les modèles linéaires simples et à effets mixtes sous R

ESMA REGISTERS OJ/26/06/2012-PROC/2012/004. Questions/ Answers

NUNAVUT HOUSING CORPORATION - BOARD MEMBER RECRUITMENT

Stellarium Scripting Commands

Introduction Présentation de scapy. Scapy. Easy Packet Handling. Etienne Maynier. Capitole du Libre 24 Novembre 2012

Exploring the iplanet Directory Server NIS Extensions

A GREEN PARADISE AT THE GATES OF LISBON UN PARADIS VERT AUX PORTES DE LISBONNE

Rapid Recovery Techniques: Auditing Custom Software Configuration

Quoi de neuf? (What s in the news?)

HEALTH CARE DIRECTIVES ACT

Assessments; Optional module 1 vert assessments. Own test on the perfect tense

Gaynes School French Scheme YEAR 8: weeks 8-13

MONTÉSINOS 2015 NOTICE OF RACE 1. RULES

Setting up a monitoring and remote control tool

Interfaces de programmation pour les composants de la solution LiveCycle ES (juillet 2008)

Sun Management Center 3.6 Version 5 Add-On Software Release Notes

Product / Produit Description Duration /Days Total / Total

ISO xx STEP. Sommaire. étendue. STandard for the Exchange of Product model data. Hervé Panetto CRAN nancy.

ETAPE U UNIFORM RENVOI U 1 : RENVOI U 2 : page 224. page 223 VOCABULAIRE A MAITRISER : (re)lier, connecter sévère, violent

LNG for Road. Belourthe 29/01/2016. Dany Lebrun Nick Scheffer

JANVIER 2013 / CATALOGUE DES FORMATIONS

Archived Content. Contenu archivé

VIREMENTS BANCAIRES INTERNATIONAUX

PRICE LIST / TARIF PUBLIC 2015 WOOD / BOIS EXPORT

AP FRENCH LANGUAGE AND CULTURE 2013 SCORING GUIDELINES

How To Get A Kongo Republic Tourist Visa

Méthodes ensemblistes pour une localisation robuste de robots sous-marins

PROJET HARRY POTTER ANNEXE 1

site et appel d'offres

FOR TEACHERS ONLY The University of the State of New York

Transcription:

SEMIN- Dessine-moi un arbre : représentation graphique des arbres phylogénétiques avec le package ape NATTIER, Romain Muséum national d'histoire naturelle UMR 7205 OSEB SEMIN-R du MNHN 28 Janvier 2011

28 janvier 2011 Dessine-moi un arbre: représentation graphique des arbres phylogénétiques avec le package ape Romain NATTIER (MNHN, UMR 7205 Origine, Structure et Evolution de la Biodiversité)

Pourquoi utiliser R pour manipuler des arbres phylogénétiques? logiciel gratuit et a code source ouvert multiplateforme (Linux, Windows et Macintosh) grande communauté répétable (scripts) Commandes sous R en gras+it+violet Ex: plot(tr) Romain Nattier (UMR7205) Dessine-moi un arbre sous R Semin-R 28/01/2011 2/25

Présentation du package APE Romain Nattier (UMR7205) Dessine-moi un arbre sous R Semin-R 28/01/2011 3/25

Lire et introduire un arbre Plusieurs formats: Parenthetic Format (= Newick or New Hampshire format) ((((((:1,:1):1,:1):1,:1):1,((:1,:1):1,:1):1):1,:1):1,:1):1; read.tree( nom_du_fichier ) Nexus Format (Madison et al., 1997) - comprised a "blocks" such as the taxa block, data block, sets block, trees block, PAUP block, MrBayes block - used by software such as MrBayes and PAUP #NEXUS begin data; dimensions ntax=61 nchar=2702; format datatype=dna interleave=no missing=?; MATRIX Ruspolia AATCTACTTATTCGTGCCGAATTAGGACAACCCGGATTTTTAATTGGCGATGATCAGATTTATAATGTAATTGTTACTGCCCACTCTTTTATAATAATTTTCTTCATAGTAATACCTATTATAATTGGAGGATTCGGTAATTGATTAGTTCCTTTAATGTTAGGAGCTCCT GATATAGCATTCCCTCGAATAAATAATATAAGTTTTTGATTACTCCCACCATCGCTAACCCTTTTACTCGCCAGAAGATTAGTGGAAAGTGGCGCGGGTACAGGTTGAACGGTTTATCCTCCGCTTTCTGCAGGAATCGCCCATGCAGGAGCCTCAGTTGACCTAG CTATCTTTTCTTTACATTTAGCAGGGGTTTCTTCAATTCTTGGGGCCGTAAACTTCATTACTACAACAATTAATATACGAGCTCCAGGTATATCATTAGATCAAACACCTTTATTTGTTTGAGCTGTCGCTATTACAGCTCTCTTATTACTTCTCTCCCTTCCCGTTCTTG CCGGAGCAATTACAATACTTTTAACAGACCGTAATTTAAATACATCTTTCTTTGATCCTGCAGGTGGGGGAGATCCTATTCTTTATCAACACTTATTTTGATTCTTTGGACACCCAGAAGTTTATATTTTAATTTTACCAGGATTTGGAATAATTTCCCATATTATTAGTC AAGAAAGTGGTAAAAAGGAAGCCTTTGGAACATTAGGAATAATTTATGCTATATT Locusta_migratoria AGAATAATTATTCGAGCTGAATTAGGTCAACCAGGAACAATAATTAACGATGATCAACTATATAATGTAATCATTACAGCACACGCATTTGTTATAATTTTCTTCATGGTTATGCCAATTATAATTGGAGGATTCGGAAATTGATTAGTACCATTAATAATTGGAGCTCC AGATATAGCTTTTCCACGAATAAATAACATAAGATTTTGATTATTACCACCATCATTAACACTCCTACTAATGTCTTCTGTAGTAGATAATGGAGCTGGTACAGGATGAACAGTATATCCTCCACTAGCCAGAGTCATTGCTCATAGAGGAGCTTCTGTAGATTTAGCA ATTTTTTCATTACATCTAGCAGGTGTTTCCTCAATTTTAGGAGCTATTAATTTCATTACAACAGCAATCAATATACGATCAAATAATATAACCCTTGATCAAACACCATTATTTGTTTGATCAGTAGCAATTACAGCCTTATTACTTTTATTATCATTACCAGTATTAGCTG GAGCAATTACTATATTATTAACTGATCGAAACCTTAATACGTCATTCTTCGACCCGGCAGGAGGAGGTGACCCAATTTTATATCAACACTTATTTTGATTCTTTGGTCACCCAGAAGTTTATATTTTAATTTTACCAGGATTTGGTATTATTTCACATATCGTTTGTCAAG AAAGAGGAAAAATTGAATCATTTGGAACAATTGGTATAATTTATGCAATATTATC ; END; read.nexus( nom_du_fichier ) Romain Nattier (UMR7205) Dessine-moi un arbre sous R Semin-R 28/01/2011 4/25

Lire et introduire un arbre tr<-read.tree("hexapoda.txt") plot(tr) Read Character Data In NEXUS Format => read.nexus.data Write Tree File in Nexus Format => write.nexus Write Tree File in Parenthetic Format => write.tree Romain Nattier (UMR7205) Dessine-moi un arbre sous R Semin-R 28/01/2011 5/25

Lire et introduire un arbre # type of tree plot(tr,type="p",root.edge=true) # default phylogramm plot(tr,type="c",root.edge=true) # cladogramm plot(tr,type="f",root.edge=true) # fan plot(tr,type="u",root.edge=true) # unrooted plot(tr,type="r",root.edge=true) # radial default phylogramm cladogramm fan unrooted radial Romain Nattier (UMR7205) Dessine-moi un arbre sous R Semin-R 28/01/2011 6/25

Faire bouger un arbre! # tree direction: plot(tr,direction= x") plot(tr,direction="l") # left plot(tr,direction="u") # up plot(tr,direction="d") # down Romain Nattier (UMR7205) Dessine-moi un arbre sous R Semin-R 28/01/2011 7/25

Faire bouger un arbre! # tips, nodes and edges labels: where are they? 9 16 8 15 10 7 14 6 1 10 13 11 16 5 2 11 12 12 17 4 9 3 3 8 13 2 4 7 14 1 5 6 15 tiplabels() edgelabels() nodelabels() Romain Nattier (UMR7205) Dessine-moi un arbre sous R Semin-R 28/01/2011 8/25

Faire bouger un arbre! # rotation around a node 10 10 11 12 16 17 11 12 16 17 13 13 14 15 14 15 plot(rotate(tr,node=16)) Romain Nattier (UMR7205) Dessine-moi un arbre sous R Semin-R 28/01/2011 9/25

Faire bouger un arbre! # rotate tip labels: tr.srt=angle plot (tr,srt=45) # aligner les taxons: use.edge.length=false plot (tr,use.edge.length=false) Romain Nattier (UMR7205) Dessine-moi un arbre sous R Semin-R 28/01/2011 10/25

Faire bouger un arbre! #selectionner un subsample of a tree (drop a tip) tip <- c("", "") plot(drop.tip(tr, tip)) tip <- c("", "","","","") plot(drop.tip(tr, tip)) Romain Nattier (UMR7205) Dessine-moi un arbre sous R Semin-R 28/01/2011 11/25

Il n y a pas qu un seul arbre! # plot as many tree as you wish op<-par(mfrow=c(2,2)) plot(rtree(8)) plot(rtree(8)) plot(rtree(8)) plot(rtree(8)) par(op) t5 t2 t1 t7 t3 t6 t8 t4 t4 t1 t5 t8 t3 t2 t7 t6 t8 t4 t4 t7 t7 t8 t3 t1 t6 t3 t1 t2 t5 t6 t2 t5 Romain Nattier (UMR7205) Dessine-moi un arbre sous R Semin-R 28/01/2011 12/25

Il n y a pas qu un seul arbre! # facing trees: do it directly with cophyloplot() SP5 t2<-"((sp1,sp2),(sp3,(sp4,sp5)));" t2<-read.tree(text=t2) SP4 SP3 layout(matrix(1:2,1,2),width=c(1,1)) par(mar=c(5,4,4,1)) plot(tr,adj=0.5,cex=0.8, x.lim=c(0,11),label.offset=1.1) par(mar=c(5,0,4,5)) plot(t2,adj=0.5,cex=0.8,x.lim=c(1,5), direction="l",show.tip.label=false) edgelabels(5:8,col="red") SP2 SP1 8 6 7 8 5 7 5 6 Romain Nattier (UMR7205) Dessine-moi un arbre sous R Semin-R 28/01/2011 13/25

Il n y a pas qu un seul arbre! # tree and external graph m<-matrix(c(2,rep(1,8)),3,3) layout(m) par(mar=c(4,3,5,1)) plot(tr) par(mar=c(7,3,1,1)) hist(rnorm(1000),xlab="", ylab="", main="") 0 50 100 150 200-3 -2-1 0 1 2 3 Romain Nattier (UMR7205) Dessine-moi un arbre sous R Semin-R 28/01/2011 14/25

Rendre beau un arbre (l habiller, le maquiller ) # add a title title(main=paste("my first tree with ape \n", date()),sub="very nice indeed!") My first tree with ape Tue Jan 18 08:19:41 2011 very nice indeed! Romain Nattier (UMR7205) Dessine-moi un arbre sous R Semin-R 28/01/2011 15/25

Rendre beau un arbre (l habiller, le maquiller ) # change font of tip labels plot(tr,font=3) plot(tr,font=1) plot(tr,font=2) plot(tr,font=4) It (default) normal gras gras & it + nombreuses polices disponibles Romain Nattier (UMR7205) Dessine-moi un arbre sous R Semin-R 28/01/2011 16/25

Rendre beau un arbre (l habiller, le maquiller ) # change color of tip labels colors() plot(tr,tip.color=2) rouge plot(tr,tip.color=3) vert plot(tr,tip.color=4) bleu Romain Nattier (UMR7205) Dessine-moi un arbre sous R Semin-R 28/01/2011 17/25

Rendre beau un arbre (l habiller, le maquiller ) # change size of tip labels plot(tr,cex=1) (default) plot(tr,cex=0.5) plot(tr,cex=1.5) Romain Nattier (UMR7205) Dessine-moi un arbre sous R Semin-R 28/01/2011 18/25

Rendre beau un arbre (l habiller, le maquiller ) # change width and color of edges plot(tr,edge.width=4) plot(tr,edge.color="brown") plot(tr,edge.width=4,edge.color="brown") Romain Nattier (UMR7205) Dessine-moi un arbre sous R Semin-R 28/01/2011 19/25

Rendre beau un arbre (l habiller, le maquiller ) Quand davantage de taxons. Holométaboles=node.leaves(tr, mrca(tr)["",""]) Néoptères=node.leaves(tr, mrca(tr)["",""]) color=rep("black", dim(tr$edge)[1]) c=which.edge(tr,holométaboles) color[c]="red«c=which.edge(tr,néoptères) color[c]="blue«plot(tr, edge.col=color,no.margin=t,lwd=2) N.B:La fonction node.leaves() appartient au package geiger. Holométaboles Néoptères Romain Nattier (UMR7205) Dessine-moi un arbre sous R Semin-R 28/01/2011 20/25

Rendre beau un arbre (l habiller, le maquiller ) # add a blank between tip labels and terminal edges plot(tr,label.offset=0.15) Romain Nattier (UMR7205) Dessine-moi un arbre sous R Semin-R 28/01/2011 21/25

# add node labels Rendre beau un arbre (l habiller, le maquiller ) nodelabels("holométaboles", node=13) Holométaboles # bootstrap labels plot(tr) nodelabels() 10 bs.pars <- scan() plot(tr) nodelabels(bs.pars, adj = c(-0.2, -0.1), frame = "n",cex = 0.8, font = 2) 11 12 16 17 13 Exemple 14 15 Romain Nattier (UMR7205) Dessine-moi un arbre sous R Semin-R 28/01/2011 22/25

Un exemple concret # a nice example # HEXAPODES de Lecointre & Leguyader (2001) # entrée de l'arbre sous format Newick # divisision en plusieurs clades pour plus de lisibilités clade1 <- "((((, Trichoptères),(Mécoptères,(Siphonaptères,))), ),(((Mégaloptères, Rhaphidioptères), Névroptères),(Strepsiptères, )))" clade2 <- "((((, Thysanoptères),(Phtiraptères, Psocoptères)), Zoraptères), ((, Phasmides, Embioptères, Grylloblattoptères, Dermaptères), Plécoptèroides, ))" clade3 <- paste("(", clade1, ",", clade2, ")") hexapods <- paste("(((", clade3, ", ), Thysanoures),(, Protoures));") hexapods <- read.tree(text=hexapods) # gestion des couleurs # couleurs des branches edge.color <- rep(1, 49) edge.color[c(9,11,13,17,18,19,20,21,23,30,31,32,33,34,38,39,40,41,42,45,46,47,48)]<-"lightgrey" # font et couleur des étiquettes font <- tip.color <- rep(2,27) seltip <- c(2,3,4,7,8,9,10,13,14:16,18:22,25:27) font[seltip]<-1 tip.color[seltip]<-"lightgrey" # recupérer les limites de x x.lim <- plot(hexapods, type="c")$x.lim dev.off() # plot l'arbre plot(hexapods,edge.color=edge.color,tip.color=tip.color, type="c", no.margin=true,font=font, x.lim=c(x.lim[1],x.lim[2]+2)) # texte supplémentaire text(c("[flambé]", "[Taon]", "[Frelon]", "[Cerf-volant]", "[Cigale]", "[Blatte]", "[Grillon]", "[Libellule]"), x=rep(33,8), y=c(1,5,6,11,12,17,23,24), adj=0, cex=0.85) # noeuds nodelabels(n=28, frame="n", pch=21, bg="blue") nodelabels(n=29, frame="n", pch=21, bg="red") # légendes legend("bottomleft", c("hexapodes", "Insectes"), pt.bg=c("blue","red"), pch=21, bty="n") Romain Nattier (UMR7205) Dessine-moi un arbre sous R Semin-R 28/01/2011 23/25

Un exemple concret # a nice example # HEXAPODES de Lecointre & Leguyader (2001) # entrée de l'arbre sous format Newick # divisision en plusieurs clades pour plus de lisibilités clade1 <- "((((, Trichoptères),(Mécoptères,(Siphonaptères,))), ),(((Mégaloptères, Rhaphidioptères), Névroptères),(Strepsiptères, )))" clade2 <- "((((, Thysanoptères),(Phtiraptères, Psocoptères)), Zoraptères), ((, Phasmides, Embioptères, Grylloblattoptères, Dermaptères), Plécoptèroides, ))" clade3 <- paste("(", clade1, ",", clade2, ")") hexapods <- paste("(((", clade3, ", ), Thysanoures),(, Protoures));") hexapods <- read.tree(text=hexapods) # gestion des couleurs # couleurs des branches edge.color <- rep(1, 49) edge.color[c(9,11,13,17,18,19,20,21,23,30,31,32,33,34,38,39,40,41,42,45,46,47,48)]<-"lightgrey" # font et couleur des étiquettes font <- tip.color <- rep(2,27) seltip <- c(2,3,4,7,8,9,10,13,14:16,18:22,25:27) font[seltip]<-1 tip.color[seltip]<-"lightgrey" # recupérer les limites de x x.lim <- plot(hexapods, type="c")$x.lim dev.off() # plot l'arbre plot(hexapods,edge.color=edge.color,tip.color=tip.color, type="c", no.margin=true,font=font, x.lim=c(x.lim[1],x.lim[2]+2)) # texte supplémentaire text(c("[flambé]", "[Taon]", "[Frelon]", "[Cerf-volant]", "[Cigale]", "[Blatte]", "[Grillon]", "[Libellule]"), x=rep(33,8), y=c(1,5,6,11,12,17,23,24), adj=0, cex=0.85) # noeuds nodelabels(n=28, frame="n", pch=21, bg="blue") nodelabels(n=29, frame="n", pch=21, bg="red") # légendes legend("bottomleft", c("hexapodes", "Insectes"), pt.bg=c("blue","red"), pch=21, bty="n") Romain Nattier (UMR7205) Dessine-moi un arbre sous R Semin-R 28/01/2011 24/25

Pour aller plus loin: faire des analyses phylogénétiques sous R? Log-Lineages Through Time 0 number of lineages 16 10 8 6 4 2 time (millions years before present) 0 LTT plot Autres packages: LASER, GEIGER Romain Nattier (UMR7205) Dessine-moi un arbre sous R Semin-R 28/01/2011 25/25

emerciements: - MNHN, Semin-R - Jérome Sueur (UMR 7205) - Loïc Ponger (USM 503) - Votre attention. et vos questions!