ggmsa icon indicating copy to clipboard operation
ggmsa copied to clipboard

Sorry,But I ggmsa picture is grey!

Open shaodongyan opened this issue 4 years ago • 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

shaodongyan avatar Dec 22 '20 07:12 shaodongyan

I used border="white"

shaodongyan avatar Dec 22 '20 07:12 shaodongyan

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

nyzhoulang avatar Dec 22 '20 07:12 nyzhoulang

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.

shaodongyan avatar Dec 22 '20 07:12 shaodongyan

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

shaodongyan avatar Dec 22 '20 07:12 shaodongyan

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

nyzhoulang avatar Dec 22 '20 07:12 nyzhoulang

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

shaodongyan avatar Dec 22 '20 07:12 shaodongyan

另一个解决方案是使用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?

shaodongyan avatar Dec 22 '20 07:12 shaodongyan

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

nyzhoulang avatar Dec 22 '20 07:12 nyzhoulang

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.

nyzhoulang avatar Dec 22 '20 07:12 nyzhoulang

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

shaodongyan avatar Dec 22 '20 08:12 shaodongyan

Can you show your code?

nyzhoulang avatar Dec 22 '20 08:12 nyzhoulang

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)

shaodongyan avatar Dec 22 '20 08:12 shaodongyan

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.

nyzhoulang avatar Dec 22 '20 08:12 nyzhoulang

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!

shaodongyan avatar Dec 22 '20 11:12 shaodongyan

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.

GuangchuangYu avatar Dec 23 '20 00:12 GuangchuangYu

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)

nyzhoulang avatar Dec 24 '20 04:12 nyzhoulang

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.

nyzhoulang avatar Dec 24 '20 04:12 nyzhoulang