YuLab-SMU/ggmsa

Sorry,But I ggmsa picture is grey!

Opened this issue · 17 comments

The picture is grey,I show 6000+bp sequence,but it‘s grey . How can I solve them? ggmsa is a excellent R package!
111w.pdf

I used border="white"

Your graphics device is too small, or you specify too much MSA.
Try zooming in on your image, like this:
Before
Now

Your graphics device is too small, or you specify too much MSA.
Try zooming in on your image, like this:
Before
Now

I used ggsave to save it. "width=30,height=30" It's big.

When I open the pdf, at the begining, it's good. after few seconds, it changed grey.

Another solution is to narrow down your MSA with the tidy_msa(start = ,end = )

library(ggtree)
library(ape)
library(Biostrings)
protein_sequences <- system.file("extdata", "sample.fasta", package = "ggmsa")
 x <- readAAStringSet(protein_sequences)
 d <- as.dist(stringDist(x, method = "hamming")/width(x)[1])
 tree <- bionj(d)
 p <- ggtree(tree ) + geom_tiplab() #tree

 data <- tidy_msa(x, start = 100,end = 350)  #msa
 #tree + msa
 p + geom_facet(geom = geom_msa, data = data,
                panel = 'msa', font = NULL,
                color = "Chemistry_AA")  +
   xlim_tree(1)

20201222153311

sorry, but nothing can solve this problem without narrow down my MSA ?

另一个解决方案是使用tidy_msa(start =,end =)缩小您的MSA。

library(ggtree)
library(ape)
library(Biostrings)
protein_sequences <- system.file("extdata", "sample.fasta", package = "ggmsa")
 x <- readAAStringSet(protein_sequences)
 d <- as.dist(stringDist(x, method = "hamming")/width(x)[1])
 tree <- bionj(d)
 p <- ggtree(tree ) + geom_tiplab() #tree

 data <- tidy_msa(x, start = 100,end = 350)  #msa
 #tree + msa
 p + geom_facet(geom = geom_msa, data = data,
                panel = 'msa', font = NULL,
                color = "Chemistry_AA")  +
   xlim_tree(1)

20201222153311

can i let border=false?

Try border = NA, the gray border may affect the image.

This is caused by the insufficient width of the image. When setting border = NA, reduce the height of your image and increase the width appropriately.

Try border = NA, the gray border may affect the image.

border = NA can't make sense. My ggmsa is ggmsa_0.0.5 .
111wa.pdf
It's width is 80, height is 20

Can you show your code?

Can you show your code?

p_tp53 <- ggtree(tree, branch.length = 'none') +geom_tiplab(size=1)
data_53 <- tidy_msa(tp53)
p3<- facet_plot(p_tp53 , panel = 'msa', data =data_53, geom = geom_msa,
font = NULL, color = "Clustal",border=NA)+xlim_tree(0.5)
facet_widths(p3, c(msa=200))
ggsave("111wa.pdf",p3,width = 80,height = 20,limitsize = FALSE)

Thanks, i think the problem lies in the size of the data set. The original intention of ggmsa is not for large data sets.
If your sequence is public, i may try to adjust ggmsa for it. Sorry for failing to solve your problem.

Thanks, i think the problem lies in the size of the data set. The original intention of ggmsa is not for large data sets.
If your sequence is public, i may try to adjust ggmsa for it. Sorry for failing to solve your problem.

Thank you!

The original intention of ggmsa is not for large data sets.

then ggmsa is a bull-shit.


try to think it big and don't "adjust ggmsa for it" everytime.

The solution is here:

image

you need to remove the border line of each cell.

Hi, @shaodongyan:
Visualizing 12K bp of sequences works fine by using your code, like this:
111wa.pdf
It looks like "border = NA" is not working in your local package. Maybe you shuold try reinstall the ggmsa(dev version).

Can you show your code?

p_tp53 <- ggtree(tree, branch.length = 'none') +geom_tiplab(size=1)
data_53 <- tidy_msa(tp53)
p3<- facet_plot(p_tp53 , panel = 'msa', data =data_53, geom = geom_msa,
font = NULL, color = "Clustal",border=NA)+xlim_tree(0.5)
facet_widths(p3, c(msa=200))
ggsave("111wa.pdf",p3,width = 80,height = 20,limitsize = FALSE)

Thanks for your reminding, Professor Yu. We have discussed the "Remove the Broder" proposal before. This reminds me that there may be a situation where the border is not working. I think i have found the problem.

try to think it big and don't "adjust ggmsa for it" everytime. you need to remove the border line of each cell.