-
Notifications
You must be signed in to change notification settings - Fork 1k
New module : portello #11114
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
Merged
Merged
New module : portello #11114
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
e349b36
added new portello module
sofiademmou 3d96a2d
fixed linting
sofiademmou 4ce59f3
added snapshots for every test
sofiademmou 8ca28c1
removed comments
sofiademmou 1bb77f0
put all input in same tuple and updated snapshots and meta
sofiademmou bf6ee8d
Merge branch 'master' into portello
sofiademmou de592e9
put all inputs in one tuple
sofiademmou 2bb0a67
replaced big setup with nf-core dataset
sofiademmou 3d8873c
Merge branch 'portello' of github.com:sofiademmou/modules into portello
sofiademmou c14b136
Merge branch 'master' into portello
sofiademmou 0ef0fbb
updated meta
sofiademmou 4887f58
Merge branch 'portello' of github.com:sofiademmou/modules into portello
sofiademmou c0ea5c4
Update modules/nf-core/portello/meta.yml
sofiademmou 633af72
Update modules/nf-core/portello/main.nf
sofiademmou 212d1cc
Update modules/nf-core/portello/main.nf
sofiademmou 068f4f0
updated version emission
sofiademmou 5bdae62
added missing ontologies and licence URL
sofiademmou 5a2b020
Merge branch 'master' into portello
sofiademmou 4041d95
fixed linting
sofiademmou d34acbd
Merge branch 'portello' of github.com:sofiademmou/modules into portello
sofiademmou 216ef51
removed unused setup and added md5 in snapshots
sofiademmou 7690f4e
Merge branch 'master' into portello
sofiademmou e456107
fixed linting problem in snapshots
sofiademmou 20b8a2d
Merge branch 'portello' of github.com:sofiademmou/modules into portello
sofiademmou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| channels: | ||
| - conda-forge | ||
| - bioconda | ||
| dependencies: | ||
| - "bioconda::portello=0.7.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| process PORTELLO { | ||
| tag "${meta.id}" | ||
| label 'process_high' | ||
|
|
||
| conda "${moduleDir}/environment.yml" | ||
| container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container | ||
| ? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/b7/b7a7ecbc4e475e2b0a339facbda324068cab503a58261d6a235169ce04bf25d8/data' | ||
| : 'community.wave.seqera.io/library/portello:0.7.0--e30f230f4d2812dd'}" | ||
|
|
||
| input: | ||
| tuple val(meta), path(asm_to_ref_bam), path(asm_to_ref_bai), path(read_to_asm_bam), path(read_to_asm_bai), path(ref_fasta), val(assembly_mode), val(output_vcf) | ||
|
|
||
| output: | ||
| tuple val(meta), path("*_remapped.bam"), emit: bam | ||
| tuple val(meta), path("*_unassembled.bam"), emit: unassembled_bam | ||
| tuple val(meta), path("*.vcf.gz"), emit: vcf, optional: true | ||
| tuple val(meta), path("*.vcf.gz.tbi"), emit: tbi, optional: true | ||
| tuple val("${task.process}"), val('portello'), eval("portello --version | sed -e 's/portello //'"), topic: versions, emit: versions_portello | ||
|
|
||
| when: | ||
| task.ext.when == null || task.ext.when | ||
|
|
||
| script: | ||
| def args = task.ext.args ?: '' | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| def vcf_output = output_vcf ? "--phased-het-vcf-prefix ${prefix}" : "" | ||
| """ | ||
| portello \ | ||
| ${args} \ | ||
| --threads ${task.cpus} \ | ||
| --ref ${ref_fasta} \ | ||
| --assembly-to-ref ${asm_to_ref_bam} \ | ||
| --read-to-assembly ${read_to_asm_bam} \ | ||
| --input-assembly-mode ${assembly_mode} \ | ||
| --unassembled-read-output ${prefix}_unassembled.bam \ | ||
| ${vcf_output} \ | ||
| --remapped-read-output ${prefix}_remapped.bam | ||
| """ | ||
|
|
||
| stub: | ||
| def args = task.ext.args ?: '' | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| def vcf_output = output_vcf ? "echo | gzip -c > ${prefix}.vcf.gz; touch ${prefix}.vcf.gz.tbi" : '' | ||
| """ | ||
| echo ${args} | ||
|
|
||
| ${vcf_output} | ||
| touch ${prefix}_unassembled.bam | ||
| touch ${prefix}_remapped.bam | ||
| """ | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,142 @@ | ||
| name: "portello" | ||
| description: Transfer HiFi read mappings from their own assembly contigs to a | ||
| standard reference | ||
| keywords: | ||
| - assembly | ||
| - transfer | ||
| - pacbio | ||
| - genomics | ||
| tools: | ||
| - "portello": | ||
| description: "Method to transfer HiFi read mappings from de novo assembly to reference" | ||
| homepage: "https://github.com/PacificBiosciences/portello" | ||
| documentation: "https://github.com/PacificBiosciences/portello" | ||
| tool_dev_url: "https://github.com/PacificBiosciences/portello" | ||
| licence: | ||
| - "Pacific Biosciences Software License (https://github.com/PacificBiosciences/portello/blob/main/LICENSE.md)" | ||
| identifier: biotools:portello | ||
| input: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1' ]` | ||
| - asm_to_ref_bam: | ||
| type: file | ||
| description: Assembly contig to reference genome alignment file in | ||
| BAM/CRAM format | ||
| pattern: "*.{bam,cram}" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_2572" | ||
| - edam: "http://edamontology.org/format_2573" | ||
| - asm_to_ref_bai: | ||
| type: file | ||
| description: BAM/CRAM index file | ||
| pattern: "*.{bam.bai,cram.crai}" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_2572" | ||
| - edam: "http://edamontology.org/format_2573" | ||
| - read_to_asm_bam: | ||
| type: file | ||
| description: Read to assembly alignment file in BAM/CRAM format | ||
| pattern: "*.{bam,cram}" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_2572" | ||
| - edam: "http://edamontology.org/format_2573" | ||
| - read_to_asm_bai: | ||
| type: file | ||
| description: BAM/CRAM/SAM index file | ||
| pattern: "*.{bam,cram}.bai" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_2572" | ||
| - edam: "http://edamontology.org/format_2573" | ||
| - ref_fasta: | ||
| type: file | ||
| description: Reference genome FASTA file | ||
| pattern: "*.fa*" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_1929" | ||
| - assembly_mode: | ||
| type: string | ||
| description: The assembly mode used for the input BAM files | ||
| enum: | ||
| - fully-phased | ||
| - partially-phased | ||
| - output_vcf: | ||
| type: boolean | ||
| description: Whether to output phased variant calls in VCF format | ||
| output: | ||
| bam: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1' ]` | ||
| - "*_remapped.bam": | ||
| type: file | ||
| description: Remapped BAM file | ||
| pattern: "*_remapped.{bam}" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_2572" | ||
| unassembled_bam: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1' ]` | ||
| - "*_unassembled.bam": | ||
| type: file | ||
| description: Unassembled BAM file | ||
| pattern: "*_unassembled.{bam}" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_2572" | ||
| vcf: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1' ]` | ||
| - "*.vcf.gz": | ||
| type: file | ||
| description: VCF file with phased heterozygous small variant calls from | ||
| the input assembly contigs | ||
| pattern: "*.{vcf.gz}" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3989" | ||
| tbi: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1' ]` | ||
| - "*.vcf.gz.tbi": | ||
| type: file | ||
| description: VCF index file | ||
| pattern: "*.{vcf.gz.tbi}" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3616" | ||
| versions_portello: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The name of the process | ||
| - portello: | ||
| type: string | ||
| description: The name of the tool | ||
| - portello --version | sed -e 's/portello //': | ||
| type: eval | ||
| description: The expression to obtain the version of the tool | ||
| topics: | ||
| versions: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The name of the process | ||
| - portello: | ||
| type: string | ||
| description: The name of the tool | ||
| - portello --version | sed -e 's/portello //': | ||
| type: eval | ||
| description: The expression to obtain the version of the tool | ||
| authors: | ||
| - "@sofiademmou" | ||
| maintainers: | ||
| - "@sofiademmou" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,185 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test Process PORTELLO" | ||
| script "../main.nf" | ||
| process "PORTELLO" | ||
|
|
||
| tag "modules" | ||
| tag "modules_nfcore" | ||
| tag "portello" | ||
|
|
||
| test("portello - [bam, bai, bam, bai], fasta, partially-phased, false") { | ||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test'], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test_hifi_aligned_assembly.bam'), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test_hifi_aligned_assembly.bam.bai'), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test_hifi_aligned_to_assembly.bam'), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test_hifi_aligned_to_assembly.bam.bai'), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome3.fasta', checkIfExists: true), | ||
| "partially-phased", | ||
| false | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assert process.success | ||
| assert snapshot( | ||
| process.out.bam.collect { meta, bam_file -> [ meta, file(bam_file).name + ":md5," + bam(bam_file, stringency: "silent").getReadsMD5() ] }, | ||
| // no unmapped reads in the test, so only check file name here (empty file) | ||
| process.out.unassembled_bam.collect { meta, bam_file -> [ meta, file(bam_file).name ] }, | ||
| process.out.findAll { key, val -> key.startsWith('versions') } | ||
| ).match() | ||
| } | ||
| } | ||
|
|
||
|
|
||
| test("portello - [bam, bai, bam, bai], fasta, partially-phased, true") { | ||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test'], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test_hifi_aligned_assembly.bam'), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test_hifi_aligned_assembly.bam.bai'), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test_hifi_aligned_to_assembly.bam'), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test_hifi_aligned_to_assembly.bam.bai'), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome3.fasta', checkIfExists: true), | ||
| "partially-phased", | ||
| true | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assert process.success | ||
| assert snapshot( | ||
| process.out.bam.collect { meta, bam_file -> [ meta, file(bam_file).name + ":md5," + bam(bam_file, stringency: "silent").getReadsMD5() ] }, | ||
| // no unmapped reads in the test, so only check file name here (empty file) | ||
| process.out.unassembled_bam.collect { meta, bam_file -> [ meta, file(bam_file).name ] }, | ||
| process.out.vcf.collect { meta, vcf_file -> [ meta, file(vcf_file).name ] }, | ||
| process.out.tbi.collect { meta, tbi_file -> [ meta, file(tbi_file).name ] }, | ||
| process.out.findAll { key, val -> key.startsWith('versions') } | ||
| ).match() | ||
| assert process.out.vcf.size() > 0 | ||
| assert process.out.tbi.size() > 0 | ||
| } | ||
| } | ||
|
|
||
|
|
||
| test("portello - [bam, bai, bam, bai], fasta, fully-phased, false") { | ||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test'], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test_hifi_aligned_assembly.bam'), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test_hifi_aligned_assembly.bam.bai'), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test_hifi_aligned_to_assembly.bam'), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test_hifi_aligned_to_assembly.bam.bai'), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome3.fasta', checkIfExists: true), | ||
| "fully-phased", | ||
| false | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assert process.success | ||
| assert snapshot( | ||
| process.out.bam.collect { meta, bam_file -> [ meta, file(bam_file).name + ":md5," + bam(bam_file, stringency: "silent").getReadsMD5() ] }, | ||
| // no unmapped reads in the test, so only check file name here (empty file) | ||
| process.out.unassembled_bam.collect { meta, bam_file -> [ meta, file(bam_file).name ] }, | ||
| process.out.findAll { key, val -> key.startsWith('versions') } | ||
| ).match() | ||
| } | ||
| } | ||
|
|
||
| test("portello - [bam, bai, bam, bai], fasta, partially-phased, false - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test'], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test_hifi_aligned_assembly.bam'), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test_hifi_aligned_assembly.bam.bai'), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test_hifi_aligned_to_assembly.bam'), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test_hifi_aligned_to_assembly.bam.bai'), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome3.fasta', checkIfExists: true), | ||
| "partially-phased", | ||
| false | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assert process.success | ||
| assert snapshot(sanitizeOutput(process.out)).match() | ||
| } | ||
| } | ||
|
|
||
| test("portello - [bam, bai, bam, bai], fasta, fully-phased, false - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test'], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test_hifi_aligned_assembly.bam'), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test_hifi_aligned_assembly.bam.bai'), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test_hifi_aligned_to_assembly.bam'), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test_hifi_aligned_to_assembly.bam.bai'), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome3.fasta', checkIfExists: true), | ||
| "fully-phased", | ||
| false | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assert process.success | ||
| assert snapshot(sanitizeOutput(process.out)).match() | ||
| } | ||
| } | ||
|
|
||
| test("portello - [bam, bai, bam, bai], fasta, partially-phased, true - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test'], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test_hifi_aligned_assembly.bam'), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test_hifi_aligned_assembly.bam.bai'), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test_hifi_aligned_to_assembly.bam'), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test_hifi_aligned_to_assembly.bam.bai'), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome3.fasta', checkIfExists: true), | ||
| "partially-phased", | ||
| true | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assert process.success | ||
| assert snapshot(sanitizeOutput(process.out)).match() | ||
| } | ||
| } | ||
|
|
||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.