Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New samtools/bgzip module to produce BGZF-compressed files. #7433

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

charles-plessy
Copy link
Contributor

@charles-plessy charles-plessy commented Feb 5, 2025

I propose a new module, samtools/bgzip, to produce BGZF-compressed files (usually genomes in FASTA format).

This module can take a FASTA file regardless if it is gzipped or not.

  • If the file was not compressed, it is compressed with bgzip.
  • If the file was compressed with gzip, it uncompressed and recompressed with bgzip.
  • If the file was already compressed with bgzip, the module returns it unchanged.

This solved the issue that some pipelines request input data to be already bgzipped, but data providers like NCBI do not use bgzip for compressing their files (in particular genomes).

PR checklist

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added a new tool - have you followed the module conventions in the contribution docs
  • If necessary, include test data in your PR.
  • Remove all TODO statements.
  • Emit the versions.yml file.
  • Follow the naming conventions.
  • Follow the parameters requirements.
  • Follow the input/output options guidelines.
  • Add a resource label
  • Use BioConda and BioContainers if possible to fulfil software requirements.
  • Ensure that the test works with either Docker / Singularity. Conda CI tests can be quite flaky:
    • For modules:
      • nf-core modules test <MODULE> --profile docker
      • nf-core modules test <MODULE> --profile singularity
      • nf-core modules test <MODULE> --profile conda
    • For subworkflows:
      • nf-core subworkflows test <SUBWORKFLOW> --profile docker
      • nf-core subworkflows test <SUBWORKFLOW> --profile singularity
      • nf-core subworkflows test <SUBWORKFLOW> --profile conda

@charles-plessy charles-plessy force-pushed the add_samtools_bgzip branch 2 times, most recently from a0b8b4c to 9e44077 Compare February 5, 2025 07:26
This module can take a FASTA file regardless if it is gzipped or not.

 - If the file was not compressed, it is compressed with bgzip.
 - If the file was compressed with gzip, it uncompressed and
   recompressed with bgzip.
 - If the file was already compressed with bgzip, the module
   returns it unchanged.

This solved the issue that some pipelines request input data to be
already bgzipped, but data providers like NCBI do not use bgzip for
compressing their files (in particular genomes).
Copy link
Contributor

@Joon-Klaps Joon-Klaps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm!

@charles-plessy charles-plessy marked this pull request as draft February 6, 2025 23:36
@charles-plessy
Copy link
Contributor Author

Thanks Joon for the review! Following new discussions on #7444, I will wait before adding a couple of fixes, maybe rename the module, and then ask again for review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants