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

Hiphase - new module #6854

Merged
merged 44 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
9881c76
basic setup
tanyasarkjain Sep 27, 2024
0c9a172
pbsv
tanyasarkjain Sep 27, 2024
5339e16
[automated] Fix linting with Prettier
nf-core-bot Oct 22, 2024
dc0a3a1
version of pbsv module where all the tests pass
tanyasarkjain Oct 22, 2024
71cab1d
getting rid of un-need comments
tanyasarkjain Oct 22, 2024
ec70173
updated:
tanyasarkjain Oct 22, 2024
e6ffe06
changed website:
tanyasarkjain Oct 22, 2024
de912b1
update
tanyasarkjain Oct 22, 2024
763cc70
deleting accidental file
tanyasarkjain Oct 22, 2024
a4e0099
small tweak
tanyasarkjain Oct 22, 2024
1ded937
updating the meta description
tanyasarkjain Oct 22, 2024
b7a62e5
pretty
tanyasarkjain Oct 22, 2024
23b2631
removing trailing space
tanyasarkjain Oct 22, 2024
e8f1cc8
space
tanyasarkjain Oct 22, 2024
108d99c
newline
tanyasarkjain Oct 22, 2024
9c921cf
should pass version test
tanyasarkjain Oct 22, 2024
2843980
hiphase template
tanyasarkjain Oct 22, 2024
c77ddb2
Merge branch 'master' into pbsv
fellen31 Oct 25, 2024
51a55cf
pretty
tanyasarkjain Oct 25, 2024
d3cab84
passes all tests
Oct 25, 2024
be694db
prettier
Oct 25, 2024
fe1e581
Merge branch 'master' into hiphase
tanyasarkjain Oct 25, 2024
95e19a3
linting
Oct 25, 2024
3dba0a3
Merge branch 'hiphase' of https://github.com/tanyasarkjain/modules in…
Oct 25, 2024
5cdf55f
Update modules/nf-core/hiphase/tests/main.nf.test
tanyasarkjain Oct 26, 2024
d79b6f1
changed pbsv to pbsv/discover - seperating functionality
tanyasarkjain Oct 28, 2024
a544367
Merge branch 'master' into hiphase
tanyasarkjain Oct 29, 2024
8958816
license name change
tanyasarkjain Oct 29, 2024
e04bdb3
added another test
tanyasarkjain Oct 29, 2024
ac80ea0
update
Oct 30, 2024
ba15e72
pbsv/call
tanyasarkjain Oct 31, 2024
a6f3b0f
update
tanyasarkjain Oct 31, 2024
24248d9
Merge branch 'master' into pbsv_call
tanyasarkjain Oct 31, 2024
e336cd5
fixed spacing
tanyasarkjain Oct 31, 2024
c932222
Merge branch 'pbsv_call' of https://github.com/tanyasarkjain/modules …
tanyasarkjain Oct 31, 2024
392466a
adding end line
tanyasarkjain Oct 31, 2024
9037ba2
Merge branch 'pbsv_call' of https://github.com/tanyasarkjain/modules …
Oct 31, 2024
0425ef8
Update modules/nf-core/hiphase/main.nf
tanyasarkjain Nov 6, 2024
6b4bf3a
Update modules/nf-core/hiphase/main.nf
tanyasarkjain Nov 6, 2024
269d3ad
changes
tanyasarkjain Nov 6, 2024
938004f
Merge branch 'hiphase' of https://github.com/tanyasarkjain/modules in…
Nov 6, 2024
5c02b72
Merge branch 'master' into hiphase
tanyasarkjain Nov 6, 2024
5471b2f
fixed spacing and pbsv issue
Nov 6, 2024
b18f2ba
Merge branch 'master' into hiphase
sateeshperi Nov 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions modules/nf-core/hiphase/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
- "bioconda::hiphase=1.4.5"
58 changes: 58 additions & 0 deletions modules/nf-core/hiphase/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
process HIPHASE {
tag "$meta.id"
label 'process_single'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/hiphase:1.4.5--h9ee0642_0':
'biocontainers/hiphase:1.4.5--h9ee0642_0' }"

input:
tuple val(meta), path(vcf)
tuple val(meta1), path(csi)
tanyasarkjain marked this conversation as resolved.
Show resolved Hide resolved
tuple val(meta2), path(bam)
tuple val(meta3), path(bai)
tuple val(meta4), path(fasta)

output:
tuple val(meta), path("*.vcf"), emit: vcf
tuple val(meta), path("*.csv"), emit: csv
tanyasarkjain marked this conversation as resolved.
Show resolved Hide resolved
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

"""
hiphase \
--bam $bam \
--vcf $vcf \
--output-vcf ${prefix}.phased.vcf \
--output-bam ${prefix}.phased.bam \
--reference $fasta \
--stats-file ${prefix}.stats.csv \
$args \
--threads ${task.cpus}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
hiphase: \$(hiphase --version |& sed '1!d ; s/hiphase //')
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
tanyasarkjain marked this conversation as resolved.
Show resolved Hide resolved
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.phased.vcf
touch ${prefix}.stats.csv

cat <<-END_VERSIONS > versions.yml
"${task.process}":
hiphase: \$(hiphase --version |& sed '1!d ; s/hiphase //')
END_VERSIONS
"""
}
94 changes: 94 additions & 0 deletions modules/nf-core/hiphase/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "hiphase"
description: write your description here
tanyasarkjain marked this conversation as resolved.
Show resolved Hide resolved
keywords:
- sort
- example
- genomics
tools:
- "hiphase":
description: "Small and structural variant phasing tool for PacBio HiFi reads"
homepage: "https://github.com/PacificBiosciences/HiPhase"
documentation: "https://github.com/PacificBiosciences/HiPhase"
tool_dev_url: "https://github.com/PacificBiosciences/HiPhase"
doi: "10.1234/placeholder.doi"
tanyasarkjain marked this conversation as resolved.
Show resolved Hide resolved
licence: ["Pacific Biosciences Software License Agreement"]
identifier: biotools:hiphase
input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- vcf:
type: file
description: VCF File
pattern: "*.{vcf}"
- - meta1:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- csi:
type: file
description: CSI File associated with VCF
pattern: "*.{csi}"
- - meta2:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- bam:
type: file
description: Sorted BAM/CRAM/SAM file
pattern: "*.{bam}"
- - meta3:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- bai:
type: file
description: Index File BAI associated with BAM file
pattern: "*.{bai}"
- - meta4:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- fasta:
type: file
description: FASTA File (used for the alignment of the BAM file)
pattern: "*.{fasta}"
output:
- vcf:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- "*.vcf":
type: file
description: Phased VCF file
pattern: "*.vcf"
- csv:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- "*.csv":
type: file
description: stats associated with the phasing
pattern: "*.csv"

- versions:
- "versions.yml":
type: file
description: File containing software versions
pattern: "versions.yml"

authors:
- "@tanyasarkjain"
maintainers:
- "@tanyasarkjain"
98 changes: 98 additions & 0 deletions modules/nf-core/hiphase/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
nextflow_process {
name "Test Process HIPHASE"
script "../main.nf"
process "HIPHASE"

tag "modules"
tag "modules_nfcore"
tag "hiphase"

test("homo_sapiens pacbio [vcf] [csi] [bam] [bai] [fasta]") {
when {
process {
"""
input[0] = [
[ id:'test' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/vcf/NA03697B2_new.pbmm2.repeats.vcf.gz', checkIfExists: true),
]

input[1] = [
[ id:'test' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/vcf/NA03697B2_new.pbmm2.repeats.vcf.gz.csi', checkIfExists: true),
]

input[2] = [
[ id:'test' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/NA03697B2_downsampled.pbmm2.repeats.bam', checkIfExists: true),
]

input[3] = [
[ id:'test' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/NA03697B2_downsampled.pbmm2.repeats.bam.bai', checkIfExists: true),
]

input[4] = [
[ id:'test' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome3.fasta', checkIfExists: true),
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert file(process.out.vcf[0][1]).name == "test.phased.vcf" },
sateeshperi marked this conversation as resolved.
Show resolved Hide resolved
{ assert file(process.out.csv[0][1]).name == "test.stats.csv" },
{ assert snapshot(process.out).match() }

)
}

}

test("hiphase - vcf - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/vcf/NA03697B2_new.pbmm2.repeats.vcf.gz', checkIfExists: true),
]

input[1] = [
[ id:'test' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/vcf/NA03697B2_new.pbmm2.repeats.vcf.gz.csi', checkIfExists: true),
]

input[2] = [
[ id:'test' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/NA03697B2_downsampled.pbmm2.repeats.bam', checkIfExists: true),
]

input[3] = [
[ id:'test' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/NA03697B2_downsampled.pbmm2.repeats.bam.bai', checkIfExists: true),
]

input[4] = [
[ id:'test' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome3.fasta', checkIfExists: true),
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}

}
100 changes: 100 additions & 0 deletions modules/nf-core/hiphase/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"hiphase - vcf - stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.phased.vcf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
[
{
"id": "test"
},
"test.stats.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"2": [
"versions.yml:md5,bdbe594b7912bdb1acefa03993d4ddf7"
],
"csv": [
[
{
"id": "test"
},
"test.stats.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"vcf": [
[
{
"id": "test"
},
"test.phased.vcf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,bdbe594b7912bdb1acefa03993d4ddf7"
]
}
],
"meta": {
"nf-test": "0.9.1",
"nextflow": "24.04.4"
},
"timestamp": "2024-10-25T15:30:16.272259201"
},
"homo_sapiens pacbio [vcf] [csi] [bam] [bai] [fasta]": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.phased.vcf:md5,8d27a1ef3c4b28662a7559ea2ccc4681"
]
],
"1": [
[
{
"id": "test"
},
"test.stats.csv:md5,9901e909f6898db2b2a9d083a4f478d5"
]
],
"2": [
"versions.yml:md5,bdbe594b7912bdb1acefa03993d4ddf7"
],
"csv": [
[
{
"id": "test"
},
"test.stats.csv:md5,9901e909f6898db2b2a9d083a4f478d5"
]
],
"vcf": [
[
{
"id": "test"
},
"test.phased.vcf:md5,8d27a1ef3c4b28662a7559ea2ccc4681"
]
],
"versions": [
"versions.yml:md5,bdbe594b7912bdb1acefa03993d4ddf7"
]
}
],
"meta": {
"nf-test": "0.9.1",
"nextflow": "24.04.4"
},
"timestamp": "2024-10-29T17:04:42.688669247"
}
}
Loading