# IDMIR User Guide

#### Xilong Zhao, Jiashuo Wu, Junwei Han

#### 2025-11-18

## Introduce

This vignette illustrates how to easily use the IDMIR package. Here, we present a network-based computational approach, IDMIR, identify dysregulated miRNAs by integrating gene transcriptomic data and a miRNA interaction network. Furthermore, the package can perform cox regression analysis to verify miRNA’s prognostic efficacy. There are also some functions used to visualize the results of survival analysis.

This network-based method consists of two major parts:

- 1.Calculating the GDEscore. We conducted a statistical comparison of gene expression values between case and control groups (e.g. disease and normal). In this case, we use Student’s t-test method to compute the gene differentially expressed level for each gene between disease and normal samples, and convert the t-test p-value of each gene to z-score. The z-score is defined as GDEscore, and a larger GDEscore indicates the gene regulated by disease to a greater extent.

- 2.Constructing network and performing randomization. In our method, we fist constructed a miRNA-GO bipartite network. The molecular function gene sets were downloaded from C5 Gene sets derived from the GO Molecular Function ontology in the Molecular Signatures Database (MSigDB). We then defined an edge between a miRNA and a GO term if they have at least a common gene, and give the weight of this edge that calculate by the Jaccard index and GDEscore. Next, we proposed to construct a miRNA-miRNA interaction network. The information from the miRNA-GO bipartite graph was used to evaluate the extent of interaction between two miRNAs as the edge’s weight. We consider that the extent of interaction between two miRNAs will be stronger when there are more GO terms they target in common and the more related they are to these GO terms. Then, we used the eigenvector centrality measure to calculate how central each miRNA is in this miRNA-miRNA interaction network. Finally, the statistical significance of these centrality scores is assessed using a bootstrap-based randomization method. Statistically significant miRNAs will serve as potential dysregulated miRNAs.

  This package provides the `GetData_Mirna` function to return example data set and environment variables, such as the gene expression profile and so on.

## Example 1 : Calculate the GDEscore.

The function `GetGDEscore` is used to calculate the gene differential expression score (GDEscore). This function requires users to input the gene expression matrix and the sample label (“1” represents the disease sample. “0” represents the normal sample.). These sample data are stored in this package.

The commands are as follows:

    # Obtain the example data
    GEP<-GetData_Mirna("GEP")
    label<-GetData_Mirna("label")
    # Calculate the zscore
    GDEscore<-GetGDEscore(GEP,label)
    head(GDEscore)

    ##         GDEscore
    ## CFH     15.74888
    ## KLHL13  23.12946
    ## CYP26B1 13.81447
    ## CFLAR   17.97727
    ## HSPB6   26.25801
    ## PDK4    23.36144

## Example 2 : Identify candidate miRNAs by random-walk algorithm.

The function `IdentifyMiRNA` is used to get a ranked list of strong and weak associations of miRNA with disease. According to our method, in this function, the user needs to enter the GDEscore which is the result of the `GetGDEscore` function. The nperm is the number of perturbations, and the damping is the restart probability of random walk. The commands are as follows:

    # load depend package
    require(igraph)
    # Calculate the centrality score of miRNAs
    MiRNAScore<-IdentifyMiRNA(de_kich,nperm = 10,damping = 0.9)
    ###view the result
    MiRNAScore[1:5,-2]

    ##               MiRNA Number   Score P-value   FDR
    ## 255   hsa-miR-21-5p     49 0.00195   0.000 0.000
    ## 505  hsa-miR-369-5p     14 0.00118   0.000 0.000
    ## 294  hsa-miR-26a-5p      4 0.00180   0.000 0.000
    ## 65  hsa-miR-1238-3p    140 0.00099   0.001 0.001
    ## 30   hsa-miR-10b-5p      5 0.00016   0.002 0.002

## Example 3 : Build a multivariate Cox regression model using the targets of a single miRNA.

The function `SingleMiRNA_CRModel` is used to build a multivariate Cox model. According to our method, in this function, the user needs to enter the miRNA of interest. The ExpData is a gene expression profile of interest. The MiRNA is the miRNA ID, and the SurvivalData is survival data. The cutoff.point is a number used to divide high-risk and low-risk groups by risk score (default is median). The commands are as follows:

    # load depend package
    require(survival)

    ## Loading required package: survival

    ## Warning: package 'survival' was built under R version 4.4.3

    ###Get the survival and gene expression data
    GEP<-GetData_Mirna("GEP")
    survival<-GetData_Mirna("survival")
    # Build a multivariate cox model
    SingleMiRNA_CRData<-SingleMiRNA_CRModel(GEP,"hsa-miR-21-5p",cutoff.point=NULL,survival)
    ###view the result
    data.frame(SingleMiRNA_CRData[[1]])[1:5,]

    ##                  status time TGFBR3 TIMP3 ACTA2 HIPK3 RECK       score group
    ## TCGA.3C.AAAU.01A      0 4047   -0.7   2.5  -0.6  -0.2 -0.9 -0.68851000   low
    ## TCGA.3C.AALI.01A      0 4005   -0.7  -0.3  -0.2  -1.2 -0.4 -0.12004687   low
    ## TCGA.3C.AALJ.01A      0 1474   -0.6   0.6  -0.3  -1.1 -0.7 -0.34622131   low
    ## TCGA.3C.AALK.01A      0 1448   -0.5   0.9   0.5  -0.7  0.3 -0.09028456   low
    ## TCGA.4H.AAAK.01A      0  348   -0.6   1.7   0.1  -0.7  1.7  0.19386280  high

    ###view the result
    data.frame(SingleMiRNA_CRData[[2]])[1:5,]

    ##               HR    HR.95L   HR.95H         beta      P.value
    ## TGFBR3 1.0318281 0.8706112 1.222899  0.031332068 0.7177529764
    ## TIMP3  0.8524133 0.7071201 1.027560 -0.159683772 0.0939703398
    ## ACTA2  0.9950312 0.8627226 1.147631 -0.004981226 0.9454468584
    ## HIPK3  1.0244660 0.8683418 1.208661  0.024171480 0.7744723663
    ## RECK   1.3431600 1.1423273 1.579301  0.295025067 0.0003565565

## Example 4 : Build a multivariate Cox regression model by integrating the models constructed separately based on different miRNA targets.

The function `MutiMiRNA_CRModel` is used to build a multivariate Cox model. According to our method, in this function, the user needs to enter the miRNAs of interest. The ExpData is a gene expression profile of interest, The MiRNAs is the miRNA ID, and the SurvivalData is survival data. The cutoff.point is a number used to divide high-risk and low-risk groups by risk score (default is median). The commands are as follows:

    # load depend package
    require(survival)
    ###Get the survival and gene expression data
    GEP<-GetData_Mirna("GEP")
    survival<-GetData_Mirna("survival")
    MiRNAs<-c("hsa-miR-21-5p","hsa-miR-26a-5p","hsa-miR-369-5p","hsa-miR-1238-3p","hsa-miR-10b-5p")
    # Build a multivariate cox model
    MutiMiRNA_CRData<-MutiMiRNA_CRModel(GEP,MiRNAs,cutoff.point=NULL,survival)

    ## [1] "No corresponding target gene of hsa-miR-26a-5p mirna was found in the difference list"
    ## [1] "No corresponding target gene of hsa-miR-10b-5p mirna was found in the difference list"

    ###view the result
    data.frame(MutiMiRNA_CRData[[1]])[1:5,]

    ##                  status time hsa.miR.21.5p hsa.miR.369.5p hsa.miR.1238.3p
    ## TCGA.3C.AAAU.01A      0 4047   -0.68851000     -0.1552759     -0.08893075
    ## TCGA.3C.AALI.01A      0 4005   -0.12004687     -0.1552759     -0.24731948
    ## TCGA.3C.AALJ.01A      0 1474   -0.34622131     -0.1330936     -0.15810997
    ## TCGA.3C.AALK.01A      0 1448   -0.09028456     -0.1109113     -0.13300097
    ## TCGA.4H.AAAK.01A      0  348    0.19386280     -0.1330936     -0.03888991
    ##                       score group
    ## TCGA.3C.AAAU.01A -0.5648601   low
    ## TCGA.3C.AALI.01A -0.1761486   low
    ## TCGA.3C.AALJ.01A -0.3255944   low
    ## TCGA.3C.AALK.01A -0.1038667   low
    ## TCGA.4H.AAAK.01A  0.2031208  high

    ###view the result
    data.frame(MutiMiRNA_CRData[[2]])[1:5,]

    ##                        HR    HR.95L   HR.95H       beta    P.value
    ## hsa.miR.21.5p   2.3360881 1.3589047 4.015960  0.8484778 0.00214504
    ## hsa.miR.369.5p  0.6294101 0.2297580 1.724236 -0.4629723 0.36789421
    ## hsa.miR.1238.3p 1.8058961 0.8265585 3.945589  0.5910569 0.13827022
    ## NA                     NA        NA       NA         NA         NA
    ## NA.1                   NA        NA       NA         NA         NA

## Visualize 1: Plot the Kaplan-Meier curve.

The function `plotSurvival` is used to plot the Kaplan-Meier. The user needs to enter the result of the `SingleMiRNA_CRModel` function or the `MutiMiRNA_CRModel` function. The commands are as follows:

    # load depend package
    require(survminer)

    ## Warning: package 'survminer' was built under R version 4.4.3

    ## Warning: package 'ggplot2' was built under R version 4.4.3

    require(survival)

    ###Get the survival and gene expression data
    GEP<-GetData_Mirna("GEP")
    survival<-GetData_Mirna("survival")
    # plot the Kaplan-Meier curve
    SingleMiRNA_CRData<-SingleMiRNA_CRModel(GEP,"hsa-miR-21-5p",cutoff.point=NULL,survival)
    PlotSurvival(SingleMiRNA_CRData)

## Visualize 2: Plot the heatmap of miRNA targets expression.

#####

The function `PlotHeatmap` can plot the heatmap of miRNA target expression. The user needs to enter the result of the `SingleMiRNA_CRModel` function or the `MutiMiRNA_CRModel`. The commands are as follows:

    # load depend package
    require(pheatmap)

    ## Warning: package 'pheatmap' was built under R version 4.4.3

    require(survival)
    ###Get the survival and gene expression data
    GEP<-GetData_Mirna("GEP")
    survival<-GetData_Mirna("survival")
    # plot the heatmap of miRNA targets expression
    SingleMiRNA_CRData<-SingleMiRNA_CRModel(GEP,"hsa-miR-21-5p",cutoff.point=NULL,survival)
    PlotHeatmap(SingleMiRNA_CRData)

## Visualize 3: Plot the forest diagram.

#####

The function `PlotForest` can visualize the result of Cox regression analysis through forest plot. The user needs to enter the result of the `SingleMiRNA_CRModel` function or the `MutiMiRNA_CRModel`. The commands are as follows:

    # load depend package
    require(forestplot)

    ## Warning: package 'forestplot' was built under R version 4.4.3

    ## Warning: package 'checkmate' was built under R version 4.4.3

    require(survival)
    ###Get the survival and gene expression data
    GEP<-GetData_Mirna("GEP")
    survival<-GetData_Mirna("survival")
    # plot the forest diagram
    SingleMiRNA_CRData<-SingleMiRNA_CRModel(GEP,"hsa-miR-21-5p",cutoff.point=NULL,survival)
    PlotForest(SingleMiRNA_CRData)

## Visualize 4: Plot the Scatter diagram.

#####

The function `PlotScatter` can visualize the clinical information of samples through scatter diagram. The user needs to enter the result of the `SingleMiRNA_CRModel` function or the `MutiMiRNA_CRModel`. The commands are as follows:

    # load depend package
    require(egg)

    ## Warning: package 'egg' was built under R version 4.4.3

    require(survival)
    require(ggplot2)
    ###Get the survival and gene expression data
    GEP<-GetData_Mirna("GEP")
    survival<-GetData_Mirna("survival")
    # plot the scatter diagram
    SingleMiRNA_CRData<-SingleMiRNA_CRModel(GEP,"hsa-miR-21-5p",cutoff.point=NULL,survival)
    PlotScatter(SingleMiRNA_CRData)