Skip to content

Commit

Permalink
bug in seqMerge()
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengxwen committed Jun 22, 2024
1 parent 661eb0a commit 702488b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 9 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -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
-------------------------

Expand Down
8 changes: 4 additions & 4 deletions R/UtilsMerge.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -319,15 +319,15 @@ 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]),
.pretty(length(variant.id)), .plural(length(variant.id))))
}
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,
Expand Down Expand Up @@ -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.")
Expand Down

0 comments on commit 702488b

Please sign in to comment.