-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for matching VCF lines by ID
See #1739
- Loading branch information
Showing
12 changed files
with
105 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
##fileformat=VCFv4.2 | ||
##FILTER=<ID=PASS,Description="All filters passed"> | ||
##INFO=<ID=src,Number=1,Type=String,Description=""> | ||
##INFO=<ID=dst,Number=1,Type=String,Description=""> | ||
##contig=<ID=chr1,length=248956422> | ||
#CHROM POS ID REF ALT QUAL FILTER INFO | ||
chr1 902 ID6 N <INS> . PASS src=ID6 | ||
chr1 902 ID5 N <INS> . PASS src=ID5 | ||
chr1 902 ID4 N <INS> . PASS src=ID4 | ||
chr1 902 ID3 N <INS> . PASS src=ID3 | ||
chr1 902 ID2 N <INS> . PASS src=ID2 | ||
chr1 902 ID1 N <INS> . PASS src=ID1 |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
##fileformat=VCFv4.2 | ||
##FILTER=<ID=PASS,Description="All filters passed"> | ||
##INFO=<ID=src,Number=1,Type=String,Description=""> | ||
##INFO=<ID=dst,Number=1,Type=String,Description=""> | ||
##contig=<ID=chr1,length=248956422> | ||
#CHROM POS ID REF ALT QUAL FILTER INFO | ||
chr1 902 ID6 N <INS> . PASS src=ID6;dst=ID6 | ||
chr1 902 ID5 N <INS> . PASS src=ID5;dst=ID5 | ||
chr1 902 ID4 N <INS> . PASS src=ID4;dst=ID4 | ||
chr1 902 ID3 N <INS> . PASS src=ID3;dst=ID3 | ||
chr1 902 ID2 N <INS> . PASS src=ID2;dst=ID2 | ||
chr1 902 ID1 N <INS> . PASS src=ID1;dst=ID1 |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
##fileformat=VCFv4.2 | ||
##INFO=<ID=src,Number=1,Type=String,Description=""> | ||
##INFO=<ID=dst,Number=1,Type=String,Description=""> | ||
##contig=<ID=chr1,length=248956422> | ||
#CHROM POS ID REF ALT QUAL FILTER INFO | ||
chr1 902 ID6 N <INS> . PASS src=ID6 | ||
chr1 902 ID5 N <INS> . PASS src=ID5 | ||
chr1 902 ID4 N <INS> . PASS src=ID4 | ||
chr1 902 ID3 N <INS> . PASS src=ID3 | ||
chr1 902 ID2 N <INS> . PASS src=ID2 | ||
chr1 902 ID1 N <INS> . PASS src=ID1 |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
chr1 902 ID4 N <INS> ID4 | ||
chr1 902 ID2 N <INS> ID2 | ||
chr1 902 ID6 N <INS> ID6 | ||
chr1 902 ID1 N <INS> ID1 | ||
chr1 902 ID3 N <INS> ID3 | ||
chr1 902 ID5 N <INS> ID5 |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
##fileformat=VCFv4.2 | ||
##INFO=<ID=src,Number=1,Type=String,Description=""> | ||
##INFO=<ID=dst,Number=1,Type=String,Description=""> | ||
##contig=<ID=chr1,length=248956422> | ||
#CHROM POS ID REF ALT QUAL FILTER INFO | ||
chr1 902 ID4 N <INS> . PASS src=ID4 | ||
chr1 902 ID2 N <INS> . PASS src=ID2 | ||
chr1 902 ID6 N <INS> . PASS src=ID6 | ||
chr1 902 ID3 N <INS> . PASS src=ID3 | ||
chr1 902 ID1 N <INS> . PASS src=ID1 | ||
chr1 902 ID5 N <INS> . PASS src=ID5 |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
##fileformat=VCFv4.2 | ||
##INFO=<ID=src,Number=1,Type=String,Description=""> | ||
##contig=<ID=chr1,length=248956422> | ||
#CHROM POS ID REF ALT QUAL FILTER INFO | ||
chr1 902 ID1 A C . . . | ||
chr1 902 ID2 A C . . . | ||
chr1 902 ID3 A C . . . |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
##fileformat=VCFv4.2 | ||
##INFO=<ID=src,Number=1,Type=String,Description=""> | ||
##contig=<ID=chr1,length=248956422> | ||
#CHROM POS ID REF ALT QUAL FILTER INFO | ||
chr1 902 ID3 A C . . . | ||
chr1 902 ID2 A C . . . | ||
chr1 902 ID1 A C . . . |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
##fileformat=VCFv4.2 | ||
##FILTER=<ID=PASS,Description="All filters passed"> | ||
##INFO=<ID=src,Number=1,Type=String,Description=""> | ||
##contig=<ID=chr1,length=248956422> | ||
#CHROM POS ID REF ALT QUAL FILTER INFO | ||
chr1 902 ID3 A C . . . | ||
chr1 902 ID2 A C . . . | ||
chr1 902 ID1 A C . . . |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
##fileformat=VCFv4.2 | ||
##FILTER=<ID=PASS,Description="All filters passed"> | ||
##INFO=<ID=src,Number=1,Type=String,Description=""> | ||
##contig=<ID=chr1,length=248956422> | ||
#CHROM POS ID REF ALT QUAL FILTER INFO | ||
chr1 902 ID1 A C . . . | ||
chr1 902 ID2 A C . . . | ||
chr1 902 ID3 A C . . . |
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
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 @@ | ||
/* vcfisec.c -- Create intersections, unions and complements of VCF files. | ||
Copyright (C) 2012-2023 Genome Research Ltd. | ||
Copyright (C) 2012-2024 Genome Research Ltd. | ||
Author: Petr Danecek <[email protected]> | ||
|
@@ -460,7 +460,7 @@ static void destroy_data(args_t *args) | |
{ | ||
if ( !args->fnames[i] ) continue; | ||
if ( hts_close(args->fh_out[i])!=0 ) error("[%s] Error: close failed .. %s\n", __func__,args->fnames[i]); | ||
int is_tbi = !args->write_index | ||
int is_tbi = !args->write_index | ||
|| (args->write_index&127) == HTS_FMT_TBI; | ||
if ( args->output_type==FT_VCF_GZ && is_tbi ) | ||
{ | ||
|
@@ -476,8 +476,8 @@ static void destroy_data(args_t *args) | |
free(args->fh_out); | ||
free(args->fnames); | ||
if ( args->fh_sites ) fclose(args->fh_sites); | ||
if ( args->write ) free(args->write); | ||
} | ||
free(args->write); | ||
} | ||
|
||
static void usage(void) | ||
|
@@ -597,6 +597,7 @@ int main_vcfisec(int argc, char *argv[]) | |
else if ( !strcmp(optarg,"all") ) args->files->collapse |= COLLAPSE_ANY; | ||
else if ( !strcmp(optarg,"some") ) args->files->collapse |= COLLAPSE_SOME; | ||
else if ( !strcmp(optarg,"none") ) args->files->collapse = COLLAPSE_NONE; | ||
else if ( !strcmp(optarg,"id") ) args->files->collapse |= BCF_SR_PAIR_ID; | ||
else error("The --collapse string \"%s\" not recognised.\n", optarg); | ||
break; | ||
case 'f': args->files->apply_filters = optarg; break; | ||
|