Question: Genome Diagram in R
0
gravatar for lokraj2003
8 months ago by
lokraj200370
lokraj200370 wrote:

I want to create a genome diagram of a virus. I would like to show the name and position of the genes. I found there is a package called Genome Diagram in Biopython which can do that. But I was not able to use if because of the dependency issues also I am not very good at Python.

Is there any package in R/Bioconductor that would let me create genome or plasmid diagrams if I supply nucleotide position as input ?

R • 528 views
ADD COMMENTlink modified 8 months ago by h.mon25k • written 8 months ago by lokraj200370
1

Look at genPlotR, Sushi or karyoplotteR.

ADD REPLYlink written 8 months ago by h.mon25k

Thank you. I will check them.

ADD REPLYlink written 8 months ago by lokraj200370
3
gravatar for h.mon
8 months ago by
h.mon25k
Brazil
h.mon25k wrote:

An example with a package I just found, gggenes. The data is in a data frame called hoarc:

hoarc
                                  molecule start  end          gene  strand direction
1 Haloarcula hispanica pleomorphic virus 1     1 2352       unknown forward         1
2 Haloarcula hispanica pleomorphic virus 1  2435 2794       unknown forward         1
3 Haloarcula hispanica pleomorphic virus 1  2794 3195           VP3 forward         1
4 Haloarcula hispanica pleomorphic virus 1  2794 3195 VP4 precursor forward         1
5 Haloarcula hispanica pleomorphic virus 1  4805 5356       unknown forward         1
6 Haloarcula hispanica pleomorphic virus 1  5353 6201         gene6 forward         1
7 Haloarcula hispanica pleomorphic virus 1  6348 7340         gene7 forward         1
8 Haloarcula hispanica pleomorphic virus 1  7188 7811         gene8 reverse        -1

To plot:

library(ggplot2)
library(gggenes)
ggplot(subset(hoarc, molecule == "Haloarcula hispanica pleomorphic virus 1"),
       aes(xmin = start, xmax = end, y = molecule, fill = gene, forward = direction)) +
  geom_gene_arrow()

Haloarcula

It is not pretty right now, but with ggplot2 you have plenty of options to customize the plot to your needs.

ADD COMMENTlink modified 8 months ago • written 8 months ago by h.mon25k

Thank you @h.mon. I will play with it. I guess I will be able to modify this according to my need.

ADD REPLYlink written 8 months ago by lokraj200370
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 857 users visited in the last hour