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
279 changes: 279 additions & 0 deletions modules/meta-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,279 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"title": "Meta yaml",
"description": "Validate the meta yaml file for an nf-core module",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of the module"
},
"description": {
"type": "string",
"description": "Description of the module"
},
"keywords": {
"type": "array",
"description": "Keywords for the module",
"items": {
"type": "string",
"not": {
"const": "example"
}
},
"uniqueItems": true,
"minItems": 3
},
"authors": {
"type": "array",
"description": "Authors of the module",
"items": {
"type": "string"
}
},
"maintainers": {
"type": "array",
"description": "Maintainers of the module",
"items": {
"type": "string"
}
},
"extra_args": {
"type": "array",
"description": "Extra arguments for the module",
"items": {
"type": "object",
"properties": {
"description": {
"type": "string",
"description": "Description of the argument"
}
}
}
},
"input": {
"type": "array",
"description": "Input channels for the module",
"items": {
"oneOf": [
{
"type": "array",
"items": {
"type": "object",
"patternProperties": {
".*": {
"$ref": "#/definitions/elementProperties"
}
}
}
},
{
"type": "object",
"patternProperties": {
".*": {
"$ref": "#/definitions/elementProperties"
}
}
}
]
}
},
"output": {
"type": "object",
"description": "Output channels for the module",
"patternProperties": {
".*": {
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"patternProperties": {
".*": {
"$ref": "#/definitions/elementProperties"
}
}
},
{
"type": "array",
"items": {
"type": "object",
"patternProperties": {
".*": {
"$ref": "#/definitions/elementProperties"
}
}
}
}
]
}
}
}
},
"tools": {
"type": "array",
"description": "Tools used by the module",
"items": {
"type": "object",
"patternProperties": {
".*": {
"type": "object",
"properties": {
"description": {
"type": "string",
"description": "Description of the output channel"
},
"homepage": {
"type": "string",
"description": "Homepage of the tool",
"pattern": "^(http|https)://.*$"
},
"documentation": {
"type": "string",
"description": "Documentation of the tool",
"pattern": "^(http|https|ftp)://.*$"
},
"tool_dev_url": {
"type": "string",
"description": "URL of the development version of the tool's documentation",
"pattern": "^(http|https)://.*$"
},
"doi": {
"description": "DOI of the tool",
"anyOf": [
{
"type": "string",
"pattern": "^10\\.\\d{4,9}\\/[^,]+$"
},
{
"type": "string",
"enum": [
"no DOI available"
]
}
]
},
"licence": {
"type": "array",
"items": {
"type": "string"
},
"description": "Licence of the tool",
"minItems": 1,
"uniqueItems": true,
"message": "Licence must be an array of one or more entries, e.g. [\"MIT\"]"
},
"identifier": {
"description": "bio.tools identifier of the tool",
"anyOf": [
{
"type": "string",
"pattern": "^biotools:.*$"
},
{
"type": "string",
"maxLength": 0
}
]
}
},
"required": [
"description"
],
"anyOf": [
{
"required": [
"homepage"
]
},
{
"required": [
"documentation"
]
},
{
"required": [
"tool_dev_url"
]
},
{
"required": [
"doi"
]
}
]
}
}
}
}
},
"definitions": {
"elementProperties": {
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "Type of the channel element",
"enum": [
"map",
"file",
"directory",
"string",
"integer",
"float",
"boolean",
"list"
]
},
"description": {
"type": "string",
"description": "Description of the channel"
},
"pattern": {
"type": "string",
"description": "Pattern of the channel, given in Java glob syntax"
},
"enum": {
"type": "array",
"description": "List of allowed values for the channel",
"items": {
"type": [
"string",
"number",
"boolean",
"array",
"object"
]
},
"uniqueItems": true
},
"ontologies": {
"type": "array",
"description": "List of ontologies for the channel",
"uniqueItems": true,
"items": {
"type": "object",
"patternProperties": {
".*": {
"type": "string",
"pattern": "^(http|https)://.*"
}
}
}
}
},
"required": [
"type",
"description"
]
}
},
"required": [
"name",
"description",
"keywords",
"authors",
"output",
"tools"
]
}
25 changes: 25 additions & 0 deletions modules/sanger-cellgeni/csv/concat/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
process CSV_CONCAT {
tag "Concatenating CSV files"
container 'docker://quay.io/cellgeni/metacells-python:latest'

input:
tuple val(meta), path(csv_files, name: "input/*.csv")

output:
tuple val(meta), path("*.csv"), emit: csv
tuple val(meta), path("*.json"), emit: json
path "versions.yml", emit: versions

script:
def prefix = task.ext.prefix ?: "concatenated"
def args = task.ext.args ?: ""
"""
concat.py --input ${csv_files} --prefix "${prefix}" ${args}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
python: \$(python --version | awk '{print \$2}')
pandas: \$( python -c "import pandas; print(pandas.__version__)" )
END_VERSIONS
"""
}
67 changes: 67 additions & 0 deletions modules/sanger-cellgeni/csv/concat/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "csv_concat"
description:
"Module to concatenate multiple CSV files into a single CSV and JSON
output"
keywords:
- csv
- concatenate
- merge
- pandas
- json
tools:
- pandas:
description: Powerful data structures for data analysis, time series, and
statistics
homepage: https://pandas.pydata.org/
documentation: https://pandas.pydata.org/docs/
licence: ["BSD-3-Clause"]
identifier: "biotools:pandas"
input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- csv_files:
type: file
description: "Multiple CSV files to be concatenated"
pattern: "*.csv"
ontologies:
- edam: http://edamontology.org/format_3752 # CSV
output:
csv:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- "*.csv":
type: file
description: "Concatenated CSV file"
pattern: "*.csv"
ontologies:
- edam: http://edamontology.org/format_3752 # CSV
json:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- "*.json":
type: file
description: "Concatenated data in JSON format"
pattern: "*.json"
ontologies:
- edam: http://edamontology.org/format_3464 # JSON
versions:
- versions.yml:
type: file
description: "YAML file containing software versions used"
pattern: "versions.yml"
ontologies:
- edam: http://edamontology.org/format_3750 # YAML
authors:
- "@claptar"
maintainers:
- "@claptar"
20 changes: 20 additions & 0 deletions modules/sanger-cellgeni/csv/concat/module.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
process {
withName: CSV_CONCAT {
ext.prefix = "metadata"
ext.args = {
[
"--axis 'index'",
"--join 'outer'",
Comment on lines +6 to +7
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The quotes around 'index' are unnecessary and inconsistent. Since this is being passed as a command-line argument, simple quoting (without the inner quotes) would be cleaner: --axis index

Suggested change
"--axis 'index'",
"--join 'outer'",
"--axis index",
"--join outer",

Copilot uses AI. Check for mistakes.
].join(' ')
}
queue = 'normal'
cpus = 1
memory = '2 GB'
publishDir = [
mode: 'link',
path: 'results',
pattern: '*.{csv,json}',
overwrite: true,
]
}
}
Loading