mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 11:08:17 +00:00
Add eido/validate module (#2048)
* Add eido/validate module * Apply first batch of updates after code review * Remove readlink, update sed, update paths * Move sample table index parameter to config * Update tests/modules/eido/validate/test.yml Co-authored-by: James A. Fellows Yates <jfy133@gmail.com> * Update tests/modules/eido/validate/test.yml Co-authored-by: James A. Fellows Yates <jfy133@gmail.com> * Update tests/modules/eido/validate/test.yml Co-authored-by: James A. Fellows Yates <jfy133@gmail.com> * Update tests/modules/eido/validate/test.yml Co-authored-by: James A. Fellows Yates <jfy133@gmail.com> * Update modules/eido/validate/main.nf Co-authored-by: James A. Fellows Yates <jfy133@gmail.com> Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>
This commit is contained in:
parent
36bcd675ae
commit
2456ef7d99
6 changed files with 120 additions and 0 deletions
32
modules/eido/validate/main.nf
Normal file
32
modules/eido/validate/main.nf
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
process EIDO_VALIDATE {
|
||||||
|
tag '$samplesheet'
|
||||||
|
label 'process_single'
|
||||||
|
|
||||||
|
conda (params.enable_conda ? "conda-forge::eido=0.1.9" : null)
|
||||||
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||||
|
'https://containers.biocontainers.pro/s3/SingImgsRepo/eido/0.1.9_cv1/eido_0.1.9_cv1.sif' :
|
||||||
|
'biocontainers/eido:0.1.9_cv1' }"
|
||||||
|
|
||||||
|
input:
|
||||||
|
path samplesheet
|
||||||
|
path schema
|
||||||
|
|
||||||
|
output:
|
||||||
|
path "versions.yml" , emit: versions
|
||||||
|
path "*.log" , emit: log
|
||||||
|
|
||||||
|
when:
|
||||||
|
task.ext.when == null || task.ext.when
|
||||||
|
|
||||||
|
script:
|
||||||
|
def args = task.ext.args ?: ''
|
||||||
|
def prefix = task.ext.prefix ?: "validation"
|
||||||
|
"""
|
||||||
|
eido validate $args $samplesheet -s $schema -e > ${prefix}.log
|
||||||
|
|
||||||
|
cat <<-END_VERSIONS > versions.yml
|
||||||
|
"${task.process}":
|
||||||
|
eido: \$(echo \$(eido --version 2>&1) | sed 's/^.*eido //;s/ .*//' ))
|
||||||
|
END_VERSIONS
|
||||||
|
"""
|
||||||
|
}
|
38
modules/eido/validate/meta.yml
Normal file
38
modules/eido/validate/meta.yml
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
name: "eido_validate"
|
||||||
|
description: Validate samplesheet or PEP config against a schema
|
||||||
|
keywords:
|
||||||
|
- eido
|
||||||
|
- validate
|
||||||
|
- schema
|
||||||
|
- format
|
||||||
|
- pep
|
||||||
|
tools:
|
||||||
|
- "validate":
|
||||||
|
description: "Validate samplesheet or PEP config against a schema."
|
||||||
|
homepage: "http://eido.databio.org/en/latest/"
|
||||||
|
documentation: "http://eido.databio.org/en/latest/"
|
||||||
|
doi: "10.1093/gigascience/giab077"
|
||||||
|
licence: "BSD-2-Clause"
|
||||||
|
|
||||||
|
input:
|
||||||
|
- samplesheet:
|
||||||
|
type: file
|
||||||
|
description: Samplesheet or PEP file to be validated
|
||||||
|
pattern: "*.{yaml,yml,csv}"
|
||||||
|
- schema:
|
||||||
|
type: file
|
||||||
|
description: Schema that the samplesheet will be validated against
|
||||||
|
pattern: "*.{yaml,yml}"
|
||||||
|
|
||||||
|
output:
|
||||||
|
- versions:
|
||||||
|
type: file
|
||||||
|
description: File containing software versions
|
||||||
|
pattern: "versions.yml"
|
||||||
|
- log:
|
||||||
|
type: file
|
||||||
|
description: File containing validation log.
|
||||||
|
pattern: "*.log"
|
||||||
|
|
||||||
|
authors:
|
||||||
|
- "@rafalstepien"
|
|
@ -691,6 +691,10 @@ elprep/filter:
|
||||||
- modules/elprep/filter/**
|
- modules/elprep/filter/**
|
||||||
- tests/modules/elprep/filter/**
|
- tests/modules/elprep/filter/**
|
||||||
|
|
||||||
|
eido/validate:
|
||||||
|
- modules/eido/validate/**
|
||||||
|
- tests/modules/eido/validate/**
|
||||||
|
|
||||||
elprep/merge:
|
elprep/merge:
|
||||||
- modules/elprep/merge/**
|
- modules/elprep/merge/**
|
||||||
- tests/modules/elprep/merge/**
|
- tests/modules/elprep/merge/**
|
||||||
|
|
21
tests/modules/eido/validate/main.nf
Normal file
21
tests/modules/eido/validate/main.nf
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/usr/bin/env nextflow
|
||||||
|
|
||||||
|
nextflow.enable.dsl = 2
|
||||||
|
|
||||||
|
include { EIDO_VALIDATE } from '../../../../modules/eido/validate/main.nf'
|
||||||
|
|
||||||
|
workflow test_eido_validate_on_nextflow_samplesheet {
|
||||||
|
|
||||||
|
samplesheet = file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/pep/test_nextflow_original_samplesheet.csv", checkIfExists: true)
|
||||||
|
schema = file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/pep/test_samplesheet_schema.yaml", checkIfExists: true)
|
||||||
|
|
||||||
|
EIDO_VALIDATE ( samplesheet, schema )
|
||||||
|
}
|
||||||
|
|
||||||
|
workflow test_eido_validate_on_pep_config {
|
||||||
|
|
||||||
|
samplesheet = file("https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/pep/test_pep_format_files/config.yaml", checkIfExists: true)
|
||||||
|
schema = file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/pep/test_samplesheet_schema.yaml", checkIfExists: true)
|
||||||
|
|
||||||
|
EIDO_VALIDATE ( samplesheet, schema )
|
||||||
|
}
|
8
tests/modules/eido/validate/nextflow.config
Normal file
8
tests/modules/eido/validate/nextflow.config
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
process {
|
||||||
|
|
||||||
|
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||||
|
withName: 'EIDO_VALIDATE' {
|
||||||
|
ext.args = '--st-index sample'
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
17
tests/modules/eido/validate/test.yml
Normal file
17
tests/modules/eido/validate/test.yml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
- name: eido validate test_eido_validate_on_nextflow_samplesheet
|
||||||
|
command: nextflow run ./tests/modules/eido/validate -entry test_eido_validate_on_nextflow_samplesheet -c ./tests/config/nextflow.config -c ./tests/modules/eido/validate/nextflow.config
|
||||||
|
tags:
|
||||||
|
- eido/validate
|
||||||
|
- eido
|
||||||
|
files:
|
||||||
|
- path: output/eido/validation.log
|
||||||
|
md5sum: 3a197c21ebf411aac7616bf9b4470de3
|
||||||
|
|
||||||
|
- name: eido validate test_eido_validate_on_pep_config
|
||||||
|
command: nextflow run ./tests/modules/eido/validate -entry test_eido_validate_on_pep_config -c ./tests/config/nextflow.config -c ./tests/modules/eido/validate/nextflow.config
|
||||||
|
tags:
|
||||||
|
- eido/validate
|
||||||
|
- eido
|
||||||
|
files:
|
||||||
|
- path: output/eido/validation.log
|
||||||
|
md5sum: 3a197c21ebf411aac7616bf9b4470de3
|
Loading…
Reference in a new issue