-
Notifications
You must be signed in to change notification settings - Fork 29
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: argument is of length zero #92
Comments
I'd suggest to use as.dendrogram on each object first and see if there is a
problem there. If there isn't I'd look at the plot of each of the
as.dendrogram objects to see if the trees have any issues. Also, look at
setdiff of the labels of each tree (they both must have the exact same set
of labels).
Hope this helps.
…On Thu, Apr 25, 2019 at 3:54 AM dezordi ***@***.***> wrote:
library(ape)
library(dendextend)
tree1 <- read.tree(file='/home/bioinfo/Desktop/tree_element.txt')
is.rooted(tree1)
tree2 <- read.tree(file='/home/bioinfo/Desktop/tree_glyco.txt')
is.rooted(tree2)
den1 <-chronos(tree1)
den2 <-chronos(tree2)
tanglegram(den1,den2)
output:
Error in if (new_labels_length < leaves_length) { :
argument is of length zero
if I:
>den1
output:
Chronogram
Call: chronos(phy = tree1)
Phylogenetic tree with 86 tips and 85 internal nodes.
Tip labels:
AAeliv_16, AegAag2_31, AegAag2_33, AAlC636_02, AAlC636_03, AAlC636_36, ...
Rooted; includes branch lengths.
or
>den2
output:
Chronogram
Call: chronos(phy = tree2)
Phylogenetic tree with 86 tips and 85 internal nodes.
Tip labels:
AAlC636_19, AAlC636_38, AAlFosh_06, AegAag2_39, AegAag2_03, CQuJoh_04, ...
Rooted; includes branch lengths.
Is it a common error? I already make other tanglegrams with the same
arguments, in this same computer with the same R version (version.string R
version 3.4.4 (2018-03-15)).
Thanks for your attention.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#92>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAHOJBRABKR7DO2VGD2OHJLPSGEW7ANCNFSM4HIL7LIA>
.
|
I found the error, several branches have the branch length equal to 0, it explains the 'argument is of length zero'. Moreover, I didn't find a parameter to plot branch support values in a tanglegram, there is any parameter to do this? Thanks. |
I have the same problem using trees that have some branch lengths = 0. Is there a way around this? |
Hey,
What happens if you use:
raise.dendrogram(dend, 0.01)
in the input of the dendrogram with a branch of height 0?
…On Mon, Jul 8, 2019 at 6:12 PM theo-llewellyn ***@***.***> wrote:
I have the same problem using trees that have some branch lengths = 0. Is
there a way around this?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#92?email_source=notifications&email_token=AAHOJBTQNWMVJV25YKMGTMLP6NRONA5CNFSM4HIL7LIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZNSVZQ#issuecomment-509291238>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAHOJBTR24FH7VQB42OVE2LP6NRONANCNFSM4HIL7LIA>
.
|
Hey, thanks for the reply. Error in attr(dend, "height") <- attr(dend, "height") + heiget_to_add : |
Any chance for a self contained code I can run to reproduce this error?
Maybe use dput to export the object?
…On Tue, Jul 9, 2019, 16:48 theo-llewellyn ***@***.***> wrote:
Hey, thanks for the reply.
When I call raise.dendrogram(dend, 0.01) on the dendrogram I get the
following error:
Error in attr(dend, "height") <- attr(dend, "height") + heiget_to_add :
attempt to set an attribute on NULL
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#92?email_source=notifications&email_token=AAHOJBSZL6LWDXC5OPNEHG3P6SQKTA5CNFSM4HIL7LIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZQQB5A#issuecomment-509673716>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAHOJBXSFBJNRMBFFIJZYXTP6SQKTANCNFSM4HIL7LIA>
.
|
library(ape) ASTRAL_tree <- read.tree(file.choose()) This is the code I ran. Is this sufficient or would you also need the tree file I use? |
I'll need the tree file.
Or paste the output of
dput(chronos_ASTRAL)
…On Tue, Jul 9, 2019, 17:23 theo-llewellyn ***@***.***> wrote:
library(ape)
library(dendextend)
ASTRAL_tree <- read.tree(file.choose())
chronos_ASTRAL <- chronos(ASTRAL_tree)
dendr <- as.dendrogram(chronos_ASTRAL)
raise.dendrogram(dendr, 0.01)
This is the code I ran. Is this sufficient or would you also need the tree
file I use?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#92?email_source=notifications&email_token=AAHOJBSQ5TJF6CEH7UGH7SLP6SUONA5CNFSM4HIL7LIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZQTUHQ#issuecomment-509688350>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAHOJBT3245MZR75UM3TEWLP6SUONANCNFSM4HIL7LIA>
.
|
structure(list(edge = structure(c(380L, 381L, 382L, 383L, 383L, |
Sorry for the massively long message! Haha. On inspecting the dendrograms produced by as.dendrogram I think something may going on at this stage as they have 0 members. Is it possible that the way ASTRAL adds branch annotations with square brackets could be affecting how the tree is converted into a dendrogram? The dendrograms and all other dendextend functions work beautifully when I feed them a trees from other programmes. |
Hi theo, I get that error when I try to insert a Bayesian tree with several unresolved clades, so the final tree had several clades with branch length equal to 0, I just resolve this when I'm re-run the phylogenetic analysis and that "unresolved clades" are defined. This occur because that package is designed to work with hierarchical clusters, and hierarchical cluster never has branch length = 0. I hope that help u. Best, |
Hi dezordi, |
output:
Error in if (new_labels_length < leaves_length) { :
argument is of length zero
if I:
>den1
output:
Chronogram
Call: chronos(phy = tree1)
Phylogenetic tree with 86 tips and 85 internal nodes.
Tip labels:
AAeliv_16, AegAag2_31, AegAag2_33, AAlC636_02, AAlC636_03, AAlC636_36, ...
Rooted; includes branch lengths.
or
>den2
output:
Chronogram
Call: chronos(phy = tree2)
Phylogenetic tree with 86 tips and 85 internal nodes.
Tip labels:
AAlC636_19, AAlC636_38, AAlFosh_06, AegAag2_39, AegAag2_03, CQuJoh_04, ...
Rooted; includes branch lengths.
Is it a common error? I already make other tanglegrams with the same arguments, in this same computer with the same R version (version.string R version 3.4.4 (2018-03-15)).
Thanks for your attention.
The text was updated successfully, but these errors were encountered: