Skip to content

New module: angsd/dosaf#12359

Open
ASendellPrice wants to merge 22 commits into
nf-core:masterfrom
ASendellPrice:angsd_dosaf
Open

New module: angsd/dosaf#12359
ASendellPrice wants to merge 22 commits into
nf-core:masterfrom
ASendellPrice:angsd_dosaf

Conversation

@ASendellPrice

Copy link
Copy Markdown
Contributor

This PR adds a new module angsd/dosaf for estimating per-population site allele frequency likelihoods from BAM files using ANGSD's doSAF function (https://www.popgen.dk/angsd/index.php/SFS_Estimation). Outputs SAF files (.saf.idx, .saf.pos.gz, .saf.gz) which can be used for downstream site frequency spectrum (SFS) estimation, Fst calculation, and estimating population diversity statistics e.g. nucleotide diversity and Tajima's D.

Test data for this module has been added: nf-core/test-datasets#2131

PR checklist

Closes #12185

  • 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.
  • Broadcast software version numbers to topic: versions - See version_topics
  • 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

@ASendellPrice ASendellPrice self-assigned this Jul 14, 2026
Comment thread modules/nf-core/angsd/dosaf/main.nf
Comment on lines +11 to +16
tuple val(meta), path(bams), path(bam_indices)
tuple val(meta2), path(reference_fasta), path(reference_fai)
tuple val(meta3), path(ancestral_fasta), path(ancestral_fai) // Optional. Provides ancestral state for unfolded SFS.
tuple val(meta4), path(error_file) // Optional. Required for SYK model (-GL 4) only.
tuple val(meta5), path(inbreeding_coefficients) // Optional. Required for -doSAF 2 (inbreeding-aware mode).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do you need all these different meta maps?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The only particularly useful one is the meta map associated with bam files, as would include population ID and associated samples. This would be used by downstream processes that consume output from angsd/dosaf. I will remove the other meta maps, unless you think meta maps should be included for fasta files? Is there any guidance on when meta maps should be provided?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

https://nf-co.re/docs/specifications/components/modules/general#use-of-meta-maps
you can also use the same meta map several times. the usage is a bit dependent on usual upstream and downstream processes.

@ASendellPrice ASendellPrice Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have removed unnecessary meta maps in commit 802a9b9

Comment thread modules/nf-core/angsd/dosaf/main.nf Outdated
Comment thread modules/nf-core/angsd/dosaf/main.nf Outdated
ASendellPrice and others added 4 commits July 16, 2026 12:18
Co-authored-by: Matthias Hörtenhuber <mashehu@users.noreply.github.com>
Co-authored-by: Matthias Hörtenhuber <mashehu@users.noreply.github.com>
@ASendellPrice

Copy link
Copy Markdown
Contributor Author

@mashehu thanks for the suggested code improvements (especially the method for condensing the main code block!), these are now incorporated 😄

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.

new module: ANGSD/DOSAF

2 participants