-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The option `--merge none` is expected to create no new multiallelic sites, but it should allow to merge, say, A>C with A>C,AT Fixes #2333
- Loading branch information
Showing
3 changed files
with
11 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/usr/bin/env perl | ||
# | ||
# Copyright (C) 2012-2024 Genome Research Ltd. | ||
# Copyright (C) 2012-2025 Genome Research Ltd. | ||
# | ||
# Author: Petr Danecek <[email protected]> | ||
# | ||
|
@@ -61,6 +61,8 @@ | |
run_test(\&test_vcf_isec,$opts,in=>['isec-miss.1.1','isec-miss.1.2','isec-miss.1.3'],out=>'isec-miss.1.1.out',args=>'-R {PATH}/isec-miss.1.regs.txt -n +1'); | ||
run_test(\&test_vcf_isec,$opts,in=>['isec-miss.2.1','isec-miss.2.2','isec-miss.2.3'],out=>'isec-miss.2.1.out',args=>'-n +1 -r 20:100,20:140,12:55,20:140,20:100'); | ||
run_test(\&test_vcf_isec,$opts,in=>['isec-miss.2.1','isec-miss.2.2','isec-miss.2.3'],out=>'isec-miss.2.1.out',args=>'-R {PATH}/isec-miss.1.regs.txt -n +1'); | ||
run_test(\&test_vcf_merge,$opts,in=>['merge.12.a','merge.12.b'],out=>'merge.12.1.out',args=>'--merge none'); | ||
run_test(\&test_vcf_merge,$opts,in=>['merge.12.a','merge.12.b'],out=>'merge.12.1.out',args=>'--merge both'); | ||
run_test(\&test_vcf_merge,$opts,in=>['merge.phased.1.a','merge.phased.1.b'],out=>'merge.phased.1.1.out',args=>''); | ||
run_test(\&test_vcf_merge,$opts,in=>['merge.11.a','merge.11.b'],out=>'merge.11.1.out',args=>''); | ||
run_test(\&test_vcf_merge,$opts,in=>['merge.join.a','merge.join.b'],out=>'merge.join.1.out',args=>'-i AF:join'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* vcfmerge.c -- Merge multiple VCF/BCF files to create one multi-sample file. | ||
Copyright (C) 2012-2024 Genome Research Ltd. | ||
Copyright (C) 2012-2025 Genome Research Ltd. | ||
Author: Petr Danecek <[email protected]> | ||
|
@@ -2968,10 +2968,10 @@ static inline int types_compatible(args_t *args, int selected_types, buffer_t *b | |
|
||
// The -m none mode or exact matching requested | ||
// Simple test first: are the variants of the same type? | ||
int x = selected_types >> 1; // remove REF | ||
int y = rec_types >> 1; // remove REF | ||
while ( x && y ) { x>>=1; y>>=1; } | ||
if ( x || y ) return 0; // the types differ | ||
int x = selected_types; | ||
int y = rec_types; | ||
if ( !(x&y) ) return 0; // no matching type | ||
if ( (x&y)!=x && (x&y)!=y ) return 0; // not a subset | ||
|
||
if ( vcmp_set_ref(args->vcmp,maux->als[0],rec->d.allele[0]) < 0 ) return 0; // refs are not compatible | ||
for (k=1; k<rec->n_allele; k++) | ||
|