Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update kissim scripts to run residue subsets #56

Merged
merged 1 commit into from
Apr 17, 2022
Merged
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
28 changes: 28 additions & 0 deletions scripts/kissim_subsets.sh
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Generate KiSSim data for
Generate KiSSim data for ligand-based residue subsets.
"""

from pathlib import Path
Expand All @@ -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).

Expand All @@ -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")
main("B96")