Skip to content

Commit

Permalink
fixed racing condition
Browse files Browse the repository at this point in the history
  • Loading branch information
lskatz committed Sep 8, 2015
1 parent 959dba6 commit fd16ef8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/launch_varscan.pl
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ sub mpileup{

# Multithread a pileup so that each region gets piped into a file.
# Then, these individual files can be combined at a later step.
my $command="echo \"$regions\" | xargs -P $$settings{numcpus} -n 1 -I {} sh -c 'echo \"MPileup on {}\" >&2; rm -fv $$settings{tempdir}/$b.*.mpileup >&2; samtools mpileup -f $reference $xopts --region \"{}\" $bam > $$settings{tempdir}/$b.\$\$.mpileup' ";
system("rm -fv $$settings{tempdir}/$b.*.mpileup >&2");
my $command="echo \"$regions\" | xargs -P $$settings{numcpus} -n 1 -I {} sh -c 'echo \"MPileup on {}\" >&2; samtools mpileup -f $reference $xopts --region \"{}\" $bam > $$settings{tempdir}/$b.\$\$.mpileup' ";
logmsg "Running mpileup:\n $command";
system($command);
die "ERROR with xargs and samtools mpileup" if $?;
Expand Down

0 comments on commit fd16ef8

Please sign in to comment.