This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Is it possible to pipelined two picard tools into one input?

Suppose I have a bam file, abc.bam, needs to run CleanSam and SamToFastq:

java -jar picard.jar CleanSam \
    I=abc.bam \
    O=abc_cleaned.bam \

java -jar picard.jar SamToFastq \
    I=abc_cleaned.bam \
    FASTQ=R1.fastq \
    SECOND_END_FASTQ=R2.fastq

Is it possible to run them pipelined, e.g feed the abc_cleaned.bam as the input for SamToFastq?

next-gen

1 answer

try

java -jar picard.jar CleanSam \
    I=abc.bam \
    O=/dev/stdout |\
java -jar picard.jar SamToFastq \
    I=/dev/stdin \
    FASTQ=R1.fastq \
    SECOND_END_FASTQ=R2.fastq

Log in to answer this question.