count_reads: Count the number of reads falling into genomic bins

View source: R/count_reads.R

count_readsR Documentation

Count the number of reads falling into genomic bins

Description

This function finds the number of reads falling into each bin from a specified set. The aligned reads are read directly from .bam files matching a pattern.

Usage

count_reads(patterns, binlist, minq, binwidth, strand_diff = FALSE)

Arguments

patterns

a character vector indicating patterns which will be used to look ofr .bam files.

binlist

a named list of numeric vectors of breakpoints for the bins that will be used to tally the reads. The names of the list elements should be chromosome names matching the names used in the .bam file, whereas the numeric vectors should start at position 0 and identify the limits of the bins.

minq

an integer or numeric of length 1. The minimum mapping quality for a read to be used for binning.

binwidth

a integer or numeric of length 1. The width of the bins used. This value is not dynamically obtained from the

strand_diff

a logical of length 1 (TRUE or FALSE). If TRUE, reads mapping to the "+" strand are tallied according to their 3'-most position, whereas reads mapping to the "-" strand are tallied according to their 5'-most position. If FALSE, all reads are tallied according to their 5'-most position. This option should be chosen according to the expected mean size of the restriction fragments, so as to maximize the probability that two reads originating from the same restriction fragment but with differing orientation are counted in the same bin.

Value

a data.frame with the first three columns giving the position of the bin and the remaining columns corresponding to the

Examples

NULL

malemay/delgbs documentation built on Feb. 1, 2024, 8:38 a.m.