read.degradation.matrix: A function for reading in coverage data from...

Description Usage Arguments Value Examples

View source: R/read.degradation.matrix.R

Description

This function reads in degradation regions to form a library-size- and read-length-normalized degradation matrix for subsequent RNA quality correction

Usage

1
2
3
4
5
6
7
8
9
read.degradation.matrix(
  covFiles,
  sampleNames,
  totalMapped,
  readLength = 100,
  normFactor = 8e+07,
  type = c("bwtool", "region_matrix_single", "region_matrix_all"),
  BPPARAM = bpparam()
)

Arguments

covFiles

coverage file(s) for degradation regions

sampleNames

sample names; creates column names of degradation matrix

totalMapped

how many reads per sample (library size normalization)

readLength

read length in base pairs (read length normalization)

normFactor

common library size to normalize to; 80M reads as default

type

whether input are individual 'bwtool' output, 'region_matrix' run on individual samples, or 'region_matrix' run on all samples together

BPPARAM

(Optional) BiocParallelParam for parallel operation

Value

the normalized degradation matrix, region by sample

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# bwtool
bwPath = system.file('extdata', 'bwtool', package = 'sva')
degCovAdj = read.degradation.matrix(
 covFiles = list.files(bwPath,full.names=TRUE),
 sampleNames = list.files(bwPath), readLength = 76, 
 totalMapped = rep(100e6,5),type="bwtool")
 head(degCovAdj)
 
# region_matrix: each sample
r1Path = system.file('extdata', 'region_matrix_one', package = 'sva')
degCovAdj1 = read.degradation.matrix(
 covFiles = list.files(r1Path,full.names=TRUE),
 sampleNames = list.files(r1Path), readLength = 76, 
 totalMapped = rep(100e6,5),type="region_matrix_single")
 head(degCovAdj1)
 
r2Path = system.file('extdata', 'region_matrix_all', package = 'sva')
degCovAdj2 = read.degradation.matrix(
 covFiles = list.files(r2Path,full.names=TRUE),
 sampleNames = list.files(r1Path), readLength = 76, 
 totalMapped = rep(100e6,5),type="region_matrix_all")
head(degCovAdj2)

sva documentation built on Nov. 8, 2020, 8:16 p.m.