We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0fd71b7 commit 7aff72bCopy full SHA for 7aff72b
R/combine-vcf-with-pgs.R
@@ -116,6 +116,9 @@ combine.vcf.with.pgs <- function(vcf.data, pgs.weight.data) {
116
fixed = TRUE
117
);
118
119
+ # remove duplicate IDs
120
+ split.rows <- lapply(split.rows, function(x) unique(x));
121
+
122
row.indices <- rep(
123
x = seq_len(nrow(vcf.data)),
124
times = lengths(split.rows)
tests/testthat/test-vcf-pgs-merge.R
@@ -294,7 +294,7 @@ test_that(
294
test.vcf.data.missing.locus.matching.rsid.with.semicolons <- data.frame(
295
CHROM = c('chr1', 'chr3', 'chr2', 'chr4'),
296
POS = c(1, 3, 3, 6),
297
- ID = c('rs1;rsA', 'rs3', 'rs2;rsB', 'rs5;rsC'),
+ ID = c('rs1;rs1', 'rs3', 'rs2;rsB', 'rs5;rsC'),
298
REF = c('A', 'T', 'C', 'G'),
299
ALT = c('T', 'A', 'G', 'C'),
300
Indiv = c('sample1', 'sample2', 'sample3', 'sample4'),
@@ -486,7 +486,7 @@ test_that(
486
487
expect_equal(
488
test.combine.vcf.with.pgs.missing.locus.matching.rsid.with.semicolons$merged.vcf.with.pgs.data$ID.vcf,
489
- c('rs1;rsA', 'rs3', 'rs2;rsB', NA)
+ c('rs1;rs1', 'rs3', 'rs2;rsB', NA)
490
491
492
0 commit comments