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

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

# \donttest{ ## 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 )
#> 7 loci added satisfying Mean VAF condition
#> 0 loci added satisfying one read condition
#> 2 loci added satisfying two reads condition
#> 1 loci added satisfying n = 3 reads condition
#> Black list has 7 loci
## 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 )
#> 19 loci added satisfying Mean VAF condition
#> 0 loci added satisfying one read condition
#> 2 loci added satisfying two reads condition
#> Black list has 19 loci
# }