From 2dd17e715ac16b5ba7c0679721a65d3b3b9514bc Mon Sep 17 00:00:00 2001 From: dominiquesydow Date: Sun, 17 Apr 2022 16:08:39 +0100 Subject: [PATCH] Update kissim scripts to run residue subsets --- scripts/kissim_subsets.sh | 28 +++++++++++++++++++ ...and_subset.py => kissim_subsets_ligand.py} | 18 ++++++------ 2 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 scripts/kissim_subsets.sh rename scripts/{kissim_ligand_subset.py => kissim_subsets_ligand.py} (86%) diff --git a/scripts/kissim_subsets.sh b/scripts/kissim_subsets.sh new file mode 100644 index 0000000..5d40621 --- /dev/null +++ b/scripts/kissim_subsets.sh @@ -0,0 +1,28 @@ +# @dominiquesydow +# Subset and compare fingerprints +# - DFG-in focused residues +# - Martin et al. residues +# +# Run this script only after having results from running the main script +# https://github.com/volkamerlab/kissim_app/blob/master/scripts/kissim_encode_compare.sh +# +# Usage +# ----- +# cd /path/to/kissim_app +# bash kissim_subsets.sh + +KISSIM_APP="." +NCORES=7 + +# DFG-in focused residues +for name_subset in dfg_in martin_set +do + RESULTS=$KISSIM_APP/results/dfg_in_subset_${name_subset} + echo $RESULTS + echo "Select fingerprint subset..." + kissim subset -i $RESULTS/fingerprints_normalized.json -o $RESULTS/fingerprints_subset.json -s $name_subset + echo "Done." + echo "Compare fingerprints..." + kissim compare -i $RESULTS/fingerprints_subset.json -o $RESULTS -c $NCORES + echo "Done." +done \ No newline at end of file diff --git a/scripts/kissim_ligand_subset.py b/scripts/kissim_subsets_ligand.py similarity index 86% rename from scripts/kissim_ligand_subset.py rename to scripts/kissim_subsets_ligand.py index 7bdc56a..16f3d09 100644 --- a/scripts/kissim_ligand_subset.py +++ b/scripts/kissim_subsets_ligand.py @@ -1,5 +1,5 @@ """ -Generate KiSSim data for +Generate KiSSim data for ligand-based residue subsets. """ from pathlib import Path @@ -10,9 +10,10 @@ PATH_RESULTS_DFG_IN = PATH_RESULTS / "dfg_in" + def main(ligand_expo_id, path_fp_in=PATH_RESULTS_DFG_IN / "fingerprints_normalized.json"): """ - Generate KiSSim fingerprint distances for a subset version of the fingerprint that + Generate KiSSim fingerprint distances for a subset version of the fingerprint that is based only on residues that show interactions with co-crystallized structures (use KLIFS IFPS for this). @@ -36,22 +37,23 @@ def main(ligand_expo_id, path_fp_in=PATH_RESULTS_DFG_IN / "fingerprints_normaliz # Subset fingerprints print("Subset fingerprints...") fingerprint_generator = subset( - fingerprints_path = path_fp_in, + fingerprints_path=path_fp_in, klifs_pocket_residue_subset_type=ligand_expo_id, - fingerprints_subset_path = path_out / "fingerprints_normalized.json", - klifs_pocket_residue_subset={ligand_expo_id: interacting_residues} + fingerprints_subset_path=path_out / "fingerprints_normalized.json", + klifs_pocket_residue_subset={ligand_expo_id: interacting_residues}, ) - + print("All-against-all comparison...") compare( fingerprint_generator=fingerprint_generator, output_path=path_out, feature_weights=None, - n_cores=7 + n_cores=7, ) + if __name__ == "__main__": main("IRE") main("STI") main("DB8") - main("B96") \ No newline at end of file + main("B96")