[R-sig-phylo] Simulated phylogenies with character divergence

2014-10-21 Thread Ben Weinstein
Hi all,

There seem to be an ever growing number of functions for simulating
phylogenies along with traits and associated models of evolution. I'm
wondering different users suggestions for the simplest way to do the
following two cases. This is not for a full paper, but just a side
supporting analysis, so it doesn't have to be exhaustive.

1. Simulate a conserved trait (environmental tolerance) along a specified
sized phylogeny.

2. Simulate the same conserved trait along the same phylogeny but with the
additional of repulsion (character divergence) among closely related
species.

Extra bonus would be if i could control the strength of phylogenetic
conservatism and character divergence in a nice array.

If anyone has some general 'psudeo code' or package::function steps in this
direction i'd appreciate all feedback.

Thanks,

Ben Weinstein

-- 
Ben Weinstein
PhD Candidate
Ecology and Evolution
Stony Brook University

http://benweinstein.weebly.com/

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


[R-sig-phylo] Simulated phylogenies with character divergence

2014-10-20 Thread Ben Weinstein
Hi all,

There seem to be an ever growing number of functions for simulating
phylogenies along with traits and associated models of evolution. I'm
wondering different users suggestions for the simplest way to do the
following two cases. This is not for a full paper, but just a side
supporting analysis, so it doesn't have to be exhaustive.

1. Simulate a conserved trait (environmental tolerance) along a specified
sized phylogeny.

2. Simulate the same conserved trait along the same phylogeny but with the
additional of repulsion (character divergence) among closely related
species.

Extra bonus would be if i could control the strength of phylogenetic
conservatism and character divergence in a nice array.

If anyone has some general 'pseudo code' or package::function steps in this
direction i'd appreciate all feedback.

I'm currently trying to use the growTree inheritance rules in caper, but i
haven't had much success. I've also tried tweaking the plgmm.sim function
in picante but i can't figure out what parameters would control the
repulsion and signal in the trait.

Thanks,

Ben Weinstein

PS: Sorry if i double posted, wasn't sure which email address was signed
into the list.

-- 
Ben Weinstein
PhD Candidate
Ecology and Evolution
Stony Brook University

http://benweinstein.weebly.com/

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


[R-sig-phylo] breaking up phylogeny figure

2012-10-03 Thread Ben Weinstein
Hi all,

I'm wondering if there is a way to plot a phylogeny in R that is broken up
and displayed side by side to condense space. I've made a backbone in R
that i'd like to make into a figure, but it is too tall. If this isn't the
write setup, could someone suggest what program (and format for me to
write.tree) from R. I am using windows, in terms of potential third part
programs.

Thanks,

ben

-- 
Ben Weinstein
Graduate Student
Ecology and Evolution
Stony Brook University

http://life.bio.sunysb.edu/~bweinste/index.html

[[alternative HTML version deleted]]

___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


[R-sig-phylo] find mrca of multiple taxa.

2012-08-15 Thread Ben Weinstein
Hello all,

I'm trying to replace a clade of tips with a single tip, placed at the mrca
of all taxa clade (similar Q to here
https://stat.ethz.ch/pipermail/r-sig-phylo/2012-March/001895.html). Before
i bind tree, I just need to a nice way to identify which node encompasses
all descendants. I see many packages and functions, but i can't quite get
the result i want. Forgive me if i've just missed this function somewhere,
it seems hard to believe it hasn't been written explicitly.

Clearly the package phylobase knows which node i want, when i subset by the
tips.include

library(phylobase)

data(geospiza)
nodeLabels(geospiza) - paste(N, nodeId(geospiza, internal), sep=)
geotree - extractTree(geospiza)

## subset examples
tips - c(difficilis, fortis, fuliginosa, fusca, olivacea,
pallida, parvulus, scandens)
subset(geotree, tips.include=tips)

 How can i get it to return which node it used, numbered from the
original tree?

My other attempt was to use expand.grid and mrca through an sapply
command to brute force walk through every pair of taxa, and then take
the maximum node number (since its farthest up the tree). This seems
inelegant, and i'm not convinced it works 100% of the time.

Thanks for your input.

Ben Weinstein






-- 
Ben Weinstein
Graduate Student
Ecology and Evolution
Stony Brook University

http://life.bio.sunysb.edu/~bweinste/index.html

[[alternative HTML version deleted]]

___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


[R-sig-phylo] retraction

2012-08-15 Thread Ben Weinstein
Hi all,

Just to be complete for any future readers, the function findMRCA from
phytools meets this need. Took me awhile to go through all eight phylogeny
related packages i have.

Thanks

Ben

-- 
Ben Weinstein
Graduate Student
Ecology and Evolution
Stony Brook University

http://life.bio.sunysb.edu/~bweinste/index.html

[[alternative HTML version deleted]]

___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo



[R-sig-phylo] Cophenetic repeats

2012-05-27 Thread Ben Weinstein
Hi all,

I'm trying to decide if this an R error, or an error in
how I've implemented branch lengths.

When i create the cophenetic matrix for my tree, and look at the
relatedness of all tips to a single tip (i.e just looking at one column in
the matrix). I find that a large portion of them have identical cophenetic
distances.

 I thought the cophenetic would be the sum of the branch length between
tips (patristic distance), therefore there should only be pairs (sister
species have equal terminal branch length)  with *exactly * the same value.
Comparisons from distantly related taxa should be similar, since most of
the distance is dictated by the internal branches, but the terminal branch
should atleast create some difference.

Sorry that i can't really create a reproducible example for the question.

Here is some documentation:

trx-read.nexus(ColombiaPhylogenyUM.tre)
seeds-sample(trx$tip.label,1)
sp.weight.alpha-cophenetic(trx)[,seeds]


 table(sp.weight.alpha)sp.weight.alpha
 0 0.00775074  0.1179723  0.2187406  0.2379734 0.23797341  0.2525792
 1  1  2  4  3  2  6
0.36612256 0.36612257 0.52326843 0.59034104 0.59034105 0.59034106   0.607038
 2  2  2 31 82 29  3



82 of the species have the exact same distance to my selected tip .59034105


Am i using this function correctly?

I appreciate the help,

Ben Weinstein

-- 
Ben Weinstein
Graduate Student
Ecology and Evolution
Stony Brook University

http://life.bio.sunysb.edu/~bweinste/index.html

[[alternative HTML version deleted]]

___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


[R-sig-phylo] collapse nodes based on node labels

2012-02-12 Thread Ben Weinstein
Hello all,

Is there an analogous function to ape's di2multi which
collapses descendant branches based on an input node? Instead of minimum
branch tolerance to create polytomies, what would the best strategy to
collapse all descendant branches of node X. I've played around with
node.leaves, but haven't had great luck. I'm considering pruning the tree,
collapsing the entire subtree and regrafting it on.

Similarly to this, is there a way to maintain the original node numbering,
even after setting nodelabels? For example if i set my nodelabels to my
support values, but still want to highlight the first node in the tree. The
support values are non unique (multiple 99s), so it becomes harder to
specify commands to specific nodes.

I appreciate the help,

Ben Weinstein

-- 
Ben Weinstein
Graduate Student
Ecology and Evolution
Stony Brook University

http://life.bio.sunysb.edu/~bweinste/index.html

[[alternative HTML version deleted]]

___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo