Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [[PR #466](https://github.com/nf-core/proteinfold/pulls/464)] - Update module conf and publishdir patterns for ESMFold, pass through container args
- [[PR #469](https://github.com/nf-core/proteinfold/pulls/454)] - HTML reports now in /reports output directory
- [[PR #468](https://github.com/nf-core/proteinfold/pulls/468)] - Update publishdir patterns for Alphafold3 module
- [[PR #471](https://github.com/nf-core/proteinfold/pulls/471)] - Update publishdir patterns for Rosettafold2na module

### Parameters

Expand Down
41 changes: 29 additions & 12 deletions conf/modules_rosettafold2na.config
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,35 @@ process {
withName: 'RUN_ROSETTAFOLD2NA' {
accelerator = params.use_gpu? 1 : 0
publishDir = [
path: { "${params.outdir}/rosettafold2na/" },
mode: 'copy',
saveAs: { filename ->
if (filename.endsWith('_pae.tsv')) {
"paes/$filename"
} else if (filename.equals('versions.yml')) {
null
} else {
filename
}
},
pattern: '*.*'
[
path: { "${params.outdir}/rosettafold2na/${meta.id}" },
mode: 'copy',
pattern: '*_plddt.tsv'
],
[
path: { "${params.outdir}/rosettafold2na/${meta.id}" },
mode: 'copy',
saveAs: { filename -> "paes/$filename" },
pattern: '*_pae.tsv'
],
[
path: { "${params.outdir}/rosettafold2na/${meta.id}" },
mode: 'copy',
pattern: '*_rosettafold2na_msa.tsv'
],
[
enabled: params.save_intermediates,
path: { "${params.outdir}/rosettafold2na/${meta.id}/raw" },
mode: 'copy',
pattern: 'raw/**',
saveAs: { filename -> filename.toString().replaceFirst(/^raw\//, '') }
],
[
path: { "${params.outdir}/rosettafold2na/top_ranked_structures" },
mode: 'copy',
saveAs: { "${meta.id}.pdb" },
pattern: '*_rosettafold2na.pdb'
]
]
}

Expand Down
51 changes: 27 additions & 24 deletions modules/local/run_rosettafold2na/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ process RUN_ROSETTAFOLD2NA {
path ('network/weights/*')

output:
tuple val(meta), path("${meta.id}_rf2na.pdb"), emit: pdb
tuple val(meta), path("${meta.id}_plddt_mqc.tsv"), emit: multiqc
tuple val(meta), path("${meta.id}_rosettafold2na_msa.tsv"), emit: msa
tuple val(meta), path("${meta.id}_0_pae.tsv"), emit: pae
path "versions.yml", emit: versions
path ("raw/**") , emit: raw
tuple val(meta), path("${meta.id}_rosettafold2na.pdb") , emit: top_ranked_pdb
tuple val(meta), path("raw/*.pdb") , emit: pdb
tuple val(meta), path("${meta.id}_plddt.tsv") , emit: multiqc
tuple val(meta), path("${meta.id}_rosettafold2na_msa.tsv") , emit: msa
tuple val(meta), path("${meta.id}_0_pae.tsv") , emit: pae
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when
Expand Down Expand Up @@ -67,7 +69,12 @@ process RUN_ROSETTAFOLD2NA {

./run_RF2NA.sh ${meta.id}_rf2na_output "\${chain_args[@]}"

cp ${meta.id}_rf2na_output/models/model_00.pdb ./${meta.id}_rf2na.pdb
## Create raw directory for intermediate files
mkdir -p raw

## Copy top ranked model to root and raw
cp ${meta.id}_rf2na_output/models/model_00.pdb ./${meta.id}_rosettafold2na.pdb
cp ${meta.id}_rf2na_output/models/*.pdb raw/ # TODO check other raw files
Comment thread
vagkaratzas marked this conversation as resolved.
Outdated

# Extract PAE matrix from NPZ and save as TSV for reporting
/conda/envs/RF2NA/bin/python3 - <<'PY' "${meta.id}_rf2na_output/models/model_00.npz" "${meta.id}_0_pae.tsv"
Expand All @@ -81,36 +88,32 @@ PY
extract_metrics.py --name ${meta.id} \
--structs "${meta.id}_rf2na_output/models/model_00.pdb" ${'$'}A3M_ARGS

mv "${meta.id}_plddt.tsv" "${meta.id}_plddt_mqc.tsv"
if [ -f "${meta.id}_msa.tsv" ]; then
mv "${meta.id}_msa.tsv" "${meta.id}_rosettafold2na_msa.tsv"
fi
mv "${meta.id}_msa.tsv" "${meta.id}_rosettafold2na_msa.tsv"

printf '"%s":\n python: %s\n' \
"${task.process}" \
"\$(/conda/envs/RF2NA/bin/python3 --version | sed 's/Python //g')" > versions.yml
## Move rf2na output directory to raw for save_intermediates
mv ${meta.id}_rf2na_output/* raw/

cat <<-END_VERSIONS > versions.yml
"${task.process}":
rosettafold2na: $VERSION
END_VERSIONS
cat <<-END_VERSIONS > versions.yml
"${task.process}":
python: \$(python3 --version | sed 's/Python //g')
rosettafold2na: "${VERSION}"
END_VERSIONS
"""

stub:
def VERSION = 'v0.2' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
touch "${meta.id}_rf2na.pdb"
touch "${meta.id}_plddt_mqc.tsv"
mkdir -p raw
touch "${meta.id}_rosettafold2na.pdb"
touch raw/model_00.pdb
touch "${meta.id}_plddt.tsv"
touch "${meta.id}_0_pae.tsv"
touch "${meta.id}_rosettafold2na_msa.tsv"

printf '"%s":\n python: %s\n' \
"${task.process}" \
"\$(/conda/envs/RF2NA/bin/python3 --version | sed 's/Python //g')" > versions.yml

cat <<-END_VERSIONS > versions.yml
"${task.process}":
rosettafold2na: $VERSION
python: \$(python3 --version | sed 's/Python //g')
rosettafold2na: "${VERSION}"
END_VERSIONS
"""
}
Loading