readGenomeDist: Genomic feature distribution of aligned reads

View source: R/read_dist.R

readGenomeDistR Documentation

Genomic feature distribution of aligned reads

Description

Genomic feature distribution of aligned reads. Reads are assigned to a feature based on the following priority: CDS, UTR, Intron, and Intergenic.

Usage

readGenomeDist(
  bam,
  txdb,
  category = c("CDS", "UTR", "Intron", "Intergenic"),
  fiveEndOnly = TRUE,
  ignoreStrand = TRUE
)

Arguments

bam

A GAlignments or GRanges object of aligned reads. (Required).

txdb

A TxDb object of genome annotation. See GenomicFeatures package for more details. (Required).

category

A vector of characters. By default, distribution of reads on CDS, UTR, intron, and intergenic regions is calculated. Must be selected from c('CDS', 'UTR', 'Intron', 'Intergenic'). (Default: c('CDS', 'UTR', 'Intron', 'Intergenic')).

fiveEndOnly

A logical variable indicating if only keeping the 5'-ends of reads. This option can be used to decrease the ambiguity for reads spanning multiple features. (Default: TRUE).

ignoreStrand

A logical variable indicating if ignoring that reads and features must be on the same strand (Default: TRUE).

Value

A list of two elements. The first is a character vector indicating the genomic feature assigned for each read. The order is the same as the input bam. The second element is a data.frame with 3 columns (feature, count, and pct) of genomic feature, number of reads falling into this feature, and percentage of reads falling into this feature.


nzhang89/RiboSeeker documentation built on April 15, 2022, 10:18 a.m.