Re: [R-sig-phylo] mean phylogenetic distance for subsets of species from a tree

2017-02-02 Thread Liam J. Revell

Hi Zach.

Do you just mean the mean patristic distance among all pairwise 
combinations of species in each assemblage?


If you have your assemblages in a list of vectors, each containing the 
species of the corresponding assemblage, I think you could do:


library(ape)
D<-cophenetic(tree)
d<-sapply(assemblages,function(sp,D) mean(as.dist(D[sp,sp])),D=D)

Does that work?

All the best, Liam

Liam J. Revell, Associate Professor of Biology
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/
email: liam.rev...@umb.edu
blog: http://blog.phytools.org

On 2/2/2017 3:22 PM, Zach Culumber wrote:

Hi everyone,

I have a time-calibrated phylogeny with ~100 species and a list of ~1000
observed species assemblages which vary from 2-20 species in size.  I'd
like to get the mean phylogenetic distance among species in each
assemblage, but I'm having difficulty finding a way to do this.  The
comm.phylo.cor command in picante throws an error in as.hclust.default(x),
that x cannot be coerced to class hclust, and I've hit a dead end finding a
solution to that error.  I'm not sure whether comm.phylo.cor will do what I
want even if it works.

I wrote a loop to prune the phylogeny separately for each group of species,
which can then theoretically be used to get the distances with
cophenetic.phylo.  However, as soon as I start to run cophenetic.phylo
across my list of trees, R starts to hang up and freeze my entire computer
even though my code is set to skip trees for which distance can't be
measured.  One time it managed run a few and gave a memory error (e.g.,
6050235 Tb of memory is not available).  But R freezes even when I try to
run this on an 12 core mac.

Does anyone have any other suggestions for how to get the mean phylogenetic
distance for subsets of species on a tree?  Thanks for any ideas!

Zach




___
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] mean phylogenetic distance for subsets of species from a tree

2017-02-02 Thread Zach Culumber
Hi everyone,

I have a time-calibrated phylogeny with ~100 species and a list of ~1000
observed species assemblages which vary from 2-20 species in size.  I'd
like to get the mean phylogenetic distance among species in each
assemblage, but I'm having difficulty finding a way to do this.  The
comm.phylo.cor command in picante throws an error in as.hclust.default(x),
that x cannot be coerced to class hclust, and I've hit a dead end finding a
solution to that error.  I'm not sure whether comm.phylo.cor will do what I
want even if it works.

I wrote a loop to prune the phylogeny separately for each group of species,
which can then theoretically be used to get the distances with
cophenetic.phylo.  However, as soon as I start to run cophenetic.phylo
across my list of trees, R starts to hang up and freeze my entire computer
even though my code is set to skip trees for which distance can't be
measured.  One time it managed run a few and gave a memory error (e.g.,
6050235 Tb of memory is not available).  But R freezes even when I try to
run this on an 12 core mac.

Does anyone have any other suggestions for how to get the mean phylogenetic
distance for subsets of species on a tree?  Thanks for any ideas!

Zach


-- 
Zachary W. Culumber
Postdoctoral Research Associate
Kansas State University
Division of Biology

[[alternative HTML version deleted]]

___
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/


Re: [R-sig-phylo] HKY GTR distances

2017-02-02 Thread Jacob Berv
Can you do this in MEGA?
Jake

> On Feb 1, 2017, at 5:52 PM, kolte...@rub.de  
> wrote:
> 
> Dear Phylothusiasts,
> I need to compare multiple substitution models side-by-side (species 
> clustering stuff by distances only). Unfortunately, I am not aware of an 
> implementation of HKY and GTR distance computations using R. Maybe there is 
> some Github code or something else that I have been missing?
> I do not want to build a phylogenetic tree. I can not use PAUP (>500 big 
> fasta files).
> Any ideas are greatly appreciated.
> Best wishes,
> Andreas
> 
> ___
> 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 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] HKY GTR distances

2017-02-02 Thread kolte...@rub.de

Dear Phylothusiasts,
I need to compare multiple substitution models side-by-side (species 
clustering stuff by distances only). Unfortunately, I am not aware of an 
implementation of HKY and GTR distance computations using R. Maybe there 
is some Github code or something else that I have been missing?
I do not want to build a phylogenetic tree. I can not use PAUP (>500 big 
fasta files).

Any ideas are greatly appreciated.
Best wishes,
Andreas

___
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] detect psbA-trnH inversions (and what to do with them) before phylogenetic reconstruction

2017-02-02 Thread kolte...@rub.de

Dear Phylothusiasts,
what is the most reliable way (implemented in R) to detect inversions 
within psbA-trnH in large datasets (>1 seq)? What kind of treatment 
would you suggest before attempting a phylogenetic reconstruction 
(except exclusion)?

Best wishes,
Andreas

@moderator: feel free to combine my two messages currently being held 
for moderation


___
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/