Skip to content

Commit

Permalink
Merge pull request #239 from jonasscheid/merge-template
Browse files Browse the repository at this point in the history
Add stubs to all local modules
  • Loading branch information
jonasscheid authored Mar 28, 2024
2 parents 3cee77a + 63e13c8 commit 81fba13
Show file tree
Hide file tree
Showing 12 changed files with 134 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v2.3.1 - Oesterberg Hotfix - 2024-03-25
## v2.3.1 - Bühl - 2024-03-28

### `Fixed`

Expand Down
15 changes: 15 additions & 0 deletions modules/local/cat_files.nf
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,19 @@ process CAT_FILES {
cat: \$(echo \$(cat --version 2>&1) | sed 's/^.*BusyBox //; s/ .*\$//')
END_VERSIONS
"""

stub:
def fileExt = input[0].name.tokenize("\\.")[-1]
def prefix = task.ext.suffix ? "${meta.sample}_${task.ext.suffix}" : "${meta.sample}"
def type = fileExt == "tsv" ? "prediction_result" : "prediction_proteins"

"""
touch ${prefix}_${type}.${fileExt}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
cat: \$(echo \$(cat --version 2>&1) | sed 's/^.*BusyBox //; s/ .*\$//')
END_VERSIONS
"""

}
10 changes: 10 additions & 0 deletions modules/local/csvtk_concat.nf
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,14 @@ process CSVTK_CONCAT {
csvtk: \$(echo \$( csvtk version | sed -e "s/csvtk v//g" ))
END_VERSIONS
"""

stub:
"""
touch ${meta.sample}_prediction_result.tsv
cat <<-END_VERSIONS > versions.yml
"${task.process}":
csvtk: \$(echo \$( csvtk version | sed -e "s/csvtk v//g" ))
END_VERSIONS
"""
}
13 changes: 13 additions & 0 deletions modules/local/epytope_check_requested_models.nf
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,17 @@ process EPYTOPE_CHECK_REQUESTED_MODELS {
epytope: \$(echo \$(python -c "import pkg_resources; print(pkg_resources.get_distribution('epytope').version)"))
END_VERSIONS
"""

stub:
"""
touch model_report.txt
touch model_warnings.log
cat <<-END_VERSIONS > versions.yml
"${task.process}":
mhcflurry: \$(echo \$(mhcflurry-predict --version 2>&1 | sed 's/^mhcflurry //; s/ .*\$//') )
mhcnuggets: \$(echo \$(python -c "import pkg_resources; print(pkg_resources.get_distribution('mhcnuggets').version)"))
epytope: \$(echo \$(python -c "import pkg_resources; print(pkg_resources.get_distribution('epytope').version)"))
END_VERSIONS
"""
}
12 changes: 12 additions & 0 deletions modules/local/epytope_generate_peptides.nf
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,16 @@ process EPYTOPE_GENERATE_PEPTIDES {
python: \$(python --version 2>&1 | sed 's/Python //g')
END_VERSIONS
"""

stub:
def prefix = task.ext.suffix ? "${meta.sample}_${task.ext.suffix}" : "${meta.sample}_peptides"
"""
touch ${prefix}.tsv
cat <<-END_VERSIONS > versions.yml
"${task.process}":
epytope: \$(python -c "import pkg_resources; print(pkg_resources.get_distribution('epytope').version)")
python: \$(python --version 2>&1 | sed 's/Python //g')
END_VERSIONS
"""
}
20 changes: 19 additions & 1 deletion modules/local/epytope_peptide_prediction.nf
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ process EPYTOPE_PEPTIDE_PREDICTION {

def netmhc_paths_string = netmhc_paths.join(",")
def tools_split = params.tools.split(',')
// TODO: Move to nf-validation
def class1_tools = tools_split.findAll { ! it.matches('.*(?i)(class-2|ii).*') }
def class2_tools = tools_split.findAll { it.matches('.*(?i)(syf|class-2|ii).*') }

// TODO: Move to nf-validation
if (((meta.mhc_class == "I") & class1_tools.empty) | ((meta.mhc_class == "II") & class2_tools.empty)) {
exit 1, "No tools specified for mhc class ${meta.mhc_class}"
}
Expand Down Expand Up @@ -88,4 +89,21 @@ process EPYTOPE_PEPTIDE_PREDICTION {
mhcnuggets: \$(python -c "import pkg_resources; print(pkg_resources.get_distribution('mhcnuggets').version)")
END_VERSIONS
"""

stub:
"""
touch ${splitted.baseName}.json
touch ${splitted.baseName}.tsv
touch ${splitted.baseName}.fasta
cat <<-END_VERSIONS > versions.yml
"${task.process}":
python: \$(python --version 2>&1 | sed 's/Python //g')
epytope: \$(python -c "import pkg_resources; print(pkg_resources.get_distribution('epytope').version)")
pandas: \$(python -c "import pkg_resources; print(pkg_resources.get_distribution('pandas').version)")
pyvcf: \$(python -c "import pkg_resources; print(pkg_resources.get_distribution('PyVCF3').version)")
mhcflurry: \$(mhcflurry-predict --version 2>&1 | sed 's/^mhcflurry //; s/ .*\$//')
mhcnuggets: \$(python -c "import pkg_resources; print(pkg_resources.get_distribution('mhcnuggets').version)")
END_VERSIONS
"""
}
10 changes: 10 additions & 0 deletions modules/local/external_tools_import.nf
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,14 @@ process EXTERNAL_TOOLS_IMPORT {
${toolname}: ${toolversion}
END_VERSIONS
"""

stub:
"""
mkdir "${toolname}"
cat <<-END_VERSIONS > versions.yml
"${task.process}":
${toolname}: ${toolversion}
END_VERSIONS
"""
}
11 changes: 11 additions & 0 deletions modules/local/get_prediction_versions.nf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ process GET_PREDICTION_VERSIONS {
done
fi
"""

stub:
"""
touch versions.csv
cat <<-END_VERSIONS > versions.csv
mhcflurry: \$(mhcflurry-predict --version 2>&1 | sed 's/^mhcflurry //; s/ .*\$//')
mhcnuggets: \$(python -c "import pkg_resources; print('mhcnuggets' + pkg_resources.get_distribution('mhcnuggets').version)" | sed 's/^mhcnuggets//; s/ .*\$//' )
epytope: \$(python -c "import pkg_resources; print('epytope' + pkg_resources.get_distribution('epytope').version)" | sed 's/^epytope//; s/ .*\$//')
END_VERSIONS
"""
}


10 changes: 10 additions & 0 deletions modules/local/merge_json.nf
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,14 @@ process MERGE_JSON {
python: \$(python --version | sed 's/Python //g')
END_VERSIONS
"""

stub:
"""
touch ${meta.sample}.json
cat <<-END_VERSIONS > versions.yml
"${task.process}":
python: \$(python --version | sed 's/Python //g')
END_VERSIONS
"""
}
11 changes: 11 additions & 0 deletions modules/local/snpsift_split.nf
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,15 @@ process SNPSIFT_SPLIT {
snpsift: \$( echo \$(SnpSift split -h 2>&1) | sed 's/^.*version //' | sed 's/(.*//' | sed 's/t//g' )
END_VERSIONS
"""

stub:
"""
touch ${input_file.baseName}.chr1.vcf
touch ${input_file.baseName}.chr2.vcf
cat <<-END_VERSIONS > versions.yml
"${task.process}":
snpsift: \$( echo \$(SnpSift split -h 2>&1) | sed 's/^.*version //' | sed 's/(.*//' | sed 's/t//g' )
END_VERSIONS
"""
}
12 changes: 12 additions & 0 deletions modules/local/split_peptides.nf
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,16 @@ process SPLIT_PEPTIDES {
python: \$(python --version | sed 's/Python //g')
END_VERSIONS
"""

stub:
def prefix = task.ext.suffix ? "${peptide.baseName}_${task.ext.suffix}" : "${peptide.baseName}"
"""
touch ${prefix}_1.tsv
touch ${prefix}_2.tsv
cat <<-END_VERSIONS > versions.yml
"${task.process}":
python: \$(python --version | sed 's/Python //g')
END_VERSIONS
"""
}
10 changes: 10 additions & 0 deletions modules/local/variant_split.nf
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,14 @@ process VARIANT_SPLIT {
END_VERSIONS
"""

stub:
"""
touch ${input_file.baseName}_1.vcf
touch ${input_file.baseName}_2.vcf
cat <<-END_VERSIONS > versions.yml
"${task.process}":
python: \$(python --version 2>&1 | sed 's/Python //g')
END_VERSIONS
"""
}

0 comments on commit 81fba13

Please sign in to comment.