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
7 changes: 7 additions & 0 deletions modules/nf-core/parsesdrf/convert/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::sdrf-pipelines=0.1.4"
81 changes: 81 additions & 0 deletions modules/nf-core/parsesdrf/convert/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
process PARSESDRF_CONVERT {
tag "${meta.id}"
label 'process_single'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/sdrf-pipelines:0.1.4--pyhdfd78af_0':
'quay.io/biocontainers/sdrf-pipelines:0.1.4--pyhdfd78af_0' }"

input:
tuple val(meta), path(sdrf)
val format

output:
tuple val(meta), path("${prefix}_samplesheet.tsv"), path("${prefix}_presets.tsv"), emit: mhcquant, optional: true
tuple val(meta), path("${prefix}_samplesheet.tsv"), path("${prefix}_experimental_design.tsv"), emit: openms, optional: true
tuple val(meta), path("${prefix}.xml"), path("${prefix}_design.txt"), emit: maxquant, optional: true
tuple val(meta), path("${prefix}.csv"), emit: msstats, optional: true
tuple val(meta), path("${prefix}_design.csv"), path("${prefix}_comparisons.csv"), emit: normalyzerde, optional: true
tuple val(meta), path("${prefix}.cfg"), path("${prefix}_design.tsv"), emit: diann, optional: true
tuple val("${task.process}"), val('sdrf-pipelines'), eval("parse_sdrf --version | cut -d ' ' -f 2"), topic: versions, emit: versions_sdrfpipelines

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

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

if (format == 'mhcquant') {
output_args = "-os ${prefix}_samplesheet.tsv -op ${prefix}_presets.tsv"
} else if (format == 'openms') {
// convert-openms writes openms.tsv + (optionally) experimental_design.tsv
post = "mv openms.tsv ${prefix}_samplesheet.tsv ; [ -f experimental_design.tsv ] && mv experimental_design.tsv ${prefix}_experimental_design.tsv || true"
} else if (format == 'maxquant') {
// --fastafilepath and --raw_folder must be supplied via task.ext.args
output_args = "-o1 ${prefix}.xml -o2 ${prefix}_design.txt"
} else if (format == 'msstats') {
output_args = "-o ${prefix}.csv"
} else if (format == 'normalyzerde') {
output_args = "-o ${prefix}_design.csv -oc ${prefix}_comparisons.csv"
} else if (format == 'diann') {
// convert-diann writes diann_config.cfg + diann_design.tsv with fixed names
post = "mv diann_config.cfg ${prefix}.cfg && mv diann_design.tsv ${prefix}_design.tsv"
} else {
error "PARSESDRF_CONVERT: unsupported format '${format}' (expected one of: mhcquant, openms, maxquant, msstats, normalyzerde, diann)"
}

"""
parse_sdrf convert-${format} \\
-s ${sdrf} \\
${output_args} \\
${args}
${post}
"""

stub:
prefix = task.ext.prefix ?: "${meta.id}"
def stub_files
if (format == 'mhcquant') {
stub_files = ["${prefix}_samplesheet.tsv", "${prefix}_presets.tsv"]
} else if (format == 'openms') {
stub_files = ["${prefix}_samplesheet.tsv", "${prefix}_experimental_design.tsv"]
} else if (format == 'maxquant') {
stub_files = ["${prefix}.xml", "${prefix}_design.txt"]
} else if (format == 'msstats') {
stub_files = ["${prefix}.csv"]
} else if (format == 'normalyzerde') {
stub_files = ["${prefix}_design.csv", "${prefix}_comparisons.csv"]
} else if (format == 'diann') {
stub_files = ["${prefix}.cfg", "${prefix}_design.tsv"]
} else {
error "PARSESDRF_CONVERT: unsupported format '${format}'"
}
def touches = stub_files.collect { f -> "touch ${f}" }.join('\n ')
"""
${touches}
"""
}
168 changes: 168 additions & 0 deletions modules/nf-core/parsesdrf/convert/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
name: "parsesdrf_convert"
description: |
Convert an SDRF (Sample and Data Relationship Format) file into a
pipeline-specific samplesheet/configuration using the `parse_sdrf
convert-<format>` subcommands of the sdrf-pipelines package. The chosen
`format` selects the subcommand; the module owns the output filenames and
emits one tuple per supported format (mhcquant, openms, maxquant, msstats,
normalyzerde, diann).
keywords:
- sdrf
- sdrf-pipelines
- samplesheet
- proteomics
- immunopeptidomics
- mhcquant
- openms
- maxquant
- msstats
- normalyzerde
- diann
- metadata
tools:
- "sdrf-pipelines":
description: "A set of tools to validate and convert SDRF files for proteomics
pipelines."
homepage: "https://github.com/bigbio/sdrf-pipelines"
documentation: "https://github.com/bigbio/sdrf-pipelines"
tool_dev_url: "https://github.com/bigbio/sdrf-pipelines"
doi: "10.1021/acs.jproteome.1c00505"
licence:
- "Apache-2.0"
identifier: "biotools:sdrf-pipelines"
input:
- - meta:
type: map
description: |
Groovy Map containing sample/run information
e.g. `[ id:'PXD009752' ]`
- sdrf:
type: file
description: SDRF file describing the experimental design and sample metadata.
pattern: "*.{tsv,sdrf.tsv}"
ontologies:
- edam: http://edamontology.org/format_3475
- format:
type: string
description: |
Target converter. One of: `mhcquant`, `openms`, `maxquant`,
`msstats`, `normalyzerde`, `diann`. Selects the
`parse_sdrf convert-<format>` subcommand. For `maxquant`, the
required `--fastafilepath` and `--raw_folder` arguments must be
passed via `task.ext.args`.
output:
mhcquant:
- - meta:
type: map
description: Groovy Map containing sample/run information
- "${prefix}_samplesheet.tsv":
type: file
description: MHCquant samplesheet TSV (`-os`).
pattern: "*_samplesheet.tsv"
ontologies:
- edam: http://edamontology.org/format_3475
- "${prefix}_presets.tsv":
type: file
description: MHCquant search-preset TSV (`-op`).
pattern: "*_presets.tsv"
ontologies:
- edam: http://edamontology.org/format_3475
openms:
- - meta:
type: map
description: Groovy Map containing sample/run information
- "${prefix}_samplesheet.tsv":
type: file
description: OpenMS samplesheet TSV (renamed from `openms.tsv`).
pattern: "*_samplesheet.tsv"
ontologies:
- edam: http://edamontology.org/format_3475
- "${prefix}_experimental_design.tsv":
type: file
description: OpenMS experimental design TSV.
pattern: "*_experimental_design.tsv"
ontologies:
- edam: http://edamontology.org/format_3475
maxquant:
- - meta:
type: map
description: Groovy Map containing sample/run information
- "${prefix}.xml":
type: file
description: MaxQuant `mqpar.xml` (`-o1`). Requires `aux=[fasta, raw_folder]`.
pattern: "*.xml"
ontologies:
- edam: http://edamontology.org/format_2332
- "${prefix}_design.txt":
type: file
description: MaxQuant experimental design TXT (`-o2`).
pattern: "*_design.txt"
ontologies:
- edam: http://edamontology.org/format_3475
msstats:
- - meta:
type: map
description: Groovy Map containing sample/run information
- "${prefix}.csv":
type: file
description: MSstats annotation CSV (`-o`).
pattern: "*.csv"
ontologies:
- edam: http://edamontology.org/format_3752
normalyzerde:
- - meta:
type: map
description: Groovy Map containing sample/run information
- "${prefix}_design.csv":
type: file
description: NormalyzerDE design CSV (`-o`).
pattern: "*_design.csv"
ontologies:
- edam: http://edamontology.org/format_3752
- "${prefix}_comparisons.csv":
type: file
description: NormalyzerDE comparisons CSV (`-oc`).
pattern: "*_comparisons.csv"
ontologies:
- edam: http://edamontology.org/format_3752
diann:
- - meta:
type: map
description: Groovy Map containing sample/run information
- "${prefix}.cfg":
type: file
description: DIA-NN config (renamed from `diann_config.cfg`).
pattern: "*.cfg"
ontologies:
- edam: http://edamontology.org/format_2330
- "${prefix}_design.tsv":
type: file
description: DIA-NN experimental design TSV (renamed from `diann_design.tsv`).
pattern: "*_design.tsv"
ontologies:
- edam: http://edamontology.org/format_3475
versions_sdrfpipelines:
- - "${task.process}":
type: string
description: The name of the process
- "sdrf-pipelines":
type: string
description: The name of the tool
- "parse_sdrf --version | cut -d ' ' -f 2":
type: eval
description: The expression to obtain the version of the tool
topics:
versions:
- - "${task.process}":
type: string
description: The name of the process
- "sdrf-pipelines":
type: string
description: The name of the tool
- "parse_sdrf --version | cut -d ' ' -f 2":
type: eval
description: The expression to obtain the version of the tool
authors:
- "@jonasscheid"
maintainers:
- "@jonasscheid"
Loading
Loading