Skip to content

Commit

Permalink
Potential fix for lima1#225.
Browse files Browse the repository at this point in the history
  • Loading branch information
lima1 committed Feb 26, 2022
1 parent a830346 commit 406a3fc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Package: PureCN
Type: Package
Title: Copy number calling and SNV classification using
targeted short read sequencing
Version: 2.1.8
Date: 2022-02-11
Version: 2.1.9
Date: 2022-02-25
Authors@R: c(person("Markus", "Riester",
role = c("aut", "cre"),
email = "[email protected]",
Expand Down
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ BUGFIXES
o Fix for a crash when there are no off-target reads in off-target regions
(#209).
o Fixed parsing of base quality scores in Mutect 2.2
o Fixed crash in GenomicsDB parsing when there were no variants in contig
(#225)


Changes in version 2.0.0
Expand Down
2 changes: 2 additions & 0 deletions R/calculateMappingBiasVcf.R
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ calculateMappingBiasGatk4 <- function(workspace, reference.genome,
genomicsdb::disconnect(db)
flog.info("Collecting variant information...")
# concat with minimal memory overhead
parsed_ad_list <- parsed_ad_list[!sapply(parsed_ad_list, is.null)]
m_alt <- as.matrix(rbindlist(lapply(parsed_ad_list, function(x) data.frame(x$alt)), fill = TRUE))
for (i in seq_along(parsed_ad_list)) parsed_ad_list[[i]]$alt <- NULL
m_ref <- as.matrix(rbindlist(lapply(parsed_ad_list, function(x) data.frame(x$ref)), fill = TRUE))
Expand All @@ -214,6 +215,7 @@ calculateMappingBiasGatk4 <- function(workspace, reference.genome,
}

.parseADGenomicsDb <- function(query, AF.info.field = "AF") {
if (!nrow(query)) return(NULL)
ref <- dcast(query, CHROM + POS + END + REF + ALT ~ SAMPLE, value.var = "AD")
af <- dcast(query, CHROM + POS + END + REF + ALT ~ SAMPLE, value.var = AF.info.field)
gr <- GRanges(seqnames = ref$CHROM, IRanges(start = ref$POS, end = ref$END),
Expand Down

0 comments on commit 406a3fc

Please sign in to comment.