read2count {metaseqR2} | R Documentation |
This function is a helper for the metaseqr2
pipeline, for reading SAM/BAM or BED files when a read
counts file is not available. It can also be used
very easily in an autonomous manner.
read2count(targets, annotation, fileType = targets$type, transLevel = "gene", utrOpts = list(frac = 1, minLength = 300, downstream = 50), interFeature = FALSE, rc = NULL)
targets |
a named list, the output of
|
annotation |
a |
fileType |
the type of raw input files. It can be
|
transLevel |
see the |
utrOpts |
a named list with members |
interFeature |
see the |
rc |
the fraction of the available cores to use in a multicore system. |
A data frame with counts for each sample, ready to be
passed to the main metaseqr2
pipeline.
Panagiotis Moulos
dataPath <- system.file("extdata",package="metaseqR2") targets <- data.frame(samplename=c("C","T"), filename=file.path(dataPath,c("C.bam","T.bam")), condition=c("Control","Treatment"), paired=c("single","single"),stranded=c("forward","forward")) path <- tempdir() write.table(targets,file=file.path(path,"targets.txt"), sep="\t",row.names=FALSE,quote=FALSE) geneData <- loadAnnotation("mm9","ensembl","gene") myTargets <- readTargets(file.path(path,"targets.txt")) if (.Platform$OS.type == "unix") { r2c <- read2count(targets=myTargets, fileType=myTargets$type,annotation=geneData) geneCounts <- r2c$counts libsizeList <- r2c$libsize }