A Short Introduction to the immcp Package

Author: Yuanlong Hu


Traditional Chinese Medicine(TCM) has a history of more than 2000 years and has accumulated a great deal of clinical experience. The herbal prescription is one of the main treatment methods of traditional Chinese medicine. How to find a candidate prescription for a disease defined by modern medicine is an urgent problem to be solved.

The pathway fingerprint (Ye, et.al,2012) is a method to indicate the profile of significant pathways being influenced by drugs, which may hint drug functions. Potential therapeutic prescription can be found based on the similarity of pathway fingerprints between disease and prescription.


drugSample is a demo dataset, which contains two data frame and two vector:

#> List of 4
#>  $ disease_network  :'data.frame':   2475 obs. of  2 variables:
#>   ..$ node1: chr [1:2475] "PSMC6" "RPS24" "PSMA2" "PRF1" ...
#>   ..$ node2: chr [1:2475] "PSMA4" "RPL34" "PSMA4" "GZMB" ...
#>  $ disease_biomarker: chr [1:34] "MCEMP1" "S100A12" "ANXA3" "GADD45A" ...
#>  $ drug_herb        :'data.frame':   12 obs. of  2 variables:
#>   ..$ to  : chr [1:12] "HUANGQI" "DANGGUI" "HUANGQI" "ZHIMU" ...
#>  $ herb_target      :'data.frame':   11 obs. of  2 variables:
#>   ..$ herb  : chr [1:11] "TAOREN" "DAHUANG" "GUIZHI" "GANCAO" ...
#>   ..$ target: chr [1:11] "ABCA1, ABCB1, ABCB11, ABCC2, ABCC8, ABCC9, ABCG1, ABL1, ABL2, ACSL1, ACSS1, ACSS2, ACVR1, ACVR1B, ACVRL1, ADA, "| __truncated__ "MARCHF8, ABAT, ABCC4, ACADSB, ACE, ACE2, ACIN1, ACSL1, ACSL4, ACTA1, ACTG1, ACTN2, ACTN3, ACVR2A, ADA, ADAM17, "| __truncated__ "ABCA1, ABCB1, ABCB4, ABCC2, ABCC9, ABCG1, ABCG2, ABHD5, ACACA, ACACB, ACADSB, ACAT1, ACE, ACHE, ACP1, ACTN2, AC"| __truncated__ "ABAT, ABCB4, ABCC4, ABHD6, ACADSB, ACE, ACHE, ACO1, ACSL3, ACSL4, ACTN3, ACVR2A, ADA, ADAM8, ADAP1, ADAP2, ADH1"| __truncated__ ...

PrepareData can prepare the format of input data. CreateBasicData can craete a BasicData object.

drug_herb <- PrepareData(drugSample$drug_herb, col1 = "drug", col2 = "herb")
herb_target <- PrepareData(drugSample$herb_target, 
                           col1 = "herb", col2 = "target", 
                            format = "basket", sep = ", ")
drug_target <- CreateBasicData(drug_herb, herb_target)

extrFP() can calculate the pathway fingerprints based on KEGG pathawy(except “Human Diseases” and “Drug Development”).

If the disease_biomarker is a a vector of gene symbol, you can use method = "enrich", such as disease_biomarker. If the disease_biomarker is a a vector of logFC values named by gene symbol, you can use method = "gsea", such as disease_biomarker_gsea.

FP <- extrFP(drug_target = drug_target,
             disease_biomarker = drugSample$disease_biomarker,
             method = "enrich")
#> Calculating pathway fingerprints of drug...
#> Calculating pathway fingerprints of disease...
#> Done...

score_fp() can calculate the Tanimoto coefficient of pathway fingerprint between disease and prescription as score. The score is adjusted by permutation test. The results contain:

res <- score_fp(FP, n = 100)
#> Calculating score...
#> Summarizing all results...
#> Done...
get_result(res, pvalueCutoff = 0.05)
#>                           Score adj_score p_value
#> TAO_HE_CHENG_QI_TANG 0.06666667  2.738521  0.0099
#> SHENG_XIAN_TANG      0.06569343  2.391660  0.0099
#> DANG_GUI_BU_XUE_TANG 0.06363636  1.662674  0.0198

We can look at our distribution using plot_density().

plot_density(res, "DANG_GUI_BU_XUE_TANG")