-
Notifications
You must be signed in to change notification settings - Fork 6
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
Error in draw.clade: invalid subscript type 'list' #31
Comments
Looks like the problem is there: Lines 1106 to 1109 in a9717ae
This returns > head(parents)
[[1]]
[1] 4
[[2]]
[1] 5
[[3]]
[1] 6
[[4]]
[1] 7
[[5]]
[1] 8
[[6]]
[1] 9
> table(sapply(parents, length))
0 1
1 45598
> which.min(sapply(parents, length))
[1] 45519
> parents[45519]
[[1]]
integer(0)
> e[45519,]
parent child length isTip x0 x1 y0 y1
86210 67061 84808 0.3695876 FALSE 0 0.3695876 65882.59 65882.59
> which(obj$edges$child == 67061)
integer(0)
> Ntip(phy)
[1] 67060 The node in question is the root. |
Potential fix: @@ -1105,6 +1107,8 @@ draw.clade <- function(obj, tips, col='red', is.mono=TRUE, max.tips=100, ...) {
if (obj$layout == 'rectangular') {
parents <- sapply(e$parent, function(p) which(obj$edges$child==p))
+ # exclude root node
+ parents <- unlist(parents)
segments(x0=e$x0, y0=e$y0, y1=obj$edges$y0[parents], col=col, ...)
}
else if (obj$layout == 'radial') { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Attempting to color branches in very large tree:
The text was updated successfully, but these errors were encountered: