Hi all, question about the SAMTOOLS_GETRG module (...
# modules
j
Hi all, question about the SAMTOOLS_GETRG module (https://github.com/nf-core/modules/blob/master/modules/nf-core/samtools/getrg/main.nf): We are considering using this module in some of our subworkflows. @Matthieu Muffato and I were discussing, and agreed that it would be nice if the module would also be able to emit other SAM header types (e.g.
@PG
,
@SQ
) lines, as these would also be something we might want to use. What would be the best approach to modify the module? Options to me seem to be either a) we just add these features as extra outputs to the module, keeping the name for backwards compatibility, or b) we deprecate the module and replace it with something called like SAMTOOLS_SPLITHEADER, which has the same functionality plus a bit more. Tagging @Matthias De Smet as you're listed as the maintainer in the
meta.yml
!
Suggested module code:
Copy code
samtools \\
        view \\
        -H \\
        $args \\
        $input \\
    | tee \\
        >( grep '^@RG' > readgroups.txt ) \
        >( grep '^@PG' > programs.txt ) \
        >( grep '^@SQ' > sequences.txt ) \
   > /dev/null
m
Hi Jim, We’re no longer using this module, so I’d say you can use your best judgement. Have fun with it!
👍 1
j
In that case, I think I prefer the deprecation/renaming option for clarity! I just didn't want to break anything unnecessarily...
s
renaming makes sense to me, but we don't have a way to do that nicely
just the deprecate/rename which is what you've mentioned
👍 1
a
Can I be so bold as to predict that someone in the future will want to get some other arbitrary header tag?
Copy code
output:
tuple val(meta), path('*.txt'), emit: tag_files

 
| tee \\
        >( grep '^@RG' > readgroups.txt ) \
        >( grep '^@PG' > programs.txt ) \
        >( grep '^@SQ' > sequences.txt ) \
        ${args2} \
   > /dev/null
Where
args2
can be e.g.
>( grep '^@TT' > tt.txt
❤️ 1