Question: Calculating Gene Densities From Rnaseq Data
gravatar for Ahmetz
8.8 years ago by
New york, NY
Ahmetz60 wrote:


Newbie here. I am interested plotting gene densities from my RNAseq data. I have a file with chromosome locations and read numbers for each gene. I want to plot each chromosome and get a bar graph with each bar indicating the number of genes present in 1MB bins. I guess I can count the number of genes in each 1MB region but I feel like there might be an R package out there that I'm not aware of. I'm planing to use qplot for the plotting. Any suggestions?

Thanks a lot!

Ahmet Z.

rna visualization • 5.2k views
ADD COMMENTlink modified 17 months ago by erdiazval40 • written 8.8 years ago by Ahmetz60
gravatar for Michael Dondrup
8.8 years ago by
Bergen, Norway
Michael Dondrup47k wrote:

IRanges can compute the coverage given a set of intervals. That works for aligned RNA seq reads as for the gene bins itself. But what does RNAseq have to do with gene-density? Probably you meant something else?

for gene-density calculation in a 1MB window:

  1. use the successiveIRanges function to create bins of the desires size.
  2. Load the gene regions from a file, e.g with the rtracklayer package
  3. use the function countOverlaps to count the number of genes in each bin

Can't give you more specific help unless you describe exactly what you want to do.

ADD COMMENTlink written 8.8 years ago by Michael Dondrup47k

Thanks for the info, I'll check out IRanges. I want to do a similar plot to Fig2 of this paper: Each chromosome is plotted with expressed gene densities and RNAseq would give you that information as to whether a gene is present or not. Would this help, in terms of specificity?

ADD REPLYlink written 8.8 years ago by Ahmetz60

Hello, I tried to follow your suggestion for calculating gene density but I could not figure out how the successiveIRanges can be used for creating bins for all chromosomes, can you please elaborate your example?

ADD REPLYlink written 6.9 years ago by Saima10
gravatar for Neilfws
8.8 years ago by
Sydney, Australia
Neilfws48k wrote:

A useful R package for plotting quantitative data in genomic context is GenomeGraphs (publication). It may be useful for your task if you can get the data into an appropriate form.

ADD COMMENTlink written 8.8 years ago by Neilfws48k

nice package! Thank you!

ADD REPLYlink written 8.8 years ago by Nibua60
gravatar for erdiazval
17 months ago by
erdiazval40 wrote:

I've been working on a similar approach to intersect gene density with cis-variants.

1) get .bam files (GATK's pipeline for SNP calling) and convert them to BED format with bedtools 2) create a genome.bed like-file (chr, length fields) and split it into 1MB chunks with bedtools 3) calculate coverage with the genomecov tool of bedtools 4) estimate genome coverage by 1MB steps for each chromosome with the bedmap tool of bedops (intersect the intervals in the *chunks.bed file against the coverage-per-position field in the coverage.bed file 5) plot this data in a circos plot!

Good luck

ADD COMMENTlink written 17 months ago by erdiazval40
Please log in to add an answer.


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