Skip to content

Commit

Permalink
Merge pull request #47 from volkamerlab/co-author-review
Browse files Browse the repository at this point in the history
Follow-up manuscript analyses
  • Loading branch information
dominiquesydow authored Dec 14, 2021
2 parents 3012da2 + 5aec66f commit cf8f1b4
Show file tree
Hide file tree
Showing 20 changed files with 1,765 additions and 228 deletions.
97 changes: 90 additions & 7 deletions notebooks/005_comparison/008_alternative_comparison.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,17 @@
"source": [
"def load_fingerprints(path_fingerprints):\n",
" \"\"\"\n",
" TODO\n",
" Load fingerprints from file.\n",
"\n",
" Parameters\n",
" ----------\n",
" path_fingerprints : pathlib.Path or str\n",
" Path to fingerprints file.\n",
"\n",
" Returns\n",
" -------\n",
" fingerprints_df : pandas.DataFrame\n",
" Fingerprints (index: structures, columns: fingerprint bits)\n",
" \"\"\"\n",
"\n",
" kissim_fingerprints = FingerprintGenerator.from_json(path_fingerprints)\n",
Expand Down Expand Up @@ -112,7 +122,19 @@
"source": [
"def normalize_fingerprints(fingerprints_df, _type):\n",
" \"\"\"\n",
" TODO\n",
" Normalize fingerprints with different normalization measures.\n",
"\n",
" Parameters\n",
" ----------\n",
" fingerprints_df : pandas.DataFrame\n",
" Fingerprints (index: structures, columns: fingerprint bits)\n",
" _type : str\n",
" Normalization type: min-max-norm or zscore\n",
"\n",
" Returns\n",
" -------\n",
" pandas.DataFrame\n",
" Normalized fingerprints (index: structures, columns: fingerprint bits)\n",
" \"\"\"\n",
"\n",
" if _type == \"min-max-norm\":\n",
Expand All @@ -138,7 +160,23 @@
"source": [
"def weight_fingerprints(fingerprints_df, w1, w2, w3):\n",
" \"\"\"\n",
" TODO\n",
" Weight fingerprints!\n",
"\n",
" Parameters\n",
" ----------\n",
" fingerprints_df : pandas.DataFrame\n",
" Fingerprints (index: structures, columns: fingerprint bits)\n",
" w1 : float\n",
" Weight for the 8 physicochemical features\n",
" w2 : float\n",
" Weight for the 4 spatial distance features\n",
" w3 : float\n",
" Weight for the 3 spatial moment features\n",
"\n",
" Returns\n",
" -------\n",
" pandas.DataFrame\n",
" Weighted fingerprints (index: structures, columns: fingerprint bits)\n",
" \"\"\"\n",
"\n",
" n1 = 85 * 8\n",
Expand All @@ -165,7 +203,17 @@
"source": [
"def generate_structure_distance_matrix(fingerprints_df):\n",
" \"\"\"\n",
" TODO\n",
" Generate the structure distance matrix based on fingerprints.\n",
"\n",
" Parameters\n",
" ----------\n",
" fingerprints_df : pandas.DataFrame\n",
" Fingerprints (index: structures, columns: fingerprint bits)\n",
"\n",
" Returns\n",
" -------\n",
" pandas.DataFrame\n",
" Structure distance matrix\n",
" \"\"\"\n",
"\n",
" structure_distance_matrix_array = pairwise.nan_euclidean_distances(fingerprints_df.values)\n",
Expand All @@ -189,7 +237,18 @@
"source": [
"def generate_kinase_distance_matrix(structure_distance_matrix_df):\n",
" \"\"\"\n",
" TODO\n",
" Generate kinase distance matrix.\n",
" Based on minimum structure pair distance per kinase pair.\n",
"\n",
" Parameters\n",
" ----------\n",
" structure_distance_matrix_df : pandas.DataFrame\n",
" Structure distance matrix\n",
"\n",
" Returns\n",
" -------\n",
" pandas.DataFrame\n",
" Kinase distance matrix\n",
" \"\"\"\n",
"\n",
" # Copy distance matrix to kinase matrix\n",
Expand Down Expand Up @@ -219,7 +278,12 @@
"source": [
"def generate_tree(kinase_distance_matrix_df):\n",
" \"\"\"\n",
" TODO\n",
" Generate and visualize tree from kinase distance matrix.\n",
"\n",
" Parameters\n",
" ----------\n",
" kinase_distance_matrix_df : pandas.DataFrame\n",
" Kinase distance matrix\n",
" \"\"\"\n",
"\n",
" tree.from_distance_matrix(kinase_distance_matrix_df, \"kissim.tree\", \"kinase_annotation.csv\")\n",
Expand Down Expand Up @@ -259,7 +323,26 @@
"source": [
"def pipeline(kissim_fingerprints_df, norm_type, weights):\n",
" \"\"\"\n",
" TODO\n",
" Full pipeline:\n",
" - Load fingerprints\n",
" - Normalize fingerprints\n",
" - Weight fingerprints\n",
" - Generate structure distance matrix\n",
" - Generate kinase distance matrix\n",
" - Generate and visualize tree\n",
"\n",
" Parameters\n",
" ----------\n",
" kissim_fingerprints_df : pandas.DataFrame\n",
" Fingerprints (index: structures, columns: fingerprint bits)\n",
" norm_type : str\n",
" Normalization type: min-max-norm or zscore\n",
" weights : list of float\n",
" [\n",
" Weight for the 8 physicochemical features,\n",
" Weight for the 4 spatial distance features,\n",
" Weight for the 3 spatial moment features,\n",
" ]\n",
" \"\"\"\n",
"\n",
" print(\"Fingerprints \", kissim_fingerprints_df.shape)\n",
Expand Down
Loading

0 comments on commit cf8f1b4

Please sign in to comment.