R/create_black_list.R
create_black_list.Rd
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)
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 | the number of reads to use in the |
a character vector of the loci in the black list
create_background_panel
test_ctDNA
# \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 )#>#>#>#>#>## 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 )#>#>#>#># }