I would like to convert the following shell command into python code using subprocess. In particular, how to convert the multiple <(zcat ...) as stdin? Ideally, the code should use subprocess.call, but subprocess.Popen is fine, too.
rsem-calculate-expression \
-p 2 \
--some-other-option \
--paired-end \
<(zcat a_1.fastq.gz b_1.fastq.gz c_1.fastq.gz) \
<(zcat b_2.fastq.gz b_2.fastq.gz c_2.fastq.gz) \
~/index/hg19 \
output_dir \
1>stdin.log \
2>stderr.log
The easiest way is to just let bash handle the process substitutions:
subprocess.Popen(['/bin/bash', '-c', 'rsem-calculate-expression -p 2 \
--some-other-option --paired-end \
<(zcat a_1.fastq.gz b_1.fastq.gz c_1.fastq.gz) \
<(zcat b_2.fastq.gz b_2.fastq.gz c_2.fastq.gz) \
~/index/hg19 output_dir'])