Skip to content

Commit

Permalink
fixed more xargs
Browse files Browse the repository at this point in the history
  • Loading branch information
lskatz committed Nov 16, 2016
1 parent 3b16d89 commit b90eae9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/launch_set.pl
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ sub variantCalls{
}
if(!-e $regionsFile){
system("rm -fv $regionsFile.*.tmp");
my $command="samtools view -H $initBam | grep \"\@SQ\" | sed 's/^.*SN://g' | cut -f 1 | xargs -I {} -n 1 -P $$settings{numcpus} sh -c \"samtools mpileup -suf $ref -r '{}' $initBam | bcftools call -c | grep -v '^#' | cut -f 1,2 > $regionsFile.'{}'.tmp \" ";
my $command="samtools view -H $initBam | grep \"\@SQ\" | sed 's/^.*SN://g' | cut -f 1 | xargs -n 1 -P $$settings{numcpus} sh -c \"samtools mpileup -suf $ref -r '$0' $initBam | bcftools call -c | grep -v '^#' | cut -f 1,2 > $regionsFile.'$0'.tmp \" ";
$sge->pleaseExecute($command,{numcpus=>$$settings{numcpus},jobname=>"snpPositionDiscovery"});
$sge->wrapItUp();

Expand Down
2 changes: 1 addition & 1 deletion scripts/mergeVcf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ echo "$script: temporary directory is $TEMPDIR";
echo "$script: Running bcftools merge";
export IN;
export script;
echo "$REGION" | xargs -P $NUMCPUS -n 1 -I {} bash -c 'echo "$script: merging SNPs in {}"; out='$TEMPDIR'/merged.$$.vcf; bcftools merge --merge all --regions "{}" --force-samples -o $out $IN && bgzip $out && tabix $out.gz && echo "$script: finished with region {}";'
echo "$REGION" | xargs -P $NUMCPUS -n 1 bash -c 'echo "$script: merging SNPs in $0"; out='$TEMPDIR'/merged.$$.vcf; bcftools merge --merge all --regions "$0" --force-samples -o $out $IN && bgzip $out && tabix $out.gz && echo "$script: finished with region $0";'
if [ $? -gt 0 ]; then
echo "$script: ERROR with bcftools merge"
rm -rvf $TEMPDIR;
Expand Down

0 comments on commit b90eae9

Please sign in to comment.