我正在运行GNU并行。与我在其他分析中的输出不同,这个输出很奇怪。
我的代码:
# set the path of the required program
samtools=/usr/local/apps/samtools/0.1.19-gcc412/samtools
TempDir=/gpfs_common/share03/uncg/bkgiri/apps/temp_files/
# run the process for 4 samples in 4 different cores
parallel --tmpdir ${TempDir} --jobs 4 ${samtools} view -b -q 40 realigned_{}.bam -L DNA_Samples.Passed_Variants.Final.bed > realigned_{}Filtered.bam ::: ms01e ms02g ms03g ms04h
realigned_{}Filtered.bam
的大文件。我之前从未遇到过这个问题。我也尝试过:
parallel --tmpdir ${TempDir} --jobs 4 '${samtools} view -b -q 40 realigned_{}.bam -L DNA_Samples.Passed_Variants.Final.bed > realigned_{}Filtered.bam' ::: ms01e ms02g ms03g ms04h
# which now gives me another type of error
有什么建议 ?
正如@choroba所提到的那样:>即使在并行可以看到它之前,它也会被shell解释为重定向。
所以,我找到了最终解决这个问题的两种方法。
" "
中的整个命令,我认为它在功能上更有效率。
parallel --tmpdir ${TempDir} --jobs 4 "${samtools} view -b -q 40 realigned_{}.bam -L DNA_Samples.Passed_Variants.Final.bed > realigned_{}Filtered.bam" ::: ms01e ms02g ms03g ms04h
" "
中的输出。这允许>
被解释为文本,当pipedin作为stdin工作作为输出而不是重定向时。
parallel --tmpdir ${TempDir} --jobs 4 ${samtools} view -b -q 40 realigned_{}.bam -L DNA_Samples.Passed_Variants.Final.bed ">" realigned_{}Filtered.bam ::: ms01e ms02g ms03g ms04h
我测试了两种方法,两种方法都给出了完全相同的结果。所以,任何一个都可以安全地打电话。
谢谢,