vcf2maf icon indicating copy to clipboard operation
vcf2maf copied to clipboard

maf2vcf.pl: multiple FILTER tags should be semicolon separated

Open soccin opened this issue 6 years ago • 2 comments

The VCF spec (https://github.com/samtools/hts-specs/blob/master/VCFv4.3.tex) says:

FILTER - filter status: PASS if this position has passed all filters, i.e. a call is made at this position. Otherwise, if the site has not passed all filters, a semicolon-separated list of codes for filters that fail. e.g. “q10;s50”

Some VCF parsers are fussy about this; simple fix:

@@ -196,6 +196,9 @@ while( my $line = $maf_fh->getline ) {
     $qual = "." if( !defined $qual or $qual eq "" );
     $filter = "." if( !defined $filter or $filter eq "" );
 
+    # VCF Spec says multiple FILTER tags should be _semicolon_ separated
+    $filter =~ s/,/;/g;
+
     # If normal alleles are unset in the MAF (quite common), assume homozygous reference
     $n_al1 = $ref if( $n_al1 eq "" );
     $n_al2 = $ref if( $n_al2 eq "" );

soccin avatar Dec 30 '18 19:12 soccin

Thanks @soccin - I switched from comma to semicolon in release v1.6.14, but this looks like an unhandled exception when the input MAF uses commas, and is copied unchanged. I'll put a fix in the backlog, but let me know if you need a fix ASAP.

ckandoth avatar Jan 02 '19 03:01 ckandoth

Not urgent. I have a local version I fixed for now. Thanks.

soccin avatar Jan 02 '19 15:01 soccin