Skip to content

Commit

Permalink
Merge branch 'master' into gzrt
Browse files Browse the repository at this point in the history
  • Loading branch information
GallVp authored Jan 7, 2025
2 parents 1784542 + cb8e4c9 commit e0ed20b
Show file tree
Hide file tree
Showing 16 changed files with 389 additions and 199 deletions.
2 changes: 1 addition & 1 deletion .github/actions/nf-test-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ inputs:
runs:
using: "composite"
steps:
- uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4
- uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4
with:
distribution: "temurin"
java-version: "17"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
- name: Install pip
run: python -m pip install --upgrade pip

- uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4
- uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4
with:
distribution: "temurin"
java-version: "17"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pytest-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ jobs:
- name: Install Python dependencies
run: python -m pip install --upgrade pip pytest-workflow cryptography

- uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4
- uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4
with:
distribution: "temurin"
java-version: "17"
Expand Down Expand Up @@ -308,7 +308,7 @@ jobs:

- name: Upload logs on failure
if: failure()
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4
with:
name: logs-${{ matrix.profile }}-${{ steps.parsed.outputs.result }}
path: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wave.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- name: Find conda differences
id: conda-diff
uses: tj-actions/changed-files@bab30c2299617f6615ec02a68b9a40d10bd21366 # v45
uses: tj-actions/changed-files@d6e91a2266cdb9d62096cebf1e8546899c6aa18f # v45
with:
json: true
escape_json: false
Expand All @@ -40,7 +40,7 @@ jobs:
- name: Find Dockerfile differences
id: docker-diff
uses: tj-actions/changed-files@bab30c2299617f6615ec02a68b9a40d10bd21366 # v45
uses: tj-actions/changed-files@d6e91a2266cdb9d62096cebf1e8546899c6aa18f # v45
with:
json: true
escape_json: false
Expand Down
3 changes: 3 additions & 0 deletions modules/nf-core/bcftools/annotate/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ process BCFTOOLS_ANNOTATE {
input:
tuple val(meta), path(input), path(index), path(annotations), path(annotations_index)
path(header_lines)
path(rename_chrs)

output:
tuple val(meta), path("*.{vcf,vcf.gz,bcf,bcf.gz}"), emit: vcf
Expand All @@ -25,6 +26,7 @@ process BCFTOOLS_ANNOTATE {
def prefix = task.ext.prefix ?: "${meta.id}"
def header_file = header_lines ? "--header-lines ${header_lines}" : ''
def annotations_file = annotations ? "--annotations ${annotations}" : ''
def rename_chrs_file = rename_chrs ? "--rename-chrs ${rename_chrs}" : ''
def extension = args.contains("--output-type b") || args.contains("-Ob") ? "bcf.gz" :
args.contains("--output-type u") || args.contains("-Ou") ? "bcf" :
args.contains("--output-type z") || args.contains("-Oz") ? "vcf.gz" :
Expand All @@ -40,6 +42,7 @@ process BCFTOOLS_ANNOTATE {
annotate \\
$args \\
$annotations_file \\
$rename_chrs_file \\
$header_file \\
--output ${prefix}.${extension} \\
--threads $task.cpus \\
Expand Down
3 changes: 3 additions & 0 deletions modules/nf-core/bcftools/annotate/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ input:
- - header_lines:
type: file
description: Contains lines to append to the output VCF header
- - rename_chrs:
type: file
description: Rename annotations according to this file containing "old_name new_name\n" pairs separated by whitespaces, each on a separate line.
output:
- vcf:
- meta:
Expand Down
67 changes: 57 additions & 10 deletions modules/nf-core/bcftools/annotate/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ nextflow_process {
tag "bcftools"
tag "bcftools/annotate"

test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_output") {
test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [], [] - vcf_output") {

config "./vcf.config"

Expand All @@ -24,6 +24,7 @@ nextflow_process {
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true)
]
input[1] = []
input[2] = []
"""
}
}
Expand All @@ -40,7 +41,7 @@ nextflow_process {

}

test("sarscov2 - [vcf, [], annotation, annotation_tbi], [] - vcf_output") {
test("sarscov2 - [vcf, [], annotation, annotation_tbi], [], [] - vcf_output") {

config "./vcf.config"

Expand All @@ -55,6 +56,7 @@ nextflow_process {
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true)
]
input[1] = []
input[2] = []
"""
}
}
Expand All @@ -70,7 +72,7 @@ nextflow_process {
}

}
test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index") {
test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [], [] - vcf_gz_index") {

config "./vcf_gz_index.config"

Expand All @@ -85,6 +87,7 @@ nextflow_process {
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true)
]
input[1] = []
input[2] = []
"""
}
}
Expand All @@ -104,7 +107,7 @@ nextflow_process {

}

test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index_csi") {
test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [], [] - vcf_gz_index_csi") {

config "./vcf_gz_index_csi.config"

Expand All @@ -119,6 +122,7 @@ nextflow_process {
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true)
]
input[1] = []
input[2] = []
"""
}
}
Expand All @@ -138,7 +142,7 @@ nextflow_process {

}

test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index_tbi") {
test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [], [] - vcf_gz_index_tbi") {

config "./vcf_gz_index_tbi.config"

Expand All @@ -153,6 +157,7 @@ nextflow_process {
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true)
]
input[1] = []
input[2] = []
"""
}
}
Expand All @@ -171,7 +176,8 @@ nextflow_process {
}

}
test("sarscov2 - [vcf, [], annotation, annotation_tbi], header - bcf_output") {

test("sarscov2 - [vcf, [], annotation, annotation_tbi], header, [] - bcf_output") {

config "./bcf.config"

Expand All @@ -189,6 +195,7 @@ nextflow_process {
'##INFO=<ID=SGB,Number=1,Type=Float,Description="Segregation based metric.">',
'##INFO=<ID=MQ0F,Number=1,Type=Float,Description="Fraction of MQ0 reads (smaller is better)">'
).collectFile(name:"headers.vcf", newLine:true)
input[2] = []
"""
}
}
Expand All @@ -205,7 +212,43 @@ nextflow_process {

}

test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - stub") {
test("sarscov2 - [vcf, [], annotation, annotation_tbi], header, rename_chrs - vcf_gz_index") {

config "./vcf_gz_index.config"

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true),
[],
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true)
]
input[1] = Channel.of(
'##INFO=<ID=SGB,Number=1,Type=Float,Description="Segregation based metric.">',
'##INFO=<ID=MQ0F,Number=1,Type=Float,Description="Fraction of MQ0 reads (smaller is better)">'
).collectFile(name:"headers.vcf", newLine:true)
input[2] = Channel.of('MT192765.1 renamed').collectFile(name:"rename.txt", newLine:true)
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert path(process.out.vcf.get(0).get(1)).LinesGzip.contains("##contig=<ID=renamed,length=29829>")},
{ assert snapshot(
process.out.vcf.collect { it.collect { it instanceof Map ? it : file(it).name }},
process.out.versions
).match() }
)
}

}

test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [], [] - stub") {

config "./vcf.config"
options "-stub"
Expand All @@ -221,6 +264,7 @@ nextflow_process {
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true)
]
input[1] = []
input[2] = []
"""
}
}
Expand All @@ -234,7 +278,7 @@ nextflow_process {

}

test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index - stub") {
test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [], [] - vcf_gz_index - stub") {

config "./vcf_gz_index.config"
options "-stub"
Expand All @@ -250,6 +294,7 @@ nextflow_process {
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true)
]
input[1] = []
input[2] = []
"""
}
}
Expand All @@ -264,7 +309,7 @@ nextflow_process {

}

test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index_csi - stub") {
test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [], [] - vcf_gz_index_csi - stub") {

config "./vcf_gz_index_csi.config"
options "-stub"
Expand All @@ -280,6 +325,7 @@ nextflow_process {
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true)
]
input[1] = []
input[2] = []
"""
}
}
Expand All @@ -294,7 +340,7 @@ nextflow_process {

}

test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index_tbi - stub") {
test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [], [] - vcf_gz_index_tbi - stub") {

config "./vcf_gz_index_tbi.config"
options "-stub"
Expand All @@ -310,6 +356,7 @@ nextflow_process {
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true)
]
input[1] = []
input[2] = []
"""
}
}
Expand Down
Loading

0 comments on commit e0ed20b

Please sign in to comment.