Skip to content

new subworkflow: FASTA_BGZIP_INDEX_DICT_SAMTOOLS #8535

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

Open
4 tasks done
charles-plessy opened this issue May 22, 2025 · 1 comment
Open
4 tasks done

new subworkflow: FASTA_BGZIP_INDEX_DICT_SAMTOOLS #8535

charles-plessy opened this issue May 22, 2025 · 1 comment
Assignees

Comments

@charles-plessy
Copy link
Contributor

Is there an existing subworkflow for this?

  • I have searched for the existing subworkflow

Is there an open PR for this?

  • I have searched for existing PRs

Is there an open issue for this?

  • I have searched for existing issues

Are you going to work on this?

  • If I'm planning to work on this subworkflow, I added myself to the Assignees to facilitate tracking who is working on the subworkflow
@charles-plessy
Copy link
Contributor Author

I have created a local subworkflow in nf-core/pairgenomealign, that takes a genome as input, and returns the genome compressed with bgzip, with its fai and gzi indices, plus as sequence dictionary, to facilitate samtools operations later in the pipeline.

If there is interest I will be pleased to make a PR.

https://github.com/nf-core/pairgenomealign/tree/milestone_2.2.0/subworkflows/local/fasta_bgzip_index_dict_samtools

include { SAMTOOLS_BGZIP     } from '../../../modules/nf-core/samtools/bgzip/main'
include { SAMTOOLS_DICT      } from '../../../modules/nf-core/samtools/dict/main'
include { SAMTOOLS_FAIDX     } from '../../../modules/nf-core/samtools/faidx/main'

workflow FASTA_BGZIP_INDEX_DICT_SAMTOOLS {

    take:
    ch_fasta // channel: [ val(meta), fasta ]

    main:

    ch_versions = Channel.empty()

    // Guarantee BGZIP compression
    SAMTOOLS_BGZIP ( ch_fasta )
    ch_versions = ch_versions.mix(SAMTOOLS_BGZIP.out.versions)

    SAMTOOLS_FAIDX ( SAMTOOLS_BGZIP.out.fasta, [[],[]], [[],[]] )
    ch_versions = ch_versions.mix(SAMTOOLS_FAIDX.out.versions)

    SAMTOOLS_DICT  ( SAMTOOLS_BGZIP.out.fasta )
    ch_versions = ch_versions.mix(SAMTOOLS_DICT .out.versions)

    emit:
    fasta_gz = SAMTOOLS_BGZIP.out.fasta        // channel: [ val(meta),  fasta.gz ]
    fai      = SAMTOOLS_FAIDX.out.fai          // channel: [ val(meta),  fai ]
    gzi      = SAMTOOLS_FAIDX.out.gzi          // channel: [ val(meta),  gzi ]
    dict     = SAMTOOLS_DICT .out.dict         // channel: [ val(meta),  dict ]

    versions = ch_versions                     // channel: [ versions.yml ]
}

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

No branches or pull requests

1 participant