File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -1042,6 +1042,15 @@ sub FixAlleleDepths {
1042
1042
$depths [0] = $fmt_info {RR };
1043
1043
$depths [$var_allele_idx ] = $fmt_info {RV };
1044
1044
}
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
+ }
1045
1054
# Handle VCF lines from cgpPindel, where ALT depth and total depth are in PP:NP:PR:NR
1046
1055
elsif ( !defined $fmt_info {AD } and scalar ( grep {defined $fmt_info {$_ }} qw/ PP NP PR NR/ ) == 4 ) {
1047
1056
# Reference allele depth and depths for any other ALT alleles must be left undefined
You can’t perform that action at this time.
0 commit comments