Skip to content

Commit 7f3bd61

Browse files
committed
Use buffer-size to limit CLI args for samtools/tabix
1 parent 8d9e611 commit 7f3bd61

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

vcf2maf.pl

+3-3
Original file line numberDiff line numberDiff line change
@@ -359,11 +359,11 @@ sub GetBiotypePriority {
359359
$vcf_fh->close;
360360

361361
# samtools runs faster when passed many loci at a time, but limited to around 125k args, at least
362-
# on CentOS 6. If there are too many loci, split them into 50k chunks and run separately
362+
# on CentOS 6. If there are too many loci, split them into smaller chunks and run separately
363363
my ( $lines, @regions_split ) = ( "", ());
364364
my @regions = keys %uniq_regions;
365365
my $chr_prefix_in_use = ( @regions and $regions[0] =~ m/^chr/ ? 1 : 0 );
366-
push( @regions_split, [ splice( @regions, 0, 50000 ) ] ) while @regions;
366+
push( @regions_split, [ splice( @regions, 0, $buffer_size ) ] ) while @regions;
367367
map{ my $region = join( " ", @{$_} ); $lines .= `$samtools faidx $ref_fasta $region` } @regions_split;
368368
foreach my $line ( grep( length, split( ">", $lines ))) {
369369
# Carefully split this FASTA entry, properly chomping newlines for long indels
@@ -386,7 +386,7 @@ sub GetBiotypePriority {
386386
# Query each variant locus on the filter VCF, using tabix, just like we used samtools earlier
387387
( $lines, @regions_split ) = ( "", ());
388388
my @regions = keys %uniq_loci;
389-
push( @regions_split, [ splice( @regions, 0, 50000 ) ] ) while @regions;
389+
push( @regions_split, [ splice( @regions, 0, $buffer_size ) ] ) while @regions;
390390
# ::NOTE:: chr-prefix removal works safely here because ExAC is limited to 1..22, X, Y
391391
map{ my $loci = join( " ", map{s/^chr//; $_} @{$_} ); $lines .= `$tabix $filter_vcf $loci` } @regions_split;
392392
foreach my $line ( split( "\n", $lines )) {

0 commit comments

Comments
 (0)