Skip to content

Commit

Permalink
convert: fix logic bug in gvcf2vcf
Browse files Browse the repository at this point in the history
  • Loading branch information
mcshane committed Jul 8, 2017
1 parent f0ec4a3 commit 9a1f6b2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/convert.gvcf.out
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
22 83 . A . 0 PASS BLOCKAVG_min30p3a GT:GQX:DP:DPF 0/0:54:19:0
22 84 . C . 0 PASS BLOCKAVG_min30p3a GT:GQX:DP:DPF 0/0:54:19:0
22 85 . G . 0 PASS BLOCKAVG_min30p3a GT:GQX:DP:DPF 0/0:54:19:0
22 86 . G C 23 LowGQX SNVSB=0;SNVHPOL=2 GT:GQ:GQX:DP:DPF:AD 0/1:56:23:22:0:16,6
22 86 . G C 23 PASS SNVSB=0;SNVHPOL=2 GT:GQ:GQX:DP:DPF:AD 0/1:56:23:22:0:16,6
22 87 . T . 0 PASS BLOCKAVG_min30p3a GT:GQX:DP:DPF 0/0:69:24:0
22 88 . C . 0 PASS BLOCKAVG_min30p3a GT:GQX:DP:DPF 0/0:69:24:0
22 89 . A . 0 PASS BLOCKAVG_min30p3a GT:GQX:DP:DPF 0/0:69:24:0
Expand Down
2 changes: 1 addition & 1 deletion test/convert.gvcf.vcf
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
22 51 . C . 0 PASS END=55;BLOCKAVG_min30p3a GT:GQX:DP:DPF 0/0:30:11:0
22 56 . G . 0 PASS END=72;BLOCKAVG_min30p3a GT:GQX:DP:DPF 0/0:42:15:0
22 73 . T . 0 PASS END=85;BLOCKAVG_min30p3a GT:GQX:DP:DPF 0/0:54:19:0
22 86 . G C 23 LowGQX SNVSB=0;SNVHPOL=2 GT:GQ:GQX:DP:DPF:AD 0/1:56:23:22:0:16,6
22 86 . G C 23 PASS SNVSB=0;SNVHPOL=2 GT:GQ:GQX:DP:DPF:AD 0/1:56:23:22:0:16,6
22 87 . T . 0 PASS END=101;BLOCKAVG_min30p3a GT:GQX:DP:DPF 0/0:69:24:0
22 102 . A . 0 PASS END=140;BLOCKAVG_min30p3a GT:GQX:DP:DPF 0/0:84:29:0
22 141 . G . 0 PASS END=185;BLOCKAVG_min30p3a GT:GQX:DP:DPF 0/0:90:31:0
Expand Down
5 changes: 3 additions & 2 deletions vcfconvert.c
Original file line number Diff line number Diff line change
Expand Up @@ -1316,12 +1316,13 @@ static void gvcf_to_vcf(args_t *args)
}

// check if alleles compatible with being a gVCF record
// ALT must be one of ., <*>, <X>, <NON_REF>
// check for INFO/END is below
int i, gallele = -1;
if (line->n_allele==1)
gallele = 0; // illumina/bcftools-call gvcf (if INFO/END present)
else
else if ( line->d.allele[1][0]=='<' )
{
if ( line->d.allele[1][0]!='<' ) continue;
for (i=1; i<line->n_allele; i++)
{
if ( line->d.allele[i][1]=='*' && line->d.allele[i][2]=='>' && line->d.allele[i][3]=='\0' ) { gallele = i; break; } // mpileup/spec compliant gVCF
Expand Down

0 comments on commit 9a1f6b2

Please sign in to comment.