-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
object 'last_plot.phylo' not found & Error in seq.default(0, length = n) #79
Comments
I am getting the same error with a tree with 5000+ tips.
The trace looks like
|
I copy and pasted the function from https://github.com/liamrevell/phytools/blob/6c9f388b9943dac0dc25bba4671bc563361c0e5f/R/utilities.R The issue appears to be in this piece of code, I am afraid I am not the greatest R coder or debugger. It looks like
|
Managed to fix these with two changes.
Modified function to be:
Then call this as:
|
Hi,
I have large tree and I plan to use
arc.cladelabels
function to highlight those bigger clades. My script worked smaller dataset, but when I used for larger dataset. The MAC gives error:Error in get("last_plot.phylo", envir = .PlotPhyloEnv) :
object 'last_plot.phylo' not found
On Linux machine, it gives error:
Error in seq.default(0, length = n) :
'length.out' must be a non-negative number
Not sure, what's going wrong when scale up.
Thanks!
Miao
> packageVersion("phytools")
[1] ‘0.7.70’
my script:
r```
m(list=ls())
library("phytools")
tree <- read.tree("./husge_phylogeny.tre")
tree2 <- ladderize(tree)
tree2 <- ips::fixNodes(tree2)
plotTree(tree2,type="fan", fsize=0.0002, xlim=c(-6.1,6.1), lwd =0.1)
clade <- unique(sapply(strsplit(tree2$tip.label, "_"), "[", 1)) #clade coded in the tree tips
color = grDevices::colors()[grep('gr(a|e)y', grDevices::colors(), invert = T)]
colx <- sample(color, length(clade))
for(i in 1:length(clade)){
order <- clade[i]
if(length(grep(order, tree2$tip.label))==1){
node <- grep(order, tree2$tip.label)
arc.cladelabels(tree2, order, node=node, orientation="horizontal",ln.offset=1.02,lab.offset=0.9, mark.node=FALSE, cex=0.5)
#print(paste(order, ",", node, sep=""))
}else{
node <- findMRCA(tree2, tree2$tip.label[grep(order, tree2$tip.label)])
#print(paste(order, ",", node, sep=""))
arc.cladelabels(tree2, order, node, lwd=2, ln.offset=1.02, lab.offset=1.05, col=colx[i], cex=0.8)
}
}
The text was updated successfully, but these errors were encountered: