Genome Diagram in R
1
0
Entering edit mode
6.2 years ago
lokraj2003 ▴ 120

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 • 4.0k views
ADD COMMENT
1
Entering edit mode

Look at genPlotR, Sushi or karyoplotteR.

ADD REPLY
0
Entering edit mode

Thank you. I will check them.

ADD REPLY
4
Entering edit mode
6.2 years ago
h.mon 35k

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 COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

Hey, hello! Just found this thread, I'm a bit late to the party. Am trying to annotate gene clusters that encode for antagonistic compounds in S. xylosus, and have this cute little cluster that I'm trying to represent for my PhD chapter. I'm checking your commands cause I'm kind of struggling with the molecule command and I wonder where in my system I could find the hoarc dataframe with this detailed info. If you still remember about this stuff, please kindly let me know!

ADD REPLY

Login before adding your answer.

Traffic: 1437 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6