560 likes | 683 Views
Taller en Análisis filogenéticos comparativos en Ecofisiología. A plicación de Mesquite y R. Programa. Primero (11 Diciembre ) Introduction to Mesquite and R Data Preparation and Manipulation Tardes - Practical Use of Mesquite y R Segundo (12 Diciembre )
E N D
Taller en Análisisfilogenéticoscomparativos en Ecofisiología Aplicación de Mesquite y R
Programa • Primero (11 Diciembre) • Introduction to Mesquite and R • Data Preparation and Manipulation • Tardes - • Practical Use of Mesquite y R • Segundo (12 Diciembre) • Selection of Phylogenetic Trees • Supertrees – Assemblying Composite Trees • Sources of Phylogenetic Hypotheses • Estimation of Ancestral Character States • Categorical (Mesquite & R) • Continuous (R – ace)
Programa • Tercera (13 Diciembre) • Estimation of Phylogenetic Signal • Statistical Methods incorporating Phylogenetic information • Phylogenetic Independent Contrasts • Phylogenetic GLS • Multivariate Analyses • Bring your own Data!
Goals of Comparative Analyses • Investigar la evolucióncarácter • La coevolución de caracteres • Control de la no independencia de lasespecies • Hipótesis de ensayo de adaptación
Estadísticastradicionales de asumir la independencia de lasespecies (unidades de muestreo)…
Pero, lasespeciesexhibendiferentesniveles de relación, queafecta a lasinferencias de la adaptación local y la diversificación Pearman et al. TREE 2008
Estimacióncarácter ancestral Garganta Morphs en Urosaurus Feldman et al. 2011. Molecular Phylogenetics and Evolution
Dos importantesprogramas http://mesquiteproject.org/mesquite/mesquite.html http://cran.r-project.org/
Objetivos de Mesquite • Manipulate Phylogenetic Trees • Estimate Ancestral Character States • Estimate Character Correlations • Inferences of Character Evolution • Multivariate Analyses
Objetivospara • How to use R to Manipulate Data • Phylogenetic Comparative Analysis • Statistical Analyses not available in Mesquite
Ventajas de • Free • Many packages available • Powerful and Flexible • Platform Independent • MacOS • Linux • Windows
R Studio – A GUI for http://www.rstudio.com/
37 Paquetesfilogenéticos en • ape • caper • geiger • motmot • OUwie • phylobase • phyloclim • phytools • picante Sólovoy a describirestospaquetes
DatosNecesarios • Phylogenetic Tree • NEXUS format • NEWICK format ((B:0.2,(C:0.3,D:0.4)E:0.5)F:0.1)A • Data • Continuous • Discrete • Flat Format (Texto, ASCII)
Nexus Data File Format #nexus ... begin trees; translate 1 Phrynosoma, 2 Uta, 3 Petrosaurus, 4 Urosaurus, 5 Sceloporus ; tree one = [&U] (1,2,(3,(4,5)); tree two = [&U] (1,3,(5,(2,4)); end;
A tutorial in Mesquite 1. Characters 2. Taxa 3. Trees Treselementos de Mesquite
PrimeroVentana de Mesquite Projects and Files – list of open projects Log – list of commands
Numero de caracteres y el tipo de caracteres
Dataframes • Rectangular table of information • Can include numbers, text • This is the form of your data when you import into R
Morphology = Dataframe Behaves as a Matrix No Spaces in species or variable names Use attach to directly refer to variable names attach(morphology) Character 2 # gives all values of character 2
Importación de datos • Change the “working directory” • Easy in R Studio • Data should be in a clean rectangular matrix • Flat File (No formatting), ASCII text • Exported from excel • First row: Variable Names • First column: Species/Taxon Names • example: Iguana Life History Data
Species SVL Mass CS RCM EggMEggSEggVOffSVLAdSAgeMatEnv Amblyrhynchus_cristatus 279.0 1370.0 2.6 0.18 98.6 90.33 21.8 NA 0.85 41.0 Island Conolophus_pallidus 440.0 4300.0 10.0 NA NA NA NA NA NA NA Island Conolophus_subcristatus 415.0 3600.0 13.5 0.199 51.2 63.4 NA NA 0.9 84.0 Island Ctenosaura_clarki 126.58 70.78 8.5 0.24 2.45 23.37 3.05 NA NA NA Main Ctenosaura_hemilopha 219.33 375.0 27.33 0.21 2.37 21.22 2.69 NA NA NA Main Ctenosaura_pectinata 238.7 482.0 28.0 0.23 3.92 26.3 2.29 NA NA NA Main Ctenosaura_similis 238.39 795.13 31.1 0.4 7.72 30.92 2.28 NA 0.78 22.0 Main Cyclura_carinata 225.0 605.3 5.1 0.21 25.0 52.0 44.87 NA 0.9 72.0 Island Cyclura_ricordi 355.0 1275.0 10.2 NA NA NA NA NA NA NA Island Cyclura_cychlura 405.0 2805.0 8.75 0.21 68.69 73.01 61.34 96.0 NA NA Island Cyclura_nubila 340.0 1700.0 8.12 NA NA NA NA 99.8 NA NA Island Cyclura_cornuta 355.0 3745.6 15.76 NA NA NA NA NA 0.9 72.0 Island Cyclura_inornata 320.0 1336.0 4.1 0.165 55.12 66.0 NA 95.0 NA 132.0 Island Cyclura_stejnegeri 475.0 4516.0 2.4 0.06 115.0 81.66 122.45 NA NA 110.0 Island Dipsosaurus_dorsalis 123.0 70.0 5.6 NA NA NA NA NA 0.66 32.0 Main Iguana_iguana 360.35 115.65 32.86 0.46 15.7 39.35 NA NA NA NA Main Sauromalus_obesus 160.55 180.0 8.59 0.38 8.0 25.0 15.0 NA 0.8 48.0 Main Sauromalus_hispidus 279.0 900.0 22.2 0.24 10.0 25.0 24.0 NA NA NA Island Sauromalus_varius 293.6 1200.0 23.4 0.35 18.0 40.0 28.0 NA NA NA Island Crotaphytus_collaris 84.8 24.66 8.6 0.217 1.23 21.3 NA NA 0.48 12.0 Main
Importing Data • Workhorse function: read.table() iguana.lh <- read.table(file=“iguanalh.txt”, header=TRUE) • iguana.lh (dataframe name) • Check to make sure data were read in correctly • iguana.lh[1:10,] # look at first 10 rows
Otrasformas de importardatos • Other formats: read.csv(), read.delim() • (useful if there are spaces within some fields) • Handy function: file.choose() # navigate to file iguana.lh <- read.table(file=file.choose(), header=T) attach(iguana.lh) # easy to manipulate variables
Factors • Used to represent categorical data; by default, read.table() • converts columns with characters into factors • Factors look like strings, but are treated differently by functions • species #example of a factor • Factors have levels, which are the unique values it takes • levels(species) # example of a factor • Factor levels may be ordered (e.g., low, med, high), which is important in some analyses (see ?factor and ?ordered)