I have 4 pandas data frames containing the following data:
- affinity_score1: affinity between each couple (Drug-Target) measured using tool1
- affinity_score2: affinity between each couple (Drug-Target) measured using tool2
The two tools (tool1, tool2) give measure in different scales and are not 100% accurate.
- Drug_similarity: a similarity matrix between drugs
- Target_similarity: a similarity matrix between targets.
Here also the tool used to measure the similarity is not 100% accurate.
import pandas as pd
affinity_score1 = [{'Drug0': -24.5, 'Drug1': -17.1, 'Drug2': -13.1},
{'Drug0': -20.0, 'Drug1': -21.6, 'Drug2': -18.1},
{'Drug0': -19.0, 'Drug1': -15.4, 'Drug2': -20.0}]
affinity_score2 = [{'Drug0': 1.5, 'Drug1': 0.8, 'Drug2': 0.4},
{'Drug0': 1.2, 'Drug1': 1.3, 'Drug2': 0.9},
{'Drug0': 0.8, 'Drug1': 0.7, 'Drug2': 0.9}]
affinity_score1_df = pd.DataFrame(affinity_score1).rename(index={0:'TargetX',1:'TargetY', 2:'TargetZ'})
affinity_score2_df = pd.DataFrame(affinity_score2).rename(index={0:'TargetX',1:'TargetY', 2:'TargetZ'})
Drug_similarity = [{'Drug0': 1, 'Drug1': 0.8, 'Drug2': 0.2},
{'Drug0': 0.8, 'Drug1': 1, 'Drug2': 0.9},
{'Drug0': 0.2, 'Drug1': 0.9, 'Drug2': 1}]
Target_similarity = [{'TargetX': 1, 'TargetY': 0.8, 'TargetZ': 0.2},
{'TargetX': 0.8, 'TargetY': 1, 'TargetZ': 0.9},
{'TargetX': 0.2, 'TargetY': 0.9, 'TargetZ': 1}]
Drug_similarity = pd.DataFrame(Drug_similarity).rename(index={0:'Drug0',1:'Drug1', 2:'Drug2'})
Target_similarity = pd.DataFrame(Target_similarity).rename(index={0:'TargetX',1:'TargetY', 2:'TargetZ'})
I am trying to find the Drug who can have as many Targets as possible.
So far, a simple approach could be to select the Drug having the highest average score in both affinity scoring tools.
This approach does not use the information in the similarity matrices. Given that if a Drug1 is successful with TargetX, and TargetX is similar to TargetY then Drug1 can also easily be successful with TargetY. Considering the inaccuracy of the scoring tools, I think including this information could improve the accuracy of the answer, eliminating some false positives. Also, if a Drug from a cluster of similar drugs (information that can be derived from the drugs similarity matrix) is the only one predicted to have good affinities with some targets, then this is more likely to be a false positive. But I don't know how to efficiently integrate all the information. Scipy may help with clustering the two similarity matrices.
Another way of analysis is to set affinity and similarity thresholds, in which case each data frame could be transformed into a network:
- Each node is a drug or a target.
- Two types of edges: similarity (between drugs or targets) and affinity (drug-target)
- The connected nodes have passed the thresholds.
- The edges have weights: affinity or similarity score.
The problem then becomes finding the most connected node (a drug node) with the highest weight values (scores on tool1 and tool2). Connected nodes through similarity may then be used to validate the number of targets for each drug. It seems a more complicated approach but more rigorous with most likely higher positive predictive value.
Any python package to implement such an approach? And also a visualization tool.
The original data has 38 Targets with 806 drugs.