From 702488b6b98156998e07b34b49cfb3585d14e370 Mon Sep 17 00:00:00 2001 From: Xiuwen Zheng Date: Sat, 22 Jun 2024 03:32:33 -0500 Subject: [PATCH] bug in seqMerge() --- DESCRIPTION | 4 ++-- NEWS | 9 +++++++++ R/UtilsMerge.R | 8 ++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 64f9103..ff85c2e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: SeqArray Type: Package Title: Data Management of Large-Scale Whole-Genome Sequence Variant Calls -Version: 1.44.0 -Date: 2024-04-27 +Version: 1.44.1 +Date: 2024-06-22 Depends: R (>= 3.5.0), gdsfmt (>= 1.31.1) Imports: methods, parallel, IRanges, GenomicRanges, GenomeInfoDb, Biostrings, S4Vectors diff --git a/NEWS b/NEWS index cb6458e..11dd197 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,12 @@ +CHANGES IN VERSION 1.44.1 +------------------------- + +BUG FIXES + + o `seqMerge()` should internally use "chr_position_ref_alt" to distinguish + the variants in different files + + CHANGES IN VERSION 1.44.0 ------------------------- diff --git a/R/UtilsMerge.R b/R/UtilsMerge.R index 6c20942..c659b9a 100644 --- a/R/UtilsMerge.R +++ b/R/UtilsMerge.R @@ -36,7 +36,7 @@ .append_gds(n, flist, varnm, verbose) .DigestCode(n, digest, verbose) if (nVariant != objdesp.gdsn(n)$dim) - stop(sprintf("Invalid number of variants in '%s'.", varnm)) + warning(sprintf("Invalid number of variants in '%s'.", varnm), immediate.=TRUE) n } @@ -319,7 +319,7 @@ seqMerge <- function(gds.fn, out.fn, storage.option="LZMA_RA", nVariant <- nVariant + objdesp.gdsn(index.gdsn(f, "variant.id"))$dim } } else { - variant.id <- variant2.id <- seqGetData(flist[[1L]], "$chrom_pos2") + variant.id <- variant2.id <- seqGetData(flist[[1L]], "$chrom_pos_allele") if (verbose) { cat(sprintf(" [%-2d] %s (%s variant%s)\n", 1L, basename(gds.fn[1L]), @@ -327,7 +327,7 @@ seqMerge <- function(gds.fn, out.fn, storage.option="LZMA_RA", } for (i in seq_along(flist)[-1L]) { - s <- seqGetData(flist[[i]], "$chrom_pos2") + s <- seqGetData(flist[[i]], "$chrom_pos_allele") if (verbose) { cat(sprintf(" [%-2d] %s (%s variant%s)\n", i, @@ -366,7 +366,7 @@ seqMerge <- function(gds.fn, out.fn, storage.option="LZMA_RA", varidx <- vector("list", length(flist)) for (i in seq_along(flist)) { - varidx[[i]] <- match(seqGetData(flist[[i]], "$chrom_pos2"), + varidx[[i]] <- match(seqGetData(flist[[i]], "$chrom_pos_allele"), variant.id) if (is.unsorted(varidx[[i]], strictly=TRUE)) stop("File ", i, ": chromosomes and positions are unsorted.")