Skip to content

Commit

Permalink
names for the test
Browse files Browse the repository at this point in the history
  • Loading branch information
Zilong-Li committed Mar 26, 2024
1 parent 9f26a5f commit 1dc8504
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions R/vcf-compare.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#'
#' @param flip logical. flip the ref and alt variants
#'
#' @param names character vector. reset samples' names in truth VCF.
#' @param names character vector. reset samples' names in the test VCF.
#'
#' @param bins numeric vector. break statistics into allele frequency bins.
#'
Expand Down Expand Up @@ -71,10 +71,10 @@ vcfcomp <- function(test, truth,
formats[1] <- "GT"
}
d1 <- vcftable(test, format = formats[1], setid = TRUE, ...)
if(!is.null(names) & is.vector(names)) d1$samples <- names
d2 <- tryCatch( { suppressWarnings(readRDS(truth)) }, error = function(e) {
vcftable(truth, format = formats[2], setid = TRUE, ...)
} )
if(!is.null(names) & is.vector(names)) d2$samples <- names
sites <- intersect(d1$id, d2$id)
## chr pos ref alt af
if(!is.null(af)){
Expand Down
2 changes: 1 addition & 1 deletion man/vcfcomp.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1dc8504

Please sign in to comment.