Re: [R-sig-phylo] distances between the nodes

2017-02-24 Thread Klaus Schliep
Dear Justyna

tr$edge does not store coordinates, see help(phylo).
if you want the coordinates of the nodes of your last plotted tree you can
get them:
library(ape)
tree = rtree(5)
nodelabels()
tiplabels()
last_plot = get("last_plot.phylo", envir = .PlotPhyloEnv)
last_plot$xx and last_plot$yy contain the coordinates of the nodes.

there is also a (generic) function cophenetic() in ape to compute the
patristic distance and for larger trees this is much faster than distTips.

Regards,
Klaus


On Fri, Feb 24, 2017 at 11:03 AM, Eduardo Ascarrunz 
wrote:

> Hi Justyna,
>
> If you want patristic distances (or node distances) you can use distTips
> from the adephylo package.
>
> To make edgelabels show the branch lengths you can use
> edgelabels(tr$edge.length)
>
> Does that do what you wanted?
>
> Cheers,
>
> Eduardo
>
> 2017-02-23 16:41 GMT+01:00 Wierzbinska, Justyna  heidelberg.de>:
>
>>
>>
>> Dear Ape users,
>>
>>
>>
>> I’be grateful for your help with my ape problems.
>>
>> I find it difficult to figure out how I can look at the distances between
>> the main nodes generated in the phylogenetic tree below. My idea is to
>> extract the distances between NBCs to hiMBCs. Somehow looking at the
>> exemplary object tr and using tr$edge and tr$edge.length it doesn’t seem to
>> be an easy task.
>>
>>
>>
>>
>>
>> *[image: cid:part1.C97E7A27.01EB5ADD@uq.edu.au]*
>>
>>
>>
>> I’ve tried to add node labels using nodelabels() and edge labels but
>> somehow the assigned labels are different then the coordinates stored in
>> the tr$edge would suggest (when I look at the tip projection).
>>
>> Any ideas how I can do it in an automatic way? Is it just a plotting
>> problem that the coordinates of edges don’t correspond to what I see in the
>> tree.
>>
>>
>>
>>
>>
>> Thank you very much.
>>
>> Kind regards,
>>
>> Justyna
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Division of Epigenomics and Cancer Risk Factors (C010)
>>
>>
>>
>> *German Cancer Research Center (DKFZ)*
>>
>> Foundation under Public Law
>>
>> Im Neuenheimer Feld 280
>>
>> 69120 Heidelberg
>>
>> Germany
>>
>> +49 6221 42 <+49%206221%2042> 3359
>>
>> j.wierzbin...@dkfz-heidelberg.de
>>
>>
>>
>> Management Board: Prof. Dr. Michael Baumann, Prof. Dr. Josef Puchta
>>
>> VAT-ID No.: DE143293537
>>
>>
>>
>> ___
>> R-sig-phylo mailing list - R-sig-phylo@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>> Searchable archive at http://www.mail-archive.com/r-
>> sig-ph...@r-project.org/
>>
>
>
> ___
> R-sig-phylo mailing list - R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> Searchable archive at http://www.mail-archive.com/r-
> sig-ph...@r-project.org/
>



-- 
Klaus Schliep
Postdoctoral Fellow
Revell Lab, University of Massachusetts Boston
http://www.phangorn.org/
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

[R-sig-phylo] UK.CodingDataManageShinyappsRStudioForEvolutionaryBiologists.May15-19

2017-02-24 Thread Oliver Hooker
Coding, data management, and Shiny applications using RStudio for 
evolutionary biologists and ecologists (CDSR01)


http://www.prstatistics.com/course/coding-data-management-and-shiny-applications-using-rstudio-for-evolutionary-biologists-and-ecologists-cdsr01/

This course will run from the 15th - 19th May 2017 at SCENE field 
station, Loch Lomond, Scotland.


Course overview:
The course will introduce programming logic using the R syntax. The 
participants will be able to solve problems involving heterogeneous 
biological datasets and the combined use of different statistical 
packages, so the advantages of learning programming skills can be 
demonstrated. The RMarkdown syntax will be used to illustrate the 
advantages of literate programming and the possibilities of code sharing 
and archiving. In the sequence, participants will learn how to design 
relational databases (RDB) which can be used to manage and analyse large 
biological datasets. They will learn the basics of the SQL language and 
how to use it with R with the package {RMySQL}. To finalise, they will 
use the Shiny tool (R Studio) to build interactive applications to 
analyse and display data depending on user inputs. Throughout the course 
we will emphasise data, code and analyses best practices that could 
foster reproducibility and transparency in science, and the long-term 
availability of scientific data. At the end of the course the 
participants are expected to be able to develop small, tailored 
applications, to read and analyse datasets using a variety of statistics 
tools.


Intended Audience:
Researchers and postgraduate students working with in evolutionary 
biology and ecological data who want to have more autonomy and 
flexibility in their quantitative analyses, and need to access and 
analyse large datasets with R.


Monday 15th – Classes from 09:00 to 17:00
Module 1: Programming Logic
R syntax (Variable types – operators – conditionals – loops – 
writing functions)

Programming and commenting code with RMarkdown

Tuesday 16th – Classes from 09:00 to 17:00
Module 2: Data structures
R syntax (arrays, lists, data frames, matrices)
Data wrangling with {dplyr} and {tidyr}; the {ff} package and data 
tables for large datasets (e.g. transcriptomics; whole-genome data)

Best practices of data acquisition, organization and storage

Wednesday 17th – Classes from 09:00 to 17:00
Module 3: Relational databases
Introduction to the SQL language and MySQL (open-source RDB freeware)
Accessing and analysing large datasets using the package {RMySQL}
As an example, we will combine DNA sequence datasets with IUCN Red List 
data illustrate the use of RDB to biological datasets.


Thursday 18th – Classes from 09:00 to 17:00
Module 4: Introduction to Shiny (R Studio)
Shiny – Server and user interface commands
As an example we will use Shiny to develop a small application where 
users can select different species and genes and run/visualize 
phylogenetic trees using {ape} running in the background.


Friday 19th  – Classes from 09:00 to 16:00
Module 5: Wrapping-up
Development and presentation of individual projects combining data 
wrangling skills and user inputs using Shiny (R Studio)


Teaching Format:
The course will be highly practical, with a series of hands-on, 
step-by-step, problem-solving exercises, combining the different tools 
to solve ecological and evolutionary biology problems. The participants 
are invited to think of a problem that requires programming skills to be 
solved, and can bring their own data for a case-study. At the end of 
each day the participants will have time to work on their on projects 
and apply the skills learned on that day.


We offer two packages
COURSE ONLY – Includes lunch and refreshments.
ALL INCLUSIVE – Includes breakfast, lunch, dinner, refreshments, 
minibus to and from meeting point and accommodation. Accommodation is 
multiple occupancy (max 3 people) single sex en-suite rooms. Arrival 
Sunday 14th May and departure Friday 19th May PM.


Please send enquiries to oliverhoo...@prstatistics.com or visit 
www.prstatistics.com for more details.


Other relevant upcoming courses are as follows

1.  ADVANCED PYTHON FOR BIOLOGISTS (February 2017) #APYB
http://www.prstatistics.com/course/advanced-python-biologists-apyb01/

2.	STABLE ISOTOPE MIXING MODELS USING SIAR, SIBER AND MIXSIAR USING R 
(February 2017) #SIMM

http://www.prstatistics.com/course/stable-isotope-mixing-models-using-r-simm03/

3.  NETWORK ANAYLSIS FOR ECOLOGISTS USING R (March 2017) #NTWA
http://www.prstatistics.com/course/network-analysis-ecologists-ntwa01/

4.	ADVANCES IN MULTIVARIATE ANALYSIS OF SPATIAL ECOLOGICAL DATA (April 
2017) #MVSP

http://www.prstatistics.com/course/advances-in-spatial-analysis-of-multivariate-ecological-data-theory-and-practice-mvsp02/

5.  ADVANCING IN STATISTICAL MODELLING USING R (April 2017) #ADVR
http://www.prstatistics.com/course/advancing-statistical-modelling-using-r-advr06/

6.	CODING, DATA 

[R-sig-phylo] distances between the nodes

2017-02-24 Thread Wierzbinska, Justyna

Dear Ape users,

I'be grateful for your help with my ape problems.
I find it difficult to figure out how I can look at the distances between the 
main nodes generated in the phylogenetic tree below. My idea is to extract the 
distances between NBCs to hiMBCs. Somehow looking at the exemplary object tr 
and using tr$edge and tr$edge.length it doesn't seem to be an easy task.


[cid:part1.C97E7A27.01EB5ADD@uq.edu.au]

I've tried to add node labels using nodelabels() and edge labels but somehow 
the assigned labels are different then the coordinates stored in the tr$edge 
would suggest (when I look at the tip projection).
Any ideas how I can do it in an automatic way? Is it just a plotting problem 
that the coordinates of edges don't correspond to what I see in the tree.


Thank you very much.
Kind regards,
Justyna




Division of Epigenomics and Cancer Risk Factors (C010)

German Cancer Research Center (DKFZ)
Foundation under Public Law
Im Neuenheimer Feld 280
69120 Heidelberg
Germany
+49 6221 42 3359
j.wierzbin...@dkfz-heidelberg.de

[cid:image002.png@01D28DF3.A9808FF0]
Management Board: Prof. Dr. Michael Baumann, Prof. Dr. Josef Puchta
VAT-ID No.: DE143293537

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/