[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GNU Parallel Bug Reports java flag being interpreted by bash, and 2+
From: |
Ole Tange |
Subject: |
Re: GNU Parallel Bug Reports java flag being interpreted by bash, and 2+ extension chomping |
Date: |
Sat, 22 Aug 2015 23:42:42 +0200 |
On Fri, Aug 21, 2015 at 10:40 PM, Andreas Bernauer
<address@hidden> wrote:
> On 21/08/15 19:55, Cameron Prybol wrote:
:
>> $ ./s13.variant_calibration.sh <http://s13.variant_calibration.sh>
>> /bin/bash: 2.0: No such file or directory
:
>> is breaking because of the --filterExpression "QD < 2.0" being
>> interpreted as a < file input in this command
:
>> parallel java -jar $GATK -T VariantFiltration -R
>> "$REF_DIR/human_g1k_v37.fasta" -V {} -window 35 -cluster 3 --filterName
>> QD --filterExpression "QD < 2.0" --filterName FS --filterExpression "FS
>>> 30.0" -o "$VCF_OUT/"'{= s:.*/::; s:\.[^.]+$::; s:\.[^.]+$::;
>> =}'.filtered.vcf ::: "$(ls "$VCF_IN"/*.vcf)"
>
> You have to quote your redirection twice
Correct. And since quoting can make a command close to unreadable,
consider using a bash function instead:
varfilt() {
vcf=$1
out=$2
java -jar $GATK -T VariantFiltration -R
"$REF_DIR/human_g1k_v37.fasta" -V "$vcf" -window 35 -cluster 3
--filterName
QD --filterExpression "QD < 2.0" --filterName FS --filterExpression "FS
30.0" -o "$VCF_OUT/$out"
}
export -f varfilt
parallel varfilt {} '{= s:.*/::; s:\.[^.]+$::; s:\.[^.]+$::;
=}'.filtered.vcf ::: "$VCF_IN"/*.vcf
> The first set of quotes is consumed by your shell that calls parallel.
> The second set of quotes prevents the called shell (or parallel? I'm not
> sure) to interpret the '<' as a redirect.
GNU Parallel calls a shell, and it is this shell that interprets the
'<' as redirection.
/Ole