Re: [R-sig-phylo] Error in read.beast()

2014-01-30 Thread Nathan Steadman Upham
Hi Mariana
I'd recommend making sure that the BEAST tree you are trying to read in is a 
*direct* output from TreeAnnotator.  That is, make sure you have not modified 
the file in FigTree or another program, and saved over it, since that will add 
/ remove data from the nexus file.  Try re-running TreeAnnotator to get your 
MCC tree, then load that into phyloch with something similar to this:

Btree- read.beast(file.nex); ## the TreeAnnotator output
quartz(width=8.5, height=11)
data(gradstein04)
plot(Btree, cex=0.6, label.offset=0.5, no.margin=T, root.edge=T)
HPDbars(Btree, label=height_95%_HPD, broken=T, lwd=3, 
col=hsv(0.65,1,1,alpha=0.7))
axisGeo(GTS = gradstein04, unit = c(epoch), cex = 0.8, ages=FALSE, gridty=3, 
gridcol=grey50)
axisPhylo(cex.axis=0.5, pos=-1.5, mgp=c(0,0.2,0))
node.support(Btree$posterior, cutoff=0.95, mode=dots, col = c(black), 
cex=0.5) ## adds dots for anything  0.95
node.support(Btree$posterior, cutoff=0, mode=numbers, digits = 2, pos = 
pretty, cex=0.3) ## adds numbers (PP) for everything (can then use another 
program to remove values  0.95)

Best,
--nate


___
Nathan S. Upham
Ph.D. candidate, Committee on Evolutionary Biology, University of Chicago
1025 E. 57th St., Culver 402, Chicago IL 60637

Resident Graduate Student, Division of Mammals, Field Museum of Natural History
1400 S. Lake Shore Drive, Chicago, IL 60605

nsup...@uchicago.edumailto:nsup...@uchicago.edu | 
http://home.uchicago.edu/~nsupham/
publication pdfs: http://chicago.academia.edu/NathanUpham
___

On Jan 21, 2014, at 9:40 AM, Santiago Sánchez 
santiago.snc...@gmail.commailto:santiago.snc...@gmail.com wrote:

To me it sounds like one of the BEAST annotation vectors is empty. Did you
inspect the file in FigTree and check if all annotations show up?

Cheers,
Santiago

On Tuesday, January 21, 2014, Mariana Vasconcellos 
marian...@utexas.edumailto:marian...@utexas.edu
wrote:

Thank you Santiago, but this didn't solve my problem. I have already tried
this and it didn't work. I don't understand what the error: Error in (i2 +
1):end : argument of length 0 means.

--
Mariana Mira Vasconcellos
marian...@utexas.edumailto:marian...@utexas.edu javascript:_e({}, 'cvml', 
'marian...@utexas.edumailto:marian...@utexas.edu');
PhD candidate
Ecology, Evolution  Behavior
Integrative Biology
The University of Texas at Austin




On Jan 21, 2014, at 7:22 AM, Santiago Sánchez 
santiago.snc...@gmail.commailto:santiago.snc...@gmail.comjavascript:_e({}, 
'cvml', 'santiago.snc...@gmail.commailto:santiago.snc...@gmail.com');
wrote:

Hello Mariana,

When I use read.beast() I usually specify a digit number.
If most estimates are in millions of years I usually give digits=2, but if
time frames are shorter, like thousands of years, you will have smaller
fractions, in this case I give digits=10. Again, I'm not sure if this will
solve the issue.

read.beast(tree, digits=2)

Or

read.beast(tree, digits=10)

Cheers,
Santiago


--
Santiago Sánchez-Ramírez
Department of Ecology and Evolutionary Biology, University of Toronto
Department of Natural History (Mycology), Royal Ontario Museum
100 Queen's Park
Toronto, ON
M5S 2C6
Canada
Other email: 
santiago.sanc...@mail.utoronto.camailto:santiago.sanc...@mail.utoronto.ca 
javascript:_e({}, 'cvml',
'santiago.sanc...@mail.utoronto.camailto:santiago.sanc...@mail.utoronto.ca');
Tel. 416-586-8025




--
Santiago Sánchez-Ramírez
Department of Ecology and Evolutionary Biology, University of Toronto
Department of Natural History (Mycology), Royal Ontario Museum
100 Queen's Park
Toronto, ON
M5S 2C6
Canada
Other email: 
santiago.sanc...@mail.utoronto.camailto:santiago.sanc...@mail.utoronto.ca
Tel. 416-586-8025

[[alternative HTML version deleted]]

___
R-sig-phylo mailing list - 
R-sig-phylo@r-project.orgmailto: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/


[[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] Midpoint rooting routine?

2014-01-30 Thread Todd Oakley

Colleagues,
Does anyone know of an existing midpoint rooting routine? I am 
displaying trees and would like to show them as midpoint rooted.
I've been using the Phangorn package, which does the midpoint rooting 
perfectly, but it has some dependencies that make it unstable on the 
linux machines I've been using. When I looked last, Phangorn was the 
only package I could find with midpoint routing.


Thanks for any ideas...

Todd Oakley, UCSB

___
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] Midpoint rooting routine?

2014-01-30 Thread Liam J. Revell

Hi Todd.

Challenge accepted ;)

Try the attached code. In my tests it returns the exact same result as 
midpoint in phangorn, but it does not use any phangorn code internally. 
(It does depend on phytools  dependencies, particularly ape.) It is 
probably much less elegant  slower than phangorn (I haven't tested 
that). If it works, please let me know  I will add to phytools.


All the best, Liam

Liam J. Revell, Assistant 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 1/30/2014 1:00 PM, Todd Oakley wrote:

Colleagues,
 Does anyone know of an existing midpoint rooting routine? I am
displaying trees and would like to show them as midpoint rooted.
I've been using the Phangorn package, which does the midpoint rooting
perfectly, but it has some dependencies that make it unstable on the
linux machines I've been using. When I looked last, Phangorn was the
only package I could find with midpoint routing.

 Thanks for any ideas...

Todd Oakley, UCSB

___
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/
## function for midpoint rooting
## written by Liam J. Revell 2014

midpoint.root-function(tree){
D-cophenetic(tree)
dd-max(D)
ii-which(D==dd)[1]
ii-c(ceiling(ii/nrow(D)),ii%%nrow(D))
if(ii[2]==0) ii[2]-nrow(D)
spp-rownames(D)[ii]
nn-which(tree$tip.label==spp[2])
tree-reroot(tree,nn,tree$edge.length[which(tree$edge[,2]==nn)])
aa-getAncestors(tree,which(tree$tip.label==spp[1]))
D-c(0,dist.nodes(tree)[which(tree$tip.label==spp[1]),aa])
names(D)[1]-which(tree$tip.label==spp[1])
i-0
while(D[i+1](dd/2)) i-i+1
tree-reroot(tree,as.numeric(names(D)[i]),D[i+1]-dd/2)
tree
}

## function gets ancestor node numbers
## written by Liam J. Revell

getAncestors-function(tree,node,type=c(all,parent)){
type-type[1]
if(type==all){
aa-vector()
rt-length(tree$tip.label)+1
currnode-node
while(currnode!=rt){
currnode-getAncestors(tree,currnode,parent)
aa-c(aa,currnode)
}
return(aa)
} else if(type==parent){
aa-tree$edge[which(tree$edge[,2]==node),1]
return(aa)
} else stop(do not recognize type)
}___
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] Midpoint rooting routine?

2014-01-30 Thread Joe Felsenstein
Liam said:

 Joe's correct that this is not yet in our project to create an R interface
 for PHYLIP (Rphylip, https://github.com/liamrevell/Rphylip). As soon as I
 get a chance to work on this project today, I will add it.

That may be hard to do, as Retree is interactive and
has two levels of menus.

Joe

Joe Felsenstein j...@gs.washington.edu
 Department of Genome Sciences and Department of Biology,
 University of Washington, Box 355065, Seattle, WA 98195-5065 USA

___
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] Midpoint rooting routine?

2014-01-30 Thread Todd Oakley

All,
As an update: the script that Liam wrote for midpoint rooting seems to 
have worked well for us. I did not numerically test the rooting results, 
but they pass the eye test (ie they look right to me). I serially 
rooted about 100 trees with 50-250 OTU's each, and it was fast, so it 
was efficient in our hands.


Liam has described his process and function on his blog, here:

http://blog.phytools.org/2014/01/function-for-midpoint-rooting.html?spref=fb



My application for this is a tool called tab2trees, implemented in 
Osiris for Galaxy. It takes a list of newick tree descriptions and 
visualizes all the trees in a pdf book, with one tree per page. Since 
I often use gene trees, midpoint rooting is a sensible way to present 
the trees. Here is a description of tab2trees (pre-midpoint rooting):


http://osiris-phylogenetics.blogspot.com/2012/09/tab2trees.html


Best wishes,
Todd Oakley, UCSB





On 1/30/2014 3:57 PM, Joe Felsenstein wrote:

Liam said:


Joe's correct that this is not yet in our project to create an R interface
for PHYLIP (Rphylip, https://github.com/liamrevell/Rphylip). As soon as I
get a chance to work on this project today, I will add it.

That may be hard to do, as Retree is interactive and
has two levels of menus.

Joe

Joe Felsenstein j...@gs.washington.edu
  Department of Genome Sciences and Department of Biology,
  University of Washington, Box 355065, Seattle, WA 98195-5065 USA


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