This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Using bcftools merge on the output of multiple process substitution? (somewhat a linux question)

I need to get rid of one sample in each of 3 vcfs then merge. I am not an expert on Linux, but cobbled together this:

bcftools merge <(bcftools view -s ^'sample1' vcf1.vcf)  <(bcftools view -s ^'sample2' vcf2.vcf)  <(bcftools view -s ^'sample3' vcf3.vcf) -Ob > merged.bcf

Is using process substitution like this "safe" or is this asking for trouble. The other thought is just to do the view command first making intermediate files.

linux

1 answer

It should be fine. The line added to the VCF file will replace the process substitution parameters with /dev/fd/ file descriptors.

Thanks, how do I accept your answer?

It was a comment. I've moved it to an answer now. You should be able to use the green mark to accept it.

Log in to answer this question.