modules icon indicating copy to clipboard operation
modules copied to clipboard

update module: CHOPPER

Open muabnezor opened this issue 1 year ago • 1 comments

Is there an existing module for this?

  • [x] I have searched for the existing module

Is there an open PR for this?

  • [x] I have searched for existing PRs

Is there an open issue for this?

  • [x] I have searched for existing issues

Are you going to work on this?

  • [x] If I'm planning to work on this module, I added myself to the Assignees to facilitate tracking who is working on the module

muabnezor avatar Oct 18 '24 11:10 muabnezor

chopper can be used together with a fasta file to filter reads against. The current module does not allow for the user to pass along a fasta file as an input. However, chopper can also be used without a fasta file for quality, and length filtering, so the option to pass along a fasta file must be flexible.

muabnezor avatar Oct 18 '24 11:10 muabnezor

Hi, what would be the best way of doing this? We want to be able to use chopper with, and without a reference fasta to filter against. I'm inclined to let the fasta file to be an optional parameter, but it seems there is no straightforward way to give optional parameters in nextflow? would it be better to add an additional chopper module, e.g. chopper_reference, that takes an fasta file as input as well? What do you think @jfy133

muabnezor avatar Oct 30 '24 07:10 muabnezor

@muabnezor optional inputs are possible! Pseudocode

script:
def fasta_command =  fasta ? '-contam ${fasta}' : ''
"""
chopper -i ${fastq} $fastq_command
"""

jfy133 avatar Oct 30 '24 09:10 jfy133

For the module invocatroin you can use an empty list [] e.g. CHOPPER ( ch_fastaqs, [] ) if you don't have a fasta

jfy133 avatar Oct 30 '24 09:10 jfy133

Great,

I did it like that, but I had problems with the invocation when the fasta channel is empty. passing [] seems to do it.

So chopper can be invoked with something like this

            CHOPPER (
                ch_long_reads,
                lambda.ifEmpty([])
            )

PR in nf-core/modules coming soon.

muabnezor avatar Oct 30 '24 09:10 muabnezor

Exactly!

jfy133 avatar Oct 30 '24 09:10 jfy133