Last data update: 2014.03.03

R: Create a CoverageDataSet
coverageDataSetR Documentation

Create a CoverageDataSet

Description

Create a CoverageDataSet containing the depth and breadth of coverage of genes in annotations.

Usage

coverageDataSet(bamfiles, annotations, types, sf = c(1, 1, 1, 1),
  paired_end = TRUE, as_fragments = TRUE)

Arguments

bamfiles

A vector of characters indicating the BAM files paths.

annotations

An object of type annotationsSet containing information on genes.

types

A vector of the same length as bamfiles indicating the type of data in each file. Example: WT vs MUT or untreated vs treated".

sf

A vector of the same length as bamfiles indicating the scaling factor to apply on each file. Each coverage value is multiplied by this factor before being reported. Useful for normalizing coverage by, e.g., reads per million (RPM).

paired_end

logical indicating whether the bamfiles contains paired-end data.

as_fragments

logical indicating if paired-end data must paired and merged to form fragments.

Value

An object of class 'coverageDataSet' containing the coverage for each sample. The details of the output componets are as follow:

data

A data.table with the following components:

chrom

Gene chromosome.

start

Gene transcription start site.

end

Gene transcription termination site.

name

Gene name.

score

Gene score.

strand

Gene strand.

pos

One based positions of the gene.

...

For each sample, report the depth at each position of the gene per sample.

samples

A list containg the samples' names that are in the coverageDataSet.

type1

Type1 samples names (controls)

type2

Type2 samples names (experiment)

Examples

samples <- c("wt_rep1", "wt_rep2", "mut_rep1", "mut_rep2")
bamfiles <- system.file("extdata", paste0(samples, ".bam"),
                              package = "yCrypticRNAs")
data(annotations)
types <- c("wt", "wt", "mut", "mut")
scaling_factors <- c(0.069872847, 0.081113079, 0.088520251, 0.069911116)
rna_seq_signals <- coverageDataSet (bamfiles, annotations, types, scaling_factors)
rna_seq_signals

Results