sunbeam icon indicating copy to clipboard operation
sunbeam copied to clipboard

flagstats in mapping

Open khillion opened this issue 4 years ago • 6 comments

Hi sunbeam team,

I have been modifying a bit the mapping rule locally to be able to run only mapping with then the samtools flagstats command on all of them to finally summarize everything in a table.

I was wondering whether you would be interested in adding such feature to sunbeam, and if so if I should open a pull request?

Thanks, Kenzo

khillion avatar Feb 28 '20 16:02 khillion

Just managed to take a look now-- that looks pretty useful! It looks like the flagstats feature was added in samtools 1.10, so it would need a version bump in the environment.yml. I'm not a lead on Sunbeam things these days so I'll defer to @louiejtaylor on a PR versus extension or what have you. Thanks!

ressy avatar Mar 09 '20 15:03 ressy

Hi, actually flagstat is quite an old feature from samtools so bumping the version should not be necessary. I actually just add my rules and it worked perfectelly for me.

The reason I need that was mainly to also avoid doing the mpileup that I did not need and could be really ressource consuming when you have a lot of samples.

khillion avatar Mar 10 '20 09:03 khillion

Oh, even better, then. And I see it now, I didn't realize that it takes either the command "flagstats" or "flagstat" in 1.10 but only "flagstat" in 1.9. Thanks.

But, does "flagstats" as you have in your branch work for you in samtools 1.9? Or did your samtools end up at a higher version, maybe? (My version that doesn't recognize the plural one is bioconda's samtools-1.9-h10a08f8_12. It only accepts samtools flagstat.)

ressy avatar Mar 10 '20 13:03 ressy

Indeed, you are right, I have version 1.10 of samtools that I guess was installed since I reinstall sunbeam environment recently. In any case, what I can do is replace flagstats by flagstat in the rule name if you are ever interested in adding this to sunbeam "core"?

khillion avatar Mar 10 '20 13:03 khillion

Yeah, maybe best to just stick with flagstat since then there's no need to touch the package versioning.

ressy avatar Mar 10 '20 20:03 ressy

Ok great! I am going to open a PR then.

khillion avatar Mar 11 '20 10:03 khillion

Closing this now, the filtering implemented in sbx_mapping should accomplish the same end.

Ulthran avatar Nov 09 '23 20:11 Ulthran