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