Skip to content

Commit

Permalink
Fix ref matching for long indels
Browse files Browse the repository at this point in the history
  • Loading branch information
ckandoth committed Sep 29, 2016
1 parent 8560b97 commit 735c1f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion maf2vcf.pl
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@
push( @regions_split, [ splice( @regions, 0, 100000 ) ] ) while @regions;
map{ my $loci = join( " ", @{$_} ); $lines .= `$samtools faidx $ref_fasta $loci` } @regions_split;
foreach my $line ( grep( length, split( ">", $lines ))) {
my ( $locus, $bps ) = split( "\n", $line );
# Carefully split this FASTA entry, properly chomping newlines for long indels
my ( $locus, $bps ) = split( "\n", $line, 2 );
$bps =~ s/\r|\n//g;
if( $bps ){
$bps = uc( $bps );
$flanking_bps{$locus} = $bps;
Expand Down
4 changes: 3 additions & 1 deletion vcf2maf.pl
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@ sub GetBiotypePriority {
push( @regions_split, [ splice( @regions, 0, 100000 ) ] ) while @regions;
map{ my $loci = join( " ", @{$_} ); $lines .= `$samtools faidx $ref_fasta $loci` } @regions_split;
foreach my $line ( grep( length, split( ">", $lines ))) {
my ( $locus, $bps ) = split( "\n", $line );
# Carefully split this FASTA entry, properly chomping newlines for long indels
my ( $locus, $bps ) = split( "\n", $line, 2 );
$bps =~ s/\r|\n//g;
if( $bps ){
$bps = uc( $bps );
$flanking_bps{$locus} = $bps;
Expand Down

0 comments on commit 735c1f7

Please sign in to comment.