require(gcount)
require(gcount)
knitr::opts_chunk$set(
  comment = "#",
  error = FALSE,
  tidy = FALSE,
  cache = FALSE,
  collapse=TRUE)
# options(datatable.auto.index=FALSE)

We've developed three packages for performing differential analysis of NGS data, namely gread, gcount and ganalyse. In short,

In this vignette, we'll discuss the gcount package.


gcount package

gcount is an R-package that allows to obtain read counts quickly and easily from RNASeq data to be used in downstream analyses.

and allows to count reads that overlap features genes, exons or introns.

Counting reads

We can obtain counts by using get_counts function.

counts = get_counts("sample.bam", "sample.gtf", feature="gene_exon", 
            type="union", library="unstranded", paired=FALSE, 
            multiple_feature_overlaps=FALSE, verbose=FALSE)
head(counts[order(-reads)])

{.bs-callout .bs-callout-info}

See ?get_counts for a more complete description.

Using bam and annotation objects:

get_counts() also accepts objects as inputs (in addition to file names). Let's say you have already loaded "sample.gtf" on to a variable called "gtf". Then we can simply do:

gtf = gread::read_format("sample.gtf")
counts = get_counts("sample.bam", gtf, feature="gene_exon", 
            type="union", library="unstranded", paired=FALSE, 
            multiple_feature_overlaps=FALSE, verbose=FALSE)
head(counts[order(-reads)])

We can also provide bed files (or objects) as input to reads argument of get_counts().




asrinivasan-oa/gcount documentation built on May 12, 2019, 5:37 a.m.