Skip to content

Commit

Permalink
Merge branch 'master' into deprecate_custom_getchromsizes
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundmiller authored Nov 21, 2024
2 parents 61a8a8d + ece675b commit df0ee1c
Show file tree
Hide file tree
Showing 16 changed files with 310 additions and 29 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 @@ -73,8 +73,8 @@ runs:
SENTIEON_LICSRVR_IP: ${{ env.SENTIEON_LICSRVR_IP }}
SENTIEON_AUTH_MECH: "GitHub Actions - token"
TAGS: ${{ inputs.tags && format('--tag {0}', inputs.tags) || '' }}
NFT_WORKDIR: "~"
run: |
NFT_WORKDIR=~ \
nf-test test \
--profile=${{ inputs.profile }} \
--tap=test.tap \
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions .github/scripts/wave_singularity.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# dependencies = [
# "requests",
# "rich",
# "rich_click"
# ]
# ///

Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/gpu-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,17 @@ jobs:
runs-on: ubuntu-latest
outputs:
# Expose detected tags as 'modules' and 'workflows' output variables
paths: ${{ steps.list.outputs.components }}
paths: ${{ steps.outputs.outputs.components }}
modules: ${{ steps.outputs.outputs.modules }}
subworkflows: ${{ steps.outputs.outputs.subworkflows}}
# Prod for version bumping
steps:
- name: Clean Workspace # Purge the workspace in case it's running on a self-hosted runner
uses: AutoModality/[email protected]
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
Expand All @@ -70,7 +74,7 @@ jobs:
echo subworkflows=$(echo '${{ steps.list.outputs.components }}' | jq '. | map(select(contains("subworkflows"))) | map(gsub("subworkflows/nf-core/"; ""))') >> $GITHUB_OUTPUT
- name: debug
run: |
echo ${{ steps.filter.outputs.components }}
echo ${{ steps.outputs.outputs.components }}
echo ${{ steps.outputs.outputs.modules }}
echo ${{ steps.outputs.outputs.subworkflows }}
Expand Down
57 changes: 38 additions & 19 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ jobs:
name: nf-core-changes
runs-on: ubuntu-latest
outputs:
tags: ${{ steps.filter.outputs.changes }}
modules: ${{ steps.tags.outputs.modules }}
subworkflows: ${{ steps.tags.outputs.subworkflows }}
# https://github.com/dorny/paths-filter?tab=readme-ov-file#custom-processing-of-changed-files
modules: ${{ steps.filter.outputs.modules }}
modules_files: ${{ steps.module_names.outputs.result }}
subworkflows: ${{ steps.filter.outputs.subworkflows }}
subworkflows_files: ${{ steps.subworkflow_names.outputs.result }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
Expand All @@ -61,29 +63,46 @@ jobs:
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
id: filter
with:
filters: "tests/config/pytest_modules.yml"
filters: |
modules:
- 'modules/nf-core/**'
- 'tests/modules/nf-core/**'
subworkflows:
- 'subworkflows/nf-core/**'
- 'tests/subworkflows/nf-core/**'
token: ""
list-files: "json"

- name: Fetch module tags
id: tags
run: |
echo modules=$(echo '${{ steps.filter.outputs.changes }}' | jq -c '. | map(select(contains("modules"))) | map(gsub("modules/"; ""))') >> $GITHUB_OUTPUT
echo subworkflows=$(echo '${{ steps.filter.outputs.changes }}' | jq '. | map(select(contains("subworkflow"))) | map(gsub("subworkflows/"; ""))') >> $GITHUB_OUTPUT
- name: Get module name
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
id: module_names
with:
script: |
return [...new Set(${{ steps.filter.outputs.modules_files }}.map(path => path.replace('modules/nf-core/', '').split('/').slice(0,2).filter(x => x !== 'main.nf').join('/')))];
- name: Get subworkflow name
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
id: subworkflow_names
with:
script: |
return [...new Set(${{ steps.filter.outputs.subworkflows_files }}.map(path => path.replace('subworkflows/nf-core/', '').split('/').slice(0,2).filter(x => x !== 'main.nf').join('/')))];
- name: debug
run: |
echo ${{ steps.tags.outputs.modules }}
echo ${{ steps.tags.outputs.subworkflows }}
echo ${{ steps.filter.outputs.modules_files }}
echo ${{ steps.filter.outputs.subworkflows_files }}
echo ${{ steps.module_names.outputs.result }}
echo ${{ steps.subworkflow_names.outputs.result }}
nf-core-lint-modules:
runs-on: ${{ github.event.inputs.runners || 'self-hosted' }}
name: nf-core lint modules
needs: nf-core-changes
if: ${{ (needs.nf-core-changes.outputs.modules != '[]') }}
if: ${{ (needs.nf-core-changes.outputs.modules == 'true') }}
strategy:
fail-fast: false
matrix:
tags: "${{ fromJson(needs.nf-core-changes.outputs.modules) }}"
module: "${{ fromJson(needs.nf-core-changes.outputs.modules_files) }}"
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

Expand Down Expand Up @@ -114,18 +133,18 @@ jobs:
- name: Install nf-core tools development version
run: python -m pip install --upgrade --force-reinstall git+https://github.com/nf-core/tools.git@dev

- name: Lint module ${{ matrix.tags }}
run: nf-core modules lint ${{ matrix.tags }}
- name: Lint module ${{ matrix.module }}
run: nf-core modules lint ${{ matrix.module }}

nf-core-lint-subworkflows:
runs-on: ubuntu-latest
name: nf-core lint subworkflows
needs: nf-core-changes
if: ${{ (needs.nf-core-changes.outputs.subworkflows != '[]') }}
if: ${{ (needs.nf-core-changes.outputs.subworkflows == 'true') }}
strategy:
fail-fast: false
matrix:
tags: "${{ fromJson(needs.nf-core-changes.outputs.subworkflows) }}"
subworkflow: "${{ fromJson(needs.nf-core-changes.outputs.subworkflows_files) }}"
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

Expand All @@ -148,8 +167,8 @@ jobs:
- name: Install nf-core tools development version
run: python -m pip install --upgrade --force-reinstall git+https://github.com/nf-core/tools.git@dev

- name: Lint module ${{ matrix.tags }}
run: nf-core subworkflows lint ${{ matrix.tags }}
- name: Lint subworkflow ${{ matrix.subworkflow }}
run: nf-core subworkflows lint ${{ matrix.subworkflow }}

confirm-pass:
runs-on: ubuntu-latest
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/nf-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ jobs:
SENTIEON_ENCRYPTION_KEY: ${{ secrets.SENTIEON_ENCRYPTION_KEY }}
steps:
- name: Clean Workspace # Purge the workspace in case it's running on a self-hosted runner
uses: AutoModality/[email protected]
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/wave.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,14 @@ jobs:
# if: github.repository == 'nf-core/modules'
if: ${{ needs.generate-matrix.outputs.docker-matrix != '[]' }}
needs: generate-matrix
name: Build Dockerfile-based ${{ matrix.profile }} Container
name: Build Dockerfile-based Container
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
max-parallel: 4
matrix:
files: "${{ fromJson(needs.generate-matrix.outputs.docker-matrix) }}"
profile: [docker, singularity]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

Expand All @@ -117,11 +116,8 @@ jobs:
- name: Build ${{ matrix.profile }} container
# NOTE If you're changing a Dockerfile and this is running, try to update the Dockerfile to build with wave
continue-on-error: false
env:
PROFILE: ${{ (contains(matrix.profile, 'singularity') && '--singularity') || '' }}
run: |
wave -f "${{ matrix.files }}" \
$PROFILE \
--freeze \
--await \
--build-repo quay.io/nf-core/modules/${{steps.registry-name.outputs.result}} \
Expand Down
6 changes: 6 additions & 0 deletions modules/nf-core/regtools/junctionsextract/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
- "bioconda::regtools=0.5.0"
45 changes: 45 additions & 0 deletions modules/nf-core/regtools/junctionsextract/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
process REGTOOLS_JUNCTIONSEXTRACT {
tag "$meta.id"
label 'process_low'

conda "bioconda::regtools=0.5.0"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/b6/b6c0653189b95b22e16038f61ade205a865857f54eeae9ba0184490a1834f7c9/data' :
'community.wave.seqera.io/library/regtools:0.5.0--b9a260c4c898354a' }"

input:
tuple val(meta), path(bam), path(bai)

output:
tuple val(meta), path("*.junc"), emit: junc
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}"
"""
regtools junctions extract \\
$args \\
-o ${prefix}.junc \\
$bam
cat <<-END_VERSIONS > versions.yml
"${task.process}":
regtools: \$(regtools --version 2>&1 | grep "Version:" | sed 's/Version:\t//')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.junc
cat <<-END_VERSIONS > versions.yml
"${task.process}":
regtools: \$(regtools --version 2>&1 | grep "Version:" | sed 's/Version:\t//')
END_VERSIONS
"""
}
55 changes: 55 additions & 0 deletions modules/nf-core/regtools/junctionsextract/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "regtools_junctionsextract"
description: Extract exon-exon junctions from an RNAseq BAM file. The output is a
BED file in the BED12 format.
keywords:
- regtools
- leafcutter
- RNA-seq
- splicing
tools:
- "regtools":
description: "RegTools is a set of tools that integrate DNA-seq and RNA-seq data
to help interpret mutations in a regulatory and splicing context."
homepage: "https://regtools.readthedocs.io/en/latest/"
documentation: "https://regtools.readthedocs.io/en/latest/#usage"
tool_dev_url: "https://github.com/griffithlab/regtools"
licence: ["MIT"]
identifier: biotools:regtools

input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- bam:
type: file
description: Sorted BAM file
pattern: "*.{bam}"
- bai:
type: file
description: Index to sorted BAM file
pattern: "*.{bai}"

output:
- junc:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- "*.junc":
type: file
description: |
BED12 file containing exon-exon "regtools_junctionsextract"
pattern: "*.{junc}"
- versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@abartlett004"
maintainers:
- "@abartlett004"
63 changes: 63 additions & 0 deletions modules/nf-core/regtools/junctionsextract/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
nextflow_process {

name "Test Process REGTOOLS_JUNCTIONSEXTRACT"
script "../main.nf"
process "REGTOOLS_JUNCTIONSEXTRACT"

tag "modules"
tag "modules_nfcore"
tag "regtools"
tag "regtools/junctionsextract"

test("homo_sapiens - bam-bai") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/test.rna.paired_end.sorted.chr6.bam", checkIfExists: true),
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/test.rna.paired_end.sorted.chr6.bam.bai", checkIfExists: true)
]
"""
}
}

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

}

test("homo_sapiens - bam-bai - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/test.rna.paired_end.sorted.chr6.bam", checkIfExists: true),
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/test.rna.paired_end.sorted.chr6.bam.bai", checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() },
{ assert snapshot(path(process.out.versions.get(0)).yaml).match("versions") }
)
}

}

}
Loading

0 comments on commit df0ee1c

Please sign in to comment.