Giter Site home page Giter Site logo

Gene Orientation not correct about gggenes HOT 1 CLOSED

xyz0o avatar xyz0o commented on August 10, 2024
Gene Orientation not correct

from gggenes.

Comments (1)

wilkox avatar wilkox commented on August 10, 2024

Because -1 coerces to the logical value TRUE, setting orientation as -1 is the same as setting forward = TRUE. If you replace it with 0, you should get the expected result:

library(tidyverse)
library(gggenes)

dfg <- tribble(
  ~gene, ~element, ~start, ~end, ~strand, ~orientation,
  "Ltn1",   "stop_codon",   16353834,   16353837,   "reverse",  0,
  "Ltn1",   "exon", 16353837,   16353954,   "reverse",  0,
  "Ltn1",   "intron",   16353954,   16354032,   "reverse",  0,
  "Ltn1",   "exon", 16354032,   16354473,   "reverse",  0,
  "Ltn1",   "intron",   16354473,   16354532,   "reverse",  0,
  "Ltn1",   "exon", 16354532,   16354808,   "reverse",  0,
  "Ltn1",   "intron",   16354808,   16354878,   "reverse",  0,
  "Ltn1",   "exon", 16354878,   16355062,   "reverse",  0,
  "Ltn1",   "intron",   16355062,   16355118,   "reverse",  0,
  "Ltn1",   "exon", 16355118,   16355351,   "reverse",  0,
  "Ltn1",   "intron",   16355351,   16355406,   "reverse",  0,
  "Ltn1",   "exon", 16355406,   16356726,   "reverse",  0,
  "Ltn1",   "intron",   16356726,   16357235,   "reverse",  0,
  "Ltn1",   "exon", 16357235,   16358277,   "reverse",  0,
  "Ltn1",   "intron",   16358277,   16358363,   "reverse",  0,
  "Ltn1",   "exon", 16358363,   16358543,   "reverse",  0,
  "Ltn1",   "intron",   16358543,   16358602,   "reverse",  0,
  "Ltn1",   "exon", 16358602,   16359381,   "reverse",  0,
  "Ltn1",   "intron",   16359381,   16359443,   "reverse",  0,
  "Ltn1",   "exon", 16359443,   16359491,   "reverse",  0,
  "Ltn1",   "start_codon",  16359488,   16359491,   "reverse",  0,
  "Ltn1",   "TE",   16353156,   16353284,   "reverse",  0)

ggplot(dfg, aes(xmin = start, xmax = end, y = gene, fill = element, label = element, forward = orientation)) +
  geom_gene_arrow() +
  facet_wrap(~ gene, scales = "free", ncol = 1) +
  scale_fill_brewer(palette = "Set3") +
  geom_blank(data = dfg, aes(forward = 1)) +
  theme_genes()

Created on 2023-11-14 with reprex v2.0.2

from gggenes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.