create_black_list: Creates a black list of genomic loci based on a background...

Description Usage Arguments Value See Also Examples

View source: R/create_black_list.R

Description

The function applies criteria on the background panel to extract the noisy genomic loci. Criteria include minimum number of samples having at least one, at least two, or at least n (n_reads parameter) non-reference allele. Additionally the quantile of mean VAF above which the loci are considered noisy

Usage

1
2
3
4
5
create_black_list(background_panel, mean_vaf_quantile = 0.95,
  min_samples_one_read = max(2, ceiling(ncol(background_panel$vaf) *
  0.75)), min_samples_two_reads = max(2,
  ceiling(ncol(background_panel$vaf) * 0.2)), min_samples_n_reads = NA,
  n_reads = NA)

Arguments

background_panel

A list produced by create_background panel function

mean_vaf_quantile

The quantile of mean VAF above which the loci are considered noisy. Use NA to skip this criterion.

min_samples_one_read

Loci that at least this number of samples exhibit at least one non-reference reads are considered noisy. Use NA to skip this criterion.

min_samples_two_reads

Loci that at least this number of samples exhibit at least two non-reference reads are considered noisy. Use NA to skip this criterion.

min_samples_n_reads

Loci that at least this number of samples exhibit at least n non-reference reads (n_reads parameter) are considered noisy. Use NA to skip this criterion.

n_reads

the number of reads to use in the min_samples_n_reads parameter

Value

a character vector of the loci in the black list

See Also

create_background_panel test_ctDNA

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
## Load example data
data("targets", package = "ctDNAtools")
bamN1 <- system.file("extdata", "N1.bam", package = "ctDNAtools")
bamN2 <- system.file("extdata", "N2.bam", package = "ctDNAtools")
bamN3 <- system.file("extdata", "N3.bam", package = "ctDNAtools")

## Use human reference genome from BSgenome.Hsapiens.UCSC.hg19 library
suppressMessages(library(BSgenome.Hsapiens.UCSC.hg19))

## Use a black list based on loci
bg_panel <- create_background_panel(
  bam_list = c(bamN1, bamN2, bamN3),
  targets = targets, reference = BSgenome.Hsapiens.UCSC.hg19,
  substitution_specific = FALSE
)

bl1 <- create_black_list(bg_panel,
  mean_vaf_quantile = 0.99,
  min_samples_one_read = 2, min_samples_two_reads = 1,
  min_samples_n_reads = 1, n_reads = 3
)

## Use a substitution-specific black list
bg_panel <- create_background_panel(
  bam_list = c(bamN1, bamN2, bamN3),
  targets = targets, reference = BSgenome.Hsapiens.UCSC.hg19,
  substitution_specific = TRUE
)

bl2 <- create_black_list(bg_panel,
  mean_vaf_quantile = 0.99,
  min_samples_one_read = 2, min_samples_two_reads = 1,
  min_samples_n_read = NA
)

ctDNAtools documentation built on March 26, 2020, 7:39 p.m.