Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] io module #20

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
4 changes: 2 additions & 2 deletions .devcontainer/updateContentCommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ cat <<EOF > $XDG_CONFIG_HOME/nf-neuro/.env
# It is sourced by the shell on startup of every terminals.

export PROFILE=docker
export NFCORE_MODULES_GIT_REMOTE=$GIT_REMOTE
export NFCORE_MODULES_GIT_REMOTE="$GIT_REMOTE"
export NFCORE_MODULES_BRANCH=$CURRENT_BRANCH
export NFCORE_SUBWORKFLOWS_GIT_REMOTE=$GIT_REMOTE
export NFCORE_SUBWORKFLOWS_GIT_REMOTE="$GIT_REMOTE"
export NFCORE_SUBWORKFLOWS_BRANCH=$CURRENT_BRANCH

export DEVCONTAINER_RAM_LIMIT_GB=$((maxmem / 1024 / 1024))
Expand Down
24 changes: 11 additions & 13 deletions modules/nf-neuro/io/readbids/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ process IO_READBIDS {
label 'process_single'

container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://scil.usherbrooke.ca/containers/scilus_2.0.0.sif':
'scilus/scilus:2.0.0' }"
'https://scil.usherbrooke.ca/containers/scilus_2.0.2.sif':
'scilus/scilus:2.0.2' }"

input:
path(bids_folder)
path(fsfolder)
path(bidsignore)
tuple path(bids_folder), path(fs_folder), path(bids_ignore)

output:
path("tractoflow_bids_struct.json") , emit: bidsstructure
Expand All @@ -20,22 +18,22 @@ process IO_READBIDS {

script:
def args = task.ext.args ?: ''
def fsfolder = task.ext.fs_folder ? "--fs " + task.ext.fs_folder : ''
def bidsignore = task.ext.bidsignore ? "--bids_ignore " + task.ext.bidsignore : ''
def readout = task.ext.readout ? "--readout " + task.ext.readout : ""
def clean_flag = task.ext.clean_bids ? '--clean ' : ''
def fs_folder = fs_folder ? "--fs $fs_folder" : ''
def bids_ignore = bids_ignore ? "--bids_ignore $bids_ignore" : ''
def readout = task.ext.readout ? "--readout " + task.ext.readout : ''
def clean_flag = task.ext.clean_bids ? "--clean " : ''

"""
scil_bids_validate.py $bids_folder tractoflow_bids_struct.json\
$readout \
$clean_flag\
$fsfolder\
$bidsignore\
$fs_folder\
$bids_ignore\
-v

cat <<-END_VERSIONS > versions.yml
"${task.process}":
scilpy: 2.0.0
scilpy: 2.0.2
END_VERSIONS
"""

Expand All @@ -49,7 +47,7 @@ process IO_READBIDS {

cat <<-END_VERSIONS > versions.yml
"${task.process}":
scilpy: 2.0.0
scilpy: 2.0.2
END_VERSIONS
"""
}
8 changes: 4 additions & 4 deletions modules/nf-neuro/io/readbids/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ input:
description: Folder containing bids file
pattern: "*"

- fsfolder:
- fs_folder:
type: directory
description: Folder containing fs file
pattern: "*"

- bidsignore:
- bids_ignore:
type: file
description: bidsignore file
pattern: "*.{bidsignore}"
description: bids_ignore file
pattern: "*.{bids_ignore}"

output:
- versions:
Expand Down
9 changes: 5 additions & 4 deletions modules/nf-neuro/io/readbids/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ nextflow_process {
process {
"""
input[0] = LOAD_DATA.out.test_data_directory.map{
test_data_directory ->
file("\${test_data_directory}/i_bids", checkIfExists: true)
test_data_directory -> [
file("\${test_data_directory}/i_bids", checkIfExists: true),
[],
[],
]
}
input[1] = []
input[2] = []
"""
}
}
Expand Down
10 changes: 5 additions & 5 deletions modules/nf-neuro/io/readbids/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
"tractoflow_bids_struct.json:md5,58e0494c51d30eb3494f7c9198986bb9"
],
"1": [
"versions.yml:md5,0af9864a1818468702fa7d6ac7985e29"
"versions.yml:md5,53cf301d7d6076acbc0691d3e7e52437"
],
"bidsstructure": [
"tractoflow_bids_struct.json:md5,58e0494c51d30eb3494f7c9198986bb9"
],
"versions": [
"versions.yml:md5,0af9864a1818468702fa7d6ac7985e29"
"versions.yml:md5,53cf301d7d6076acbc0691d3e7e52437"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-04-29T20:34:58.293363"
"timestamp": "2024-10-24T19:43:56.536400136"
}
}