From 2235eedb122236c7b25d38adfdec55380defe1d4 Mon Sep 17 00:00:00 2001 From: Cyriac Kandoth Date: Mon, 29 Mar 2021 14:29:26 -0700 Subject: [PATCH] maf2maf: Remove only one anchor bp if found, not all of them --- maf2maf.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maf2maf.pl b/maf2maf.pl index 213629c..7c24e66 100644 --- a/maf2maf.pl +++ b/maf2maf.pl @@ -274,8 +274,8 @@ # Prefer Tumor_Seq_Allele2 over Tumor_Seq_Allele1 if both are non-REF my $var = (( defined $al2 and $al2 and $al2 ne $ref ) ? $al2 : $al1 ); - # Remove any prefixed reference bps from alleles, using "-" for simple indels - while( $ref and $var and substr( $ref, 0, 1 ) eq substr( $var, 0, 1 ) and $ref ne $var ) { + # Remove (only one) prefixed reference bp from alleles, using "-" for simple indels + if( $ref and $var and substr( $ref, 0, 1 ) eq substr( $var, 0, 1 ) and $ref ne $var ) { ( $ref, $var ) = map{$_ = substr( $_, 1 ); ( $_ ? $_ : "-" )} ( $ref, $var ); ++$pos unless( $ref eq "-" ); }