Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .github/workflows/nf-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
NFT_VER: ${{ env.NFT_VER }}
with:
max_shards: 7
tags: ${{ github.event_name == 'pull_request' && 'small' || '' }}

- name: debug
run: |
Expand Down Expand Up @@ -100,6 +101,7 @@ jobs:
profile: ${{ matrix.profile }}
shard: ${{ matrix.shard }}
total_shards: ${{ env.TOTAL_SHARDS }}
tags: ${{ github.event_name == 'pull_request' && 'small' || '' }}

- name: Report test status
if: ${{ always() }}
Expand Down
48 changes: 42 additions & 6 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,20 @@ process {
//

withName: '.*:MINIMAP2_ALIGN' {
ext.prefix = { "${meta.id}_${meta.type}_mapped" }
ext.prefix = { "${meta.id}_${meta.type}_rep${meta.replicate}_mapped" }
ext.args = {
def platform_arg = meta.platform == 'pb' ?
( params.minimap2_pb_model ? "-ax $params.minimap2_pb_model" : "-ax map-hifi" ) :
( params.minimap2_ont_model ? "-ax $params.minimap2_ont_model" : "-ax lr:hq" )
def secondary_arg = params.save_secondary_alignment ? "--secondary=yes" : "--secondary=no"
def pl = meta.platform == 'pb' ? 'PACBIO' : 'ONT'
def rg = "@RG\\tID:${meta.id}_${meta.type}_rep${meta.replicate}\\tSM:${meta.id}\\tLB:${meta.id}_${meta.type}\\tPL:${pl}"
[
meta.platform == 'pb' ? ( params.minimap2_pb_model ? "-ax $params.minimap2_pb_model" : "-ax map-hifi" ) :
( params.minimap2_ont_model ? "-ax $params.minimap2_ont_model" : "-ax lr:hq " ),
params.save_secondary_alignment ? "--secondary=yes " : "--secondary=no ",
platform_arg,
secondary_arg,
"-y",
"-Y"
"-Y",
"-R '${rg}'"
].join(' ').trim()
}
ext.args4 = "-T '*'"
Expand All @@ -303,6 +309,19 @@ process {
]
}

withName: '.*:SAMTOOLS_MERGE' {
ext.prefix = { "${meta.id}_${meta.type}_mapped" }
publishDir = [
enabled: false
]
}

withName: '.*:SAMTOOLS_INDEX_MERGE' {
publishDir = [
enabled: false
]
}

//
// Methylation related processes
//
Expand Down Expand Up @@ -359,13 +378,20 @@ process {
]
}
withName: '.*:LONGPHASE_PHASE_SOMATIC' {
ext.prefix = { "somatic_smallvariants" }
ext.prefix = { "somatic_smallvariants_combined" }
ext.args = {
[
meta.platform == 'pb' ? '--pb' : '--ont',
"--indels",
].join(' ').trim()
}
// Intermediate output (somatic+germline combined); filtered version published below
publishDir = [
enabled: false
]
}
withName: '.*:PHASING_HAPLOTYPING:BCFTOOLS_VIEW' {
ext.prefix = { "somatic_smallvariants" }
publishDir = [
path: { "${params.outdir}/${meta.id}/variants/phased" },
mode: params.publish_dir_mode,
Expand Down Expand Up @@ -430,6 +456,16 @@ process {
enabled: false
]
}
withName: '.*:GERMLINE_CONSENSUS:BCFTOOLS_SORT_CONSENSUS' {
ext.prefix = { "${meta.id}_germline_sorted" }
ext.args = { '-Oz -W=tbi' }
publishDir = [ enabled: false ]
}
withName: '.*:SOMATIC_CONSENSUS:BCFTOOLS_SORT_CONSENSUS' {
ext.prefix = { "${meta.id}_somatic_sorted" }
ext.args = { '-Oz -W=tbi' }
publishDir = [ enabled: false ]
}
withName: '.*:GERMLINE_CONSENSUS:SORT_POST_NORM' {
ext.prefix = { "${meta.id}.${meta.caller}_norm_sorted" }
ext.args = { '-Oz -W=tbi' }
Expand Down
2 changes: 1 addition & 1 deletion conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ params {
fasta = "https://raw.githubusercontent.com/IntGenomicsLab/test-datasets/main/references/GRCh38_chr19.fasta.gz"

// Additional params
genome = "CHM13"
genome = "GRCh38"
vep_genome = "WBcel235"
vep_species = "caenorhabditis_elegans"
skip_wakhan = true
Expand Down
5 changes: 5 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@
"git_sha": "1d2fbdcbca677bbe8da0f9d0d2bb7c02f2cab1c9",
"installed_by": ["modules"]
},
"samtools/merge": {
"branch": "master",
"git_sha": "6d46786420b4d7bc88eba026eb389c0c5535d120",
"installed_by": ["modules"]
},
"samtools/stats": {
"branch": "master",
"git_sha": "fe93fde0845f907fc91ad7cc7d797930408824df",
Expand Down
9 changes: 9 additions & 0 deletions modules/local/bcftools/view/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
# renovate: datasource=conda depName=bioconda/htslib
- bioconda::bcftools=1.22
- bioconda::htslib=1.22.1
40 changes: 40 additions & 0 deletions modules/local/bcftools/view/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
process BCFTOOLS_VIEW {
tag "${meta.id}"
label 'process_medium'

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/47/474a5ea8dc03366b04df884d89aeacc4f8e6d1ad92266888e7a8e7958d07cde8/data'
: 'community.wave.seqera.io/library/bcftools_htslib:0a3fa2654b52006f'}"

input:
tuple val(meta), path(vcf), path(tbi), path(targets), path(targets_tbi)

output:
tuple val(meta), path("*.vcf.gz"), emit: vcf
tuple val(meta), path("*.tbi"), emit: tbi
tuple val("${task.process}"), val('bcftools'), eval("bcftools --version | sed '1!d; s/^.*bcftools //'"), topic: versions, emit: versions_bcftools

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

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
bcftools view \\
-T ${targets} \\
-Oz \\
-W=tbi \\
${args} \\
-o ${prefix}.vcf.gz \\
${vcf}
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
echo '' | gzip > ${prefix}.vcf.gz
touch ${prefix}.vcf.gz.tbi
"""
}
56 changes: 56 additions & 0 deletions modules/local/bcftools/view/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: bcftools_view
description: Filter VCF to positions defined by a targets file using bcftools view -T
keywords:
- filtering
- VCF
- variant calling
tools:
- view:
description: VCF/BCF conversion, view, subset and filter VCF/BCF files.
homepage: http://samtools.github.io/bcftools/bcftools.html
documentation: http://www.htslib.org/doc/bcftools.html
tool_dev_url: https://github.com/samtools/bcftools
doi: "10.1093/bioinformatics/btp352"
licence: ["MIT"]
identifier: biotools:bcftools
input:
- - meta:
type: map
description: Groovy Map containing sample information e.g. [ id:'test' ]
- vcf:
type: file
description: Input VCF/BCF file to filter
pattern: "*.{vcf.gz,vcf,bcf}"
- tbi:
type: file
description: Tabix index of the input VCF
pattern: "*.tbi"
- targets:
type: file
description: VCF file used as position filter (-T)
pattern: "*.{vcf.gz,vcf,bcf}"
- targets_tbi:
type: file
description: Tabix index of the targets VCF
pattern: "*.tbi"
output:
vcf:
- - meta:
type: map
description: Groovy Map containing sample information
- "*.vcf.gz":
type: file
description: Filtered VCF file
pattern: "*.vcf.gz"
tbi:
- - meta:
type: map
description: Groovy Map containing sample information
- "*.tbi":
type: file
description: Tabix index of filtered VCF
pattern: "*.tbi"
authors:
- "@rforsyth"
maintainers:
- "@rforsyth"
4 changes: 2 additions & 2 deletions modules/local/deepsomatic/postprocessvariants/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ process DEEPSOMATIC_POSTPROCESSVARIANTS {
error "DEEPSOMATIC module does not support Conda. Please use Docker / Singularity / Podman instead."
}
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
prefix = task.ext.prefix ?: "${meta.id}_somatic"

def regions = intervals ? "--regions ${intervals}" : ""
def variant_calls_tfrecord_name = variant_calls_tfrecord_files[0].name.replaceFirst(/-\d{5}-of-\d{5}/, "")
Expand Down Expand Up @@ -121,7 +121,7 @@ process DEEPSOMATIC_POSTPROCESSVARIANTS {
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
error "DEEPVARIANT module does not support Conda. Please use Docker / Singularity / Podman instead."
}
prefix = task.ext.prefix ?: "${meta.id}"
prefix = task.ext.prefix ?: "${meta.id}_somatic"
"""
echo "" | gzip > ${prefix}.vcf.gz
touch ${prefix}.vcf.gz.tbi
Expand Down
4 changes: 2 additions & 2 deletions modules/nf-core/deepvariant/postprocessvariants/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions modules/nf-core/samtools/merge/environment.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 49 additions & 0 deletions modules/nf-core/samtools/merge/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading