loadSTARCounts: Load STAR aligner gene count output

Description Usage Arguments Details Value Examples

Description

This function assumes that STAR aligner has been run with the --quantMode GeneCounts option. It simply reads in the data files, one-per-sample, into a matrix with rownames corresponding to the gene names in the STAR output and column names that are the file names passed to the function as the first parameter.

Usage

1
loadSTARCounts(fnames, quant = c("unstranded", "FRaligned", "SRaligned"))

Arguments

fnames

The file names for each of the .tab files from STAR.

quant

Which column from the STAR output to use. See details section for more information.

Details

The choice of quant is based on how STAR interprets the reads relative to strandedness of the protocol used to produce the data. In particular, unstranded is used for an unstranded protocol, FRaligned is for when the first read is in the same direction as the strand of the mRNA, and SRaligned is for when the second read is in the same direction as the strand of the mRNA.

Value

A matrix of counts, with genes from the STAR output on the rownames and file names on the columns.

Examples

1
2
3
4
5
6
7
fnames = dir(system.file(package='SeansStuff','extdata'),full.names=TRUE)
mat = loadSTARCounts(fnames)
dim(mat)
head(mat)
# clean up column names
colnames(mat) = basename(colnames(mat))
head(mat)

seandavi/SeansStuff documentation built on May 29, 2019, 4:35 p.m.