Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
48 changes: 24 additions & 24 deletions bin/vfvs_pp_prepare_dockingposes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ usage="vfvs_pp_prepare_docking_poses.sh <results folder> <folder_format> <rankin
Possible folder formats (for the results as well as pdbqt folders):
sub: for VFVS version < 8.0
tar: vfvs version >= 8.0
meta_tranch: Use this format if the output files are stored on the tranch level. This is the case when the setting 'outputfiles_level' was set to 'tranch' in the control file during the workflow.
meta_tranche: Use this format if the output files are stored on the tranche level. This is the case when the setting 'outputfiles_level' was set to 'tranche' in the control file during the workflow.
meta_collection: Use this format if the output files are stored on the collection level. This is the case when the setting 'outputfiles_level' was set to 'collection' in the control file during the workflow.

The <ranking file> needs to contain the collection in the first column and the compound name in the second column.
Expand Down Expand Up @@ -73,65 +73,65 @@ while read -r line; do
collection="${array[0]}"
#molecule=${array[1]/_*} # removing replicas
molecule=${array[1]}
tranch=${collection/_*}
tranche=${collection/_*}
collection_no=${collection/*_}
# name2_padded=$(printf "%05.f" ${collection:5})
echo -e "\n *** Preparing structure ${molecule} ***"
if [ -d ${output_folder}/${tranch}/${collection_no}/${molecule} ]; then
if [ -d ${output_folder}/${tranche}/${collection_no}/${molecule} ]; then
echo " * The directory for this ligand already exists. Skipping this ligand."
continue
fi
mkdir -p ${output_folder}/${tranch}/${collection_no}/${molecule}
cd ${output_folder}/${tranch}/${collection_no}/${molecule}
mkdir -p ${output_folder}/${tranche}/${collection_no}/${molecule}
cd ${output_folder}/${tranche}/${collection_no}/${molecule}

if [ "${format}" == "tar" ]; then
if ! tar -xvf ../../../../${results_folder}/${tranch}.tar --wildcards "${tranch}/${collection_no}*tar"; then
if ! tar -xvf ../../../../${results_folder/commplete/incomplete}/${tranch}.tar --wildcards "${tranch}/${collection_no}*tar"; then
if ! tar -xvf ../../../../${results_folder}/${tranche}.tar --wildcards "${tranche}/${collection_no}*tar"; then
if ! tar -xvf ../../../../${results_folder/complete/incomplete}/${tranche}.tar --wildcards "${tranche}/${collection_no}*tar"; then
echo " * Error, skipping this ligand"
cd ../../../../
continue
fi
fi
if ! tar -xvf ${tranch}/${collection_no}.gz.tar --wildcards "${molecule}*"; then
if ! tar -xvf ${tranche}/${collection_no}.gz.tar --wildcards "${molecule}*"; then
echo " * Error, skipping this ligand"
cd ../../../../
continue
fi
elif [ "${format}" == "sub" ]; then
if ! tar -xvf ../../../../${results_folder}/${tranch}/${collection_no}.gz.tar --wildcards "${molecule}_replica*"; then
if ! tar -xvf ../../../../${results_folder/commplete/incomplete}/${tranch}/${collection_no}.gz.tar --wildcards "${molecule}_replica*"; then
if ! tar -xvf ../../../../${results_folder}/${tranche}/${collection_no}.gz.tar --wildcards "${molecule}_replica*"; then
if ! tar -xvf ../../../../${results_folder/complete/incomplete}/${tranche}/${collection_no}.gz.tar --wildcards "${molecule}_replica*"; then
echo " * Error, skipping this ligand"
cd ../../../../
continue
fi
fi
elif [ "${format}" == "meta_tranch" ]; then
metatranch=${tranch:0:2}
if ! tar -xvf ../../../../${results_folder}/${metatranch}/${tranch}.tar --wildcards "${tranch}/${collection_no}.tar.gz"; then
if ! tar -xvf ../../../../${results_folder/commplete/incomplete}/${metatranch}/${tranch}.tar --wildcards "${tranch}/${collection_no}.tar.gz"; then
elif [ "${format}" == "meta_tranche" ]; then
metatranche=${tranche:0:2}
if ! tar -xvf ../../../../${results_folder}/${metatranche}/${tranche}.tar --wildcards "${tranche}/${collection_no}.tar.gz"; then
if ! tar -xvf ../../../../${results_folder/complete/incomplete}/${metatranche}/${tranche}.tar --wildcards "${tranche}/${collection_no}.tar.gz"; then
echo " * Error, skipping this ligand"
cd ../../../../
continue
fi
fi
if ! tar -xvf ${tranch}/${collection_no}.tar.gz --wildcards "${collection_no}/${molecule}_replica*"; then
if ! tar -xvf ${tranche}/${collection_no}.tar.gz --wildcards "${collection_no}/${molecule}_replica*"; then
echo " * Error, skipping this ligand"
cd ../../../../
continue
fi
mv ${collection_no}/*pdbqt ./
elif [ "${format}" == "meta_collection" ]; then
metatranch=${tranch:0:2}
if ! cp ../../../../${results_folder}/${metatranch}/${tranch}/${collection_no}.tar.gz ./; then
if ! cp ../../../..${results_folder/commplete/incomplete}/${metatranch}/${tranch}/${collection_no}.tar.gz ./; then
metatranche=${tranche:0:2}
if ! cp ../../../../${results_folder}/${metatranche}/${tranche}/${collection_no}.tar.gz ./; then
if ! cp ../../../..${results_folder/complete/incomplete}/${metatranche}/${tranche}/${collection_no}.tar.gz ./; then
echo " * Error, skipping this ligand"
cd ../../../../
continue
fi
fi
mkdir ${tranch}/
mv ${collection_no}.tar.gz ${tranch}/
if ! tar -xvf ${tranch}/${collection_no}.tar.gz --wildcards "${collection_no}/${molecule}_replica*"; then
mkdir ${tranche}/
mv ${collection_no}.tar.gz ${tranche}/
if ! tar -xvf ${tranche}/${collection_no}.tar.gz --wildcards "${collection_no}/${molecule}_replica*"; then
echo " * Error, skipping this ligand"
cd ../../../../
continue
Expand All @@ -150,21 +150,21 @@ while read -r line; do
replica=${file/*_}
replica=${replica/.*}
mkdir -p ${replica}
mv $file ${replica}/${tranch}_${collection_no}_${file}
mv $file ${replica}/${tranche}_${collection_no}_${file}
done
if [[ "${format}" == "tar" ]] || [[ "${format}" == "sub" ]]; then
rm *tar || true
fi

rm -r ${tranch}*
rm -r ${tranche}*
for replica_folder in $(ls -d replica*); do
cd ${replica_folder}
mv *pdbqt docking.out.pdbqt
obabel -m -ipdbqt docking.out.pdbqt -opdb -O "${molecule}.rank-.pdb"
energy=$(obenergy "${molecule}.rank-1.pdb" | tail -n 1 | awk '{print $4}')
obabel -m -ipdbqt docking.out.pdbqt -osdf -O "${molecule}.rank-.sdf"
obabel -ipdbqt docking.out.pdbqt -osdf -O "${molecule}.rank-all.sdf"
echo "${tranch}_${collection} ${molecule} ${replica_folder} ${energy}" >> "${molecule}.rank-1.energy"
echo "${tranche}_${collection} ${molecule} ${replica_folder} ${energy}" >> "${molecule}.rank-1.energy"
echo "${molecule} ${energy} ${replica_folder}" >> ../../../../../${ranking_file}.energies
cd ..
done
Expand Down
6 changes: 3 additions & 3 deletions bin/vfvs_prepare_newcollections.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ while read -r line; do
read -r -a array <<< "$line"
old_collection=${collection}
old_tranche=${tranche}
old_eollection_no=${collection_no}
old_collection_no=${collection_no}

collection_subno="1"
collection_subno_padded="0001"
Expand All @@ -83,8 +83,8 @@ while read -r line; do
else
collection="${array[0]}"
ligand="${array[1]}"
metatranche="${tranche:0:2}"
tranche="${collection/_*}"
metatranche="${tranche:0:2}"
collection_no=${collection/*_}
#collection_no="$(printf "%05.f" "${collection_no}")"
fi
Expand Down Expand Up @@ -146,7 +146,7 @@ while read -r line; do
elif [ "${pdbqt_folder_format}" == "hash_metatranche" ]; then
if [ "${new_collection}" == "true" ]; then
echo " * Extracting collection ${collection}"
rm -r ${old_eollection_no} &>/dev/null || true
rm -r ${old_collection_no} &>/dev/null || true
tar -xzf ../${pdbqt_input_folder}/${collection//smi/pdbqt}.tar.gz || true
fi
cp ${collection_no//smi/pdbqt}/${ligand}.pdbqt ../${output_folder}.tmp2/${collection_new}/${ligand}.pdbqt || true
Expand Down