Skip to content

Commit

Permalink
Merge pull request #333 from lima1/issue_296
Browse files Browse the repository at this point in the history
Attempt in making current developer version of GenomicsDB-R work.
  • Loading branch information
lima1 authored Nov 20, 2023
2 parents a0abe54 + b8d2bc4 commit 5e8b665
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions R/calculateMappingBiasVcf.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,19 @@ calculateMappingBiasGatk4 <- function(workspace, reference.genome,
.stopUserError("Install the genomicsdb and jsonlite R packages for GenomicsDB import.")
}
workspace <- normalizePath(workspace, mustWork = TRUE)

db <- genomicsdb::connect(workspace = workspace,
vid_mapping_file = file.path(workspace, "vidmap.json"),
callset_mapping_file = file.path(workspace, "callset.json"),
reference_genome = reference.genome,
c("DP", "AD", AF.info.field))


if (!is.null(formals(genomicsdb::connect)$reference_genome)) {
db <- genomicsdb::connect(workspace = workspace,
vid_mapping_file = file.path(workspace, "vidmap.json"),
callset_mapping_file = file.path(workspace, "callset.json"),
reference_genome = reference.genome,
attributes = c("DP", "AD", AF.info.field))
} else {
db <- genomicsdb::connect(workspace = workspace,
vid_mapping_file = file.path(workspace, "vidmap.json"),
callset_mapping_file = file.path(workspace, "callset.json"),
attributes = c("DP", "AD", AF.info.field))
}
jcallset <- jsonlite::read_json(file.path(workspace, "callset.json"))
jvidmap <- jsonlite::read_json(file.path(workspace, "vidmap.json"))

Expand Down

0 comments on commit 5e8b665

Please sign in to comment.