Open bickibird opened 2 years ago
Hi, @bickibird
The cause of the issues is that the canvas space is too narrow.
I suggest that renaming the second sequence name ADF454451...H7N6
to H7N6
because the long name will take up more drawing space. And giving more canvas space, see the following examples:
{r fig.asp=0.3, fig.width= 10}
ggmsa("align_fasta.fas",
start = 500,
end = 1060,
char_width = 0.9,
seq_name = TRUE,
color = "Chemistry_NT") +
facet_msa(200)
{r fig.asp=0.5, fig.width= 17}
ggmsa("align_fasta1.fas",
start = 500,
end = 1060,
color = "Chemistry_NT",
seq_name = TRUE,
border = NA) +
facet_msa(100)
Thanks, Lang
Hi Lang,
Thanks so much for your quick reply. I have another question.
I am trying to annotate a specific region of the sequence using a trick you showed me before. However, it doesn't work if on a facet below the first one. Please see examples below:
p <- ggmsa(aa_sequence,
char_width = 0.7,
seq_name = TRUE, consensus_views = TRUE, disagreement = FALSE, use_dot = FALSE, ref = "A_HA_H7",
color = "Chemistry_AA") +
facet_msa(field = 100)
dummy <- subset(p$layers[[1]]$data, facet == 0)
p + geom_rect(data = dummy, mapping = aes(xmin = 32, xmax = 42, ymin = -Inf, ymax = Inf),
color = "black", size = 1.5, fill = NA)
p <- ggmsa(aa_sequence,
char_width = 0.7,
seq_name = TRUE, consensus_views = TRUE, disagreement = FALSE, use_dot = FALSE, ref = "A_HA_H7",
color = "Chemistry_AA") +
facet_msa(field = 100)
dummy <- subset(p$layers[[1]]$data, facet == 0)
p + geom_rect(data = dummy, mapping = aes(xmin = 332, xmax = 342, ymin = -Inf, ymax = Inf),
color = "black", size = 1.5, fill = NA)
Hi @bickibird
dummy <- subset(p$layers[[1]]$data, facet == 0)
The specified facet
is wrong, the region 332-342
is in the fourth row.
Thus, you can replace facet == 3
with facet == 0
(facet start at 0).
Thanks, Lang
Hi, I'm having difficulty visualising a sequence alignment using
facet_msa
. I'm knitting to a Word document. The characters end up being too narrow. The following codes were used:I tried changing char_width to something smaller:
I tried adding
+ coord_cartesian()
but nothing changed.I also tried reducing the field to 100 and the characters end up disappearing:
If I replace
fig.asp
without.width
the following occurs:Any ideas on what's going on and how I can adjust the x axis of the facets so that they are not too narrow?