Skip to content

Commit 5453f80

Browse files
committed
Use DP4 for allele counts when AD is missing
1 parent 2d6846f commit 5453f80

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

vcf2maf.pl

+9
Original file line numberDiff line numberDiff line change
@@ -1042,6 +1042,15 @@ sub FixAlleleDepths {
10421042
$depths[0] = $fmt_info{RR};
10431043
$depths[$var_allele_idx] = $fmt_info{RV};
10441044
}
1045+
# Handle VCF lines where REF/ALT allele counts must be extracted from DP4
1046+
elsif( !defined $fmt_info{AD} and defined $fmt_info{DP4} and scalar( split( /,/, $fmt_info{DP4} )) == 4 ) {
1047+
# Reference allele depth and depths for any other ALT alleles must be left undefined
1048+
@depths = map{""} @alleles;
1049+
# DP4 is usually a comma-delimited list for ref-forward, ref-reverse, alt-forward and alt-reverse read counts
1050+
my @count = split( /,/, $fmt_info{DP4} );
1051+
$depths[0] = $count[0] + $count[1];
1052+
$depths[$var_allele_idx] = $count[2] + $count[3];
1053+
}
10451054
# Handle VCF lines from cgpPindel, where ALT depth and total depth are in PP:NP:PR:NR
10461055
elsif( !defined $fmt_info{AD} and scalar( grep{defined $fmt_info{$_}} qw/PP NP PR NR/ ) == 4 ) {
10471056
# Reference allele depth and depths for any other ALT alleles must be left undefined

0 commit comments

Comments
 (0)