A Short Introduction to the immcp Package

Author: Yuanlong Hu

2020-07-18

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.

library(immcp)

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

data("drugSample")
str(drugSample)
#> List of 4
#>  $ herb_target           :'data.frame':  6633 obs. of  2 variables:
#>   ..$ prescription: chr [1:6633] "YU_PING_FENG_SAN" "YU_PING_FENG_SAN" "YU_PING_FENG_SAN" "YU_PING_FENG_SAN" ...
#>   ..$ target      : chr [1:6633] "AARS" "AARS2" "ABAT" "ABCB1" ...
#>  $ disease_network       :'data.frame':  544 obs. of  2 variables:
#>   ..$ from: chr [1:544] "HSPA5" "FOS" "FOS" "TRA2B" ...
#>   ..$ to  : chr [1:544] "HSP90B1" "JUND" "JUNB" "HNRNPA2B1" ...
#>  $ disease_biomarker     : chr [1:116] "HSPA5" "FOS" "TRA2B" "JUN" ...
#>  $ disease_biomarker_gsea: Named num [1:12444] 4.57 4.51 4.42 4.14 3.88 ...
#>   ..- attr(*, "names")= chr [1:12444] "MMP1" "CDC45" "NMU" "CDCA8" ...

extrFP() can calculate the pathway fingerprints. The genesets contain ImmGenTop150 and KEGG.

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(disease_biomarker = drugSample$disease_biomarker,
             drug_target = drugSample$herb_target,
             method = "enrich",
             geneset = "KEGG")
#> 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...
res1 <- get_result(res, pvalueCutoff = 0.05)
head(res1)
#>                          Score adj_score p_value
#> BAN_XIA_XIE_XIN_TANG 0.1602564  2.258761  0.0198
#> BU_ZHONG_YI_QI_TANG  0.1517241  1.710636  0.0396

We can look at our distribution using plot_density().

plot_density(res, "BAN_XIA_XIE_XIN_TANG")