Configure PRODIGY pipeline for WES execution with S3 and Harbor
This commit is contained in:
74
main.nf
Normal file
74
main.nf
Normal file
@@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env nextflow
|
||||
|
||||
nextflow.enable.dsl=2
|
||||
|
||||
// Default parameters
|
||||
params.pdb = 's3://omic/eureka/prodigy/input/*.pdb'
|
||||
params.outdir = 's3://omic/eureka/prodigy/output'
|
||||
params.distance_cutoff = 5.5
|
||||
params.acc_threshold = 0.05
|
||||
params.temperature = 25.0
|
||||
params.selection = ''
|
||||
params.contact_list = false
|
||||
params.pymol_selection = false
|
||||
params.quiet = false
|
||||
|
||||
// =============================================================================
|
||||
// Process: PRODIGY
|
||||
// Predicts binding affinity using intermolecular contacts
|
||||
// =============================================================================
|
||||
|
||||
process PRODIGY {
|
||||
container 'harbor.cluster.omic.ai/omic/prodigy:latest'
|
||||
publishDir params.outdir, mode: 'copy'
|
||||
stageInMode 'copy'
|
||||
|
||||
input:
|
||||
path pdb
|
||||
|
||||
output:
|
||||
path "${pdb.baseName}_prodigy.txt", emit: results
|
||||
path "${pdb.baseName}_contacts.txt", optional: true, emit: contacts
|
||||
path "${pdb.baseName}_interface.pml", optional: true, emit: pymol
|
||||
|
||||
script:
|
||||
"""
|
||||
prodigy \\
|
||||
${pdb} \\
|
||||
--distance-cutoff ${params.distance_cutoff} \\
|
||||
--acc-threshold ${params.acc_threshold} \\
|
||||
--temperature ${params.temperature} \\
|
||||
${params.selection ? '--selection ' + params.selection : ''} \\
|
||||
${params.contact_list ? '--contact_list' : ''} \\
|
||||
${params.pymol_selection ? '--pymol_selection' : ''} \\
|
||||
${params.quiet ? '--quiet' : ''} \\
|
||||
2>&1 | tee ${pdb.baseName}_prodigy.txt
|
||||
|
||||
# Rename contact list file if generated
|
||||
if [ -f "${pdb.baseName}.contacts" ]; then
|
||||
mv ${pdb.baseName}.contacts ${pdb.baseName}_contacts.txt
|
||||
fi
|
||||
|
||||
# Rename PyMOL script if generated
|
||||
if [ -f "${pdb.baseName}.pml" ]; then
|
||||
mv ${pdb.baseName}.pml ${pdb.baseName}_interface.pml
|
||||
fi
|
||||
"""
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
// Workflow
|
||||
// =============================================================================
|
||||
|
||||
workflow {
|
||||
// Validate input
|
||||
if (!params.pdb) {
|
||||
error "ERROR: Please provide input PDB file(s) using --pdb parameter"
|
||||
}
|
||||
|
||||
// Create input channel
|
||||
pdb_ch = Channel.fromPath(params.pdb, checkIfExists: true)
|
||||
|
||||
// Run PRODIGY
|
||||
PRODIGY(pdb_ch)
|
||||
}
|
||||
Reference in New Issue
Block a user