Giter Site home page Giter Site logo

Comments (9)

moldach avatar moldach commented on August 24, 2024

I've just ran into this very same issue.

It's a pain if the user wants to use alternative tools for sorting (i.e. sambamba wrapper) in their pipeline (or different versions of samtools)

from snakemake-wrappers.

jafors avatar jafors commented on August 24, 2024

Thanks for the input! I guess this is sth. worthy to discuss. At the moment, the bwa-mem wrapper will output an unsorted bam file when setting sort="none", using samtools view. I could imagine adding a param to not do this and directly output the resulting sam file, since I (from my side) would like to avoid a breaking change. This should allow using the wrapper both without any use of samtools and as before.

Edit: Similar for the other wrappers you mentioned.

from snakemake-wrappers.

johanneskoester avatar johanneskoester commented on August 24, 2024

Conversion to the optimal format (here BAM, in other cases VCF) should be part of the wrapper, because it comes almost for free, and makes workflows easier to read (hiding an unimportant technical detail). However, I agree that sorting does not need to be part of the BWA wrapper.

It should be possible to deactivate the conversion though, simply by specifying .sam instead of .bam as output.

from snakemake-wrappers.

fgvieira avatar fgvieira commented on August 24, 2024

@johanneskoester I agree that sometimes it is nice to hide unimportant technical detail, but isn't that why there are the meta wrappers? I might be missing something here but, as I understand it, the idea would be that main wrappers only do one thing (i.e. they are wrappers to a single tool/command). When it is nice to hide those technical details, then we'd have the meta-wrappers that are exactly that, a wrapper of wrappers.

In this case, I think it would make more sense to have the bwa-mem wrapper output a sam file and then have meta-wrappers called (e.g.) meta/bio/bwa/mem/bam or meta/bio/bwa/mem/sort/samtools or meta/bio/bwa/mem/sort/picard.

But I'd be happy just with the possibility of getting a sam file from bwa-mem 😄

from snakemake-wrappers.

johanneskoester avatar johanneskoester commented on August 24, 2024

Meta-Wrappers still show as more than one rule in a workflow. However, format conversion is so trivial that I think it in general rather just hampers clarity of a workflow. We do not even need an option for it. Just by specifying a .sam output file, the wrapper can switch to non-samtools-piping behavior.

In a way, those format conversion functionality just fixes usability issues of the respective tools.

from snakemake-wrappers.

johanneskoester avatar johanneskoester commented on August 24, 2024

@fgvieira do you want to clean up the bwa wrapper family accordingly in a PR?

from snakemake-wrappers.

fgvieira avatar fgvieira commented on August 24, 2024

Sure, I can change the bwa wrapper family to output sam if the extension of the output file is .sam in a PR.

Unless @jafors prefers to do it himself...

from snakemake-wrappers.

fgvieira avatar fgvieira commented on August 24, 2024

I've recently made a PR (#186) with a new combined bwa sam(pe/se) wrapper that automatically infers if the input is single-end or paired-end (basically combines bwa sampe and bwa samse into a single wrapper).

As an example, I've changed this wrapper so that the output file format is inferred from the output file extension, including when the output is sorted (both by picard and samtools). That means that we can get both sam or bam files for unsorted, samtools sorted and picard sorted.

If everybody agrees, I can do the same for the rest of the bwa wrapper family...

PS - that PR has a bunch of other wrappers, since I kinda got carried away.. 😄

from snakemake-wrappers.

fgvieira avatar fgvieira commented on August 24, 2024

Issue has been fixed on PR #186

from snakemake-wrappers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.