mskcc / vcf2maf

Convert a VCF into a MAF, where each variant is annotated to only one of all possible gene isoforms
Other
368 stars 215 forks source link

maf2vcf.pl: multiple FILTER tags should be semicolon separated #209

Open soccin opened 5 years ago

soccin commented 5 years ago

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 "" );
ckandoth commented 5 years ago

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.

soccin commented 5 years ago

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