Comments (4)
Not 100% sure what you mean, but could this be it https://thackl.github.io/gggenomes/reference/shift.html
from gggenomes.
Thanks Thomas!
Actually, I want to change the start site of the sequences. So, for example that all sequences are starting with the MCP gene you are centring on in your example.
from gggenomes.
Ah, ok, so you sort of want to rotate the annotations. How about something like this:
library(tidyverse)
library(gggenomes)
s1 <- tibble(
seq_id = c("A", "B"),
length = 2000
)
g1 <- tibble(
seq_id = rep(c("A", "B"), each=4),
feat_id = c("a-start", "a2", "a3", "a4", "b3", "b4", "b-start", "b2"),
start = rep(c(100, 600, 1100, 1600), 2),
end = start +300)
Original sequence with B having start in the middle
#| fig.height: 2
#| fig.width: 5
gggenomes(g1, s1) +
geom_seq() +
geom_gene() +
geom_gene_tag(aes(label=feat_id))
B broken up at start gene and first half of genome plotted as individual contig before second half of genome
#| fig.height: 2
#| fig.width: 5
# "zoom" in on parts of sequences and reorganize
# use all of A:0-2000, use B:1000-2000, then B:0:1000
p1 <- gggenomes(g1, s1, spacing = 10) |> # spacing controls the distance between contigs of same genome
focus(.loci = tibble(
seq_id = c("A", "B", "B"),
start = c(0, 1000, 0),
end = c(2000, 2000, 1000)))
p1 +
geom_seq() +
geom_gene() +
geom_gene_tag(aes(label=feat_id))
I chose the breakpoint here (.loci
tibble) manually, but I think it could also be computed easily from your start gene locations...
from gggenomes.
This works. Thanks again Thomas!
from gggenomes.
Related Issues (20)
- 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
- markdown expressions in geom_gene_text HOT 1
- Combination plots with ggtree possible? HOT 1
- Two tibble gff3 files appear empty when loading in. HOT 3
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.