TRIM_GALORE WITH RUFFUS

22 views
Skip to first unread message

Olabode Ajayi

unread,
Apr 12, 2016, 11:05:19 AM4/12/16
to ruffus_discuss
Hi All,

How can I use trim_galore with ruffus. The problem I'm facing is that the value of the output in trim_galore is a path to a directory but in transform decorator in ruffus the output should be a file name! How can I specify the output for trim_galore in transform to be a path to a directory?

Regards


Below is my code:

# Trim paired end reads in FASTQ to the reference producing a BAM file
    pipeline.transform(
        task_func=stages.trim_galore,
        name='trim_galore',
        input=output_from('original_fastqs'),
        filter=formatter('.+/(?P<sample>[a-zA-Z0-9]+)_R1.fastq.gz'),
        add_inputs=add_inputs('{path[0]}/{sample[0]}_R2.fastq.gz'),
        output=r"{path[0]}/"  # This is causing the problem!
    )

Leo Goodstadt 顧維斌

unread,
Apr 12, 2016, 11:31:46 AM4/12/16
to ruffus_...@googlegroups.com
Hi Olabode,
I am not sure if I understand you.
You can use wild cards in your output if you don't know the precise names of the files that you will be generating. I think in that case, you will have to use pipeline.split().

I also often find it helpful to have the output directory handy as well. There is little point in writing the parsing / regular expression logic once for Ruffus, and again for the body of your python function. In which case, just add it to your "extras" parameter

..., output = r"{path[0]}/*", extras = r"{path[0]}")

Hope that helps 

Leo

--
You received this message because you are subscribed to the Google Groups "ruffus_discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruffus_discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
Message has been deleted
0 new messages