Comments (4)
This works for me. If you mean something else, please provide an example.
g0 <- tibble(seq_id="a", start=10, end=500, gene="foo")
gggenomes(g0) +
geom_gene(aes(fill=gene)) +
geom_gene_label(aes(label=gene, color=gene), fontface="italic", show.legend=FALSE)
from gggenomes.
Yes, that worked! Thank you so much! Now encountering a different problem though. Some of the genes are pseudogenes so I use greek psi symbol to label them. Before color and fontface, plot was showing psi symbol but now it shows some strange character instead of psi. I tried a couple of online solutions to convert encoding into UTF-8 but no success yet. Please let me know if you have a solution that can work. Here is a screenshot of the table that I read in R:
from gggenomes.
Hm, strange. I cannot reproduce this on my system, see below.
# thought this would work with `parse=T` but got no character for psi at all
g0 <- tibble(
seq_id="a", start=c(10, 600), end=c(500, 1000),
# this seems to work just fine
gene=c("foo", "ψ"),
# thought this would work with `parse=T`
# but got no character for psi at all
gene_parse=c("foo", "psi"),
# unicode seems to work as well
gene_unicode=gsub("ψ", "\u03C8", gene)
)
gggenomes(g0) +
geom_gene(aes(fill=gene)) +
# psi and italic
geom_gene_label(aes(label=gene, color=gene),
fontface="italic", show.legend=F, nudge_x=-100) +
# no psi, and not italic
geom_gene_label(aes(label=gene_parse, color=gene),
fontface="italic", show.legend=F, parse=T) +
# psi and italic
geom_gene_label(aes(label=gene_unicode, color=gene),
fontface="italic", show.legend=F, nudge_x=100)
from gggenomes.
Thank you for trying this! Your solution works for me but only when I write a tibble. In my case, I have to read a table. I found out that if I save the file with .txt, and read with read.delim(), then psi is labeled as a greek letter on the plot. Other extensions like .tsv, .csv, .xlsx don't work!
from gggenomes.
Related Issues (20)
- how to remove link borders? HOT 2
- Error in Installation HOT 4
- read_seqs() function not working for me HOT 8
- Unused parameter in drop_feat_layout HOT 2
- Operon boxes HOT 2
- Different genome scales 2
- Show y-axis for geom_wiggle() and offset geom_feat() HOT 1
- ggsave throws error in example code HOT 8
- Gff not recognized HOT 6
- Error in eval(`_inherit`, env, NULL): object 'Guides' not found. HOT 1
- Error in guides$setup(scales, aesthetics, default = params$guide_default %||% : attempt to apply non-function HOT 1
- unexpected error on example data HOT 1
- Incorrect labels for scale with large sequences HOT 1
- read_feats error HOT 4
- Multiple coverage tracks supported? HOT 4
- How can I change the distance (spacer) between different seqs? HOT 2
- Calculate coordinates from gff file with genes in different directions HOT 1
- Error when loading emales.fna with https://github.com/thackl/gggenomes/blob/HEAD/vignettes/emales.Rmd HOT 1
- Generate blast links with NCBI blast, easy to use row.names() HOT 1
- Changing start site of seq track and keeping layout. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gggenomes.