blacklist: Make a blacklist for genomic regions

Description Usage Arguments Value Examples

View source: R/blacklist.R

Description

Produce a blacklist of genomic regions with a high ratio of duplicate to unique reads. This blacklist can be used to exclude reads for analysis in Aneufinder, bam2GRanges and bed2GRanges. This function produces a pre-blacklist which has to manually be filtered with a sensible cutoff. See the examples section for details.

Usage

1
blacklist(files, assembly, bins, min.mapq = 10, pairedEndReads = FALSE)

Arguments

files

A character vector of either BAM or BED files.

assembly

Please see fetchExtendedChromInfoFromUCSC for available assemblies. Only necessary when importing BED files. BAM files are handled automatically. Alternatively a data.frame with columns 'chromosome' and 'length'.

bins

A list with one GRanges with binned read counts generated by fixedWidthBins.

min.mapq

Minimum mapping quality when importing from BAM files. Set min.mapq=NULL to keep all reads.

pairedEndReads

Set to TRUE if you have paired-end reads in your BAM files (not implemented for BED files).

Value

A GRanges with the same coordinates as bins with metadata columns ratio, duplicated counts and deduplicated counts.

Examples

1
2
3
4
5
6
7
8
9
## Get an example BAM file with single-cell-sequencing reads
bamfile <- system.file("extdata", "BB150803_IV_074.bam", package="AneuFinderData")
## Prepare the blacklist
bins <- fixedWidthBins(assembly='mm10', binsizes=1e6, chromosome.format='NCBI')
pre.blacklist <- blacklist(bamfile, bins=bins)
## Plot a histogram to decide on a sensible cutoff
qplot(pre.blacklist$ratio, binwidth=0.1)
## Make the blacklist with cutoff = 1.9
blacklist <- pre.blacklist[pre.blacklist$ratio > 1.9]

AneuFinder documentation built on May 31, 2017, 10:55 a.m.

Search within the AneuFinder package
Search all R packages, documentation and source code