我在linux终端的原始输入是
bcftools filter -e 'TYPE="snp"' input1.vcf -O v -o output1.filter.vcf
bcftools filter -e 'TYPE="snp"' input2.vcf -O v -o output2.filter.vcf
bcftools filter -e 'TYPE="snp"' input3.vcf -O v -o output3.filter.vcf
bcftools filter -e 'TYPE="snp"' input4.vcf -O v -o output4.filter.vcf
bcftools filter -e 'TYPE="snp"' input5.vcf -O v -o output5.filter.vcf
我已经有一个名为parallel.input的文件,其中包含
[***@dev1 raw_reads]$ cat parallel.input
input1.vcf
output1.filter.vcf
input2.vcf
output2.filter.vcf
input3.vcf
output3.filter.vcf
input4.vcf
output4.filter.vcf
input5.vcf
output5.filter.vcf
当我使用这个命令并行时
cat parallel.input | parallel -j 3 -k --max-args=2 --joblog parallel.log "bcftools filter -e 'TYPE="snp"' {1} -O v -o {2}"
它得到了这个错误
[filter.c:2278 filters_init1] Error: the tag "snp" is not defined in the VCF header
[filter.c:2278 filters_init1] Error: the tag "snp" is not defined in the VCF header
[filter.c:2278 filters_init1] Error: the tag "snp" is not defined in the VCF header
[filter.c:2278 filters_init1] Error: the tag "snp" is not defined in the VCF header
[filter.c:2278 filters_init1] Error: the tag "snp" is not defined in the VCF header
我认为是因为它在 bcftools 命令中有引用。但我需要引用作为输入
知道如何进行并行吗?
谢谢
答案1
使用一个函数:
myfunc() {
bcftools filter -e 'TYPE="snp"' "$1" -O v -o "$2"
}
export -f myfunc
cat parallel.input |
parallel -j 3 -k --max-args=2 --joblog parallel.log myfunc