In-silico perturbation for customized drug(compound) databases
As long as the target genes of drugs are known, UNAGI allows users to use their own drug (compound) databases or systematically perturb some drugs (compounds) of their interests. Here is the guidance to show the format of drug (compound) database that UNAGI can recognize.
Customize drug (compound) databases
A dictionary or a json file that contains following information: drug/compound: target genes with the indication of perutrbation direciton
e.g. Drug_C: [‘COL1A1:-’, ‘ROBO2:+’]: Drug C down-regulates COL1A1 and up-regulates ROBO2.
import numpy as np
customized_drug_database = {}
customized_drug_database['Drug_A'] = ['TACR1:-', 'MAPK4:+', 'DUSP10:-', 'EGFR:+']
customized_drug_database['Drug_B'] = ['C3:-', 'KDR:+', 'INSR:-','PLA2G2A:-']
customized_drug_database['Drug_C'] = ['COL1A1:-', 'ROBO2:+']
np.save('PATH_TO/customized_drug_database.npy',customized_drug_database)
Perform in-silico drug perturbation on the customized drug database
Genes that are not overlapped with the input single data will be ignored.
from UNAGI import UNAGI
import warnings
warnings.filterwarnings("ignore")
unagi = UNAGI()
data_path = 'PATH_TO_TARGET/dataset.h5ad'
iteration = 0 #which iteration of the model to use
change_level = 0.5 #reduce the expression to 50% of the original value
customized_drug = 'PATH_TO/customized_drug_database.npy'
results = unagi.customize_drug_perturbation(data_path,iteration,customized_drug,change_level,target_dir='PATH_TO_TARGET',device='cuda:0')
Start perturbation....
10
11
0
1
4
8
9
3
5
6
2
7
drug perturabtion done
random background done
Finish results analysis
from UNAGI.perturbations import get_top_compounds
get_top_compounds(results, change_level, top_n=10)
| compound | perturbation score | pval_adjusted | drug_regulation | idrem_suggestion | |
|---|---|---|---|---|---|
| 0 | Drug_C | 0.383395 | 0.011888 | [COL1A1:-, ROBO2:+] | [COL1A1:-, ROBO2:+] |