countReads-methods: countReads

Description Usage Arguments Details Value Usage Examples

Description

Count reads overlap different genomic features, such as gene, transciripts, exons, promoter regions (1kb upstream and downstream of tss), or any genomic ranges of interest. It will count how many reads is mapped to each genomic feature.

Usage

1
2
countReads(obj,annotationFile,countingMode,interFeature,feature)
  countReads(bamFile,annotationFile,countingMode,feature)

Arguments

obj

A SeqData object.

annotationFile

Optional full path to annotation file.

countingMode

Including "Union","IntersectionStrict","IntersectionNotEmpty". See summarizeOverlaps from GenomicRanges package for details.

interFeature

This parameter is accompanying countingMode. It is to decide, when multiple features overlap, and reads are mapped to that overlap regions, whether these reads should be removed using the countingMode. Default is TRUE, meaning using the countingMode to aovoid count a single reads more than once. If it is set to FALSE, read are counted to each feature they mapped to, which means they are allowed to count multiple times.

feature

Genomic features including "exon","transcript","gene","erv","tss","5LTR" (# feature=c("exon","transcript","gene","erv","tss","5LTR"))

description

Optional. User can input short desciption for the output file, it will show up in the file name of the output file.

Details

This function answers how to assign reads to features that are overlapped. The advantage of this function is it does not count a read twice, and it take duplicated gene into count.The back end is the function summarizeOverlaps from GenomicRanges package.

Value

A countTable includes feature name, read count and its rpkm normalization value.

Usage

countReads(obj=NULL,bamFile=character(0),annotationFile=character(0), countingMode="Union",interFeature=TRUE,feature=c("exon","transcript","gene","erv","repeats","transposon","tss","5LTR"))

Examples

1
2
3
4
5
6
7
8
#countReads(obj)  #readAlignment and featureAnnotation slots non-empty
                  #user can pass in GAlignments(readAlignment slot) and
                  #GRanges(featureAnnotation slot) to countReads() via obj

#countReads(obj,feature="gene")    #readAlignment slot non-empty
#countReads(obj,annotationFile=annotationFile)   #readAlignment slot non-empty
#countReads(bamFile=bamFile,annotationFile=annotationFile)
#countReads(bamFile=bamFile,feature="gene")

sheng-liu/SeqData documentation built on May 29, 2019, 9:22 p.m.