While using ggtree in rstudio, it shows error in some commands
0
0
Entering edit mode
6.3 years ago

I want to construct round tree for my protein sequences, I am new to rstudio. By searching about ggtree i got little idea but still facing problems. I give the command

 > ggplot(tree, aes(x, y)) + geom_tree() + theme_tree() + xlab("seq") + ylab("comp")

and I got this error, what does it mean?

Error in FUN(X[[i]], ...) : object 'node' not found
ggtree • 4.4k views
ADD COMMENT
1
Entering edit mode

Please use the formatting bar (especially the code option) to present your post better. I've done it for you this time.
code_formatting

ADD REPLY
0
Entering edit mode

Could you provide a small example to reproduce the error?

ADD REPLY
0
Entering edit mode

and function to generate tree.

ADD REPLY
0
Entering edit mode

Can you also show your input tree. That error could suggest the tree is malformed.

ADD REPLY
0
Entering edit mode

I am using my protein sequences of different species, I am using fastq file for it but it does not work. May be my file format is wrong. I want to know the pipeline for making round tree in rtsudio? I want to make a likelihood tree. I already mentioned above that I am new to R that is why I am facing problems. I will be thankful If someone mention the complete pipeline.

ADD REPLY
1
Entering edit mode

What do you mean you have a FASTQ of protein sequences? I very much doubt that...

You need to make your tree, before you pass it to ggplot. It will not construct the tree for you, only draw it.

ADD REPLY
0
Entering edit mode

Post few records from sequences file

ADD REPLY
0
Entering edit mode

My problem is solved. The command that I have followed is given below.

> ggtree(tree1, layout = "rectangular") + geom_text2(data=d, aes(subset=!isTip, label=label, color="isTip"), hjust=1) + geom_tiplab(size=3, aes(angle=0)) + scale_color_manual(values=c("red", "firebrick")) + geom_hilight(22, "brown") + geom_hilight(20, fill = "steelblue") + geom_hilight(25, fill="darkgreen") + geom_hilight(32, fill="pink") + geom_hilight(30, fill="grey") + geom_hilight(31, fill="purple") + geom_hilight(29, fill="lightblue") + ggtitle("Protein Sequences correlation")
ADD REPLY

Login before adding your answer.

Traffic: 2565 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6