Skip to content

Commit

Permalink
feat(run_alphafold2): Changed hardcoded paths to use variables and up…
Browse files Browse the repository at this point in the history
…dated variable names
  • Loading branch information
nbtm-sh committed Aug 8, 2024
1 parent 2a79fe4 commit c218ad2
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions modules/local/run_alphafold2.nf
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,30 @@ process RUN_ALPHAFOLD2 {

script:
def args = task.ext.args ?: ''
def db_preset = db_preset ? "full_dbs --bfd_database_path=${params.bfd_variable}bfd_metaclust_clu_complete_id30_c90_final_seq.sorted_opt --uniclust30_database_path=${params.uniclust30_variable}uniclust30_2018_08/uniclust30_2018_08" :
"reduced_dbs --small_bfd_database_path=${params.small_bfd_path}bfd-first_non_consensus_sequences.fasta"
def db_preset = db_preset ? "full_dbs --bfd_database_path=${params.bfd_dir_path}${params.bfd_metaclust_clu_complete_id30_c90_final_seq_sorted_opt_name} --uniclust30_database_path=${params.uniclust30_dir_path}${params.uniclust30_db_name}" :
"reduced_dbs --small_bfd_database_path=${params.small_bfd_path}${params.bfd_first_non_consensus_sequences_name}"
if (alphafold2_model_preset == 'multimer') {
alphafold2_model_preset += " --pdb_seqres_database_path=${params.pdb_seqres_variable}pdb_seqres.txt --uniprot_database_path=${params.uniprot_variable}uniprot.fasta "
alphafold2_model_preset += " --pdb_seqres_database_path=${params.pdb_seqres_dir_path}${params.pdb_seqres_txt_name} --uniprot_database_path=${params.uniprot_dir_path}${params.uniprot_fasta_name} "
}
else {
alphafold2_model_preset += " --pdb70_database_path=${params.pdb70_variable}pdb70 "
alphafold2_model_preset += " --pdb70_database_path=${params.pdb_dir_path}${params.pdb70_name} "
}
"""
if [ -f ${params.pdb_seqres_variable}pdb_seqres.txt ]
then sed -i "/^\\w*0/d" ${params.pdb_seqres_variable}pdb_seqres.txt
if [ -f ${params.pdb_seqres_dir_path}/${params.pbd_seqres_txt_name} ]
\$PDB_SEQRES_TEMP=\$(mktemp --directory)
cp ${params.pdb_seqres_dir_path}${params.pdb_seqres_txt_name} \${PDB_SEQRES_TEMP}/
then sed -i "/^\\w*0/d" \$PDB_SEQERS_TEMP/${params.pdb_seqres_txt_name}
fi
if [ -d params/alphafold_params_* ]; then ln -r -s params/alphafold_params_*/* params/; fi
if [ -d ${params.alphafold2_params_path} ]; then ln -r -s ${params.alphafold2_params_path} params/; fi
python3 /app/alphafold/run_alphafold.py \
--fasta_paths=${fasta} \
--model_preset=${alphafold2_model_preset} \
--db_preset=${db_preset} \
--output_dir=\$PWD \
--data_dir=\$PWD \
--uniref90_database_path=${params.uniref90_variable}uniref90.fasta \
--template_mmcif_dir=${params.pdb_mmcif_variable}mmcif_files \
--obsolete_pdbs_path=${params.pdb_mmcif_variable}obsolete.dat \
--uniref90_database_path=${params.uniref90_dir_path}uniref90.fasta \
--template_mmcif_dir=${params.template_mmcif_dir} \
--obsolete_pdbs_path=${params.obsolete_pdbs_path} \
--random_seed=53343 \
$args
Expand Down

0 comments on commit c218ad2

Please sign in to comment.