Skip to content

Inference with custom data provided by users

Shao, Xin edited this page Sep 29, 2024 · 7 revisions

We have made all data used in miRTalk inference as the system data, in order to allow that users can use their own data for the inference.Step-by-step procedures are shown below:

[1] load the example data

> load(paste0(system.file(package = 'miRTalk'), "/extdata/example.rda"))

> dim(sc_data)
[1] 22898   515

> table(sc_celltype)
sc_celltype
  Bcell Myeloid Stromal   Tcell   Tumor 
     83      38      23      54     317 

[2] create miRTalk object using single-cell transcriptomics data. Users can use their own evbiog and risc. See /data page for detailed information. Keep the data type and colnames consistent with the system data.frame when using your own evbiog_custom and risc_custom

> colnames(evbiog)
[1] "species" "gene"
> colnames(risc)
[1] "species" "gene"

> obj <- create_miRTalk(sc_data = sc_data,
                        sc_celltype = sc_celltype,
                        species = "Human",
                        condition = rep("condition",length(sc_celltype)),
                        evbiog = evbiog_custom,
                        risc = risc_custom)

[3] Find highly variable target genes with DEGs and HVGs with find_hvtg. Users can replace these genes stored in obj@data[["var_genes"]] with other genes, for example, var_genes_custom, a character containing genes. Please run find_hvtg before replacing

> obj <- find_hvtg(object = obj)
> str(obj@data[["var_genes"]])
 chr [1:3029] "MGP" "LUM" "DCD" "DCN" "IGKV2D-28" "IGKV3-11" "SPINK1" ...

> obj@data[["var_genes"]] <- var_genes_custom

[4] Find expressed miRNAs among all cells and generate background distribution for permutation test with find_miRNA. Users can use their own mir_info and mir2tar. See /data page for detailed information. Keep the data type and colnames consistent with the system data.frame when using your own mir_info_custom and mir2tar_custom

> colnames(mir_info)
 [1] "miRNA"             "miRNA_mature"      "gene"             
 [4] "species"           "EV_evidence"       "tissue_TarBase"   
 [7] "celltype_TarBase"  "seq"               "circulating_miRNA"
[10] "avg_rpm"
> colnames(mir2tar)
[1] "miRNA"        "source"       "miRNA_mature" "target_gene" 
[5] "species"      "experiments"  "support"      "pmid"        
[9] "regulation"

> obj <- find_miRNA(object = obj,
                    mir_info = mir_info_custom,
                    mir2tar = mir2tar_custom)

[5] Infer cell-cell communication mediated by EV-derived miRNAs from senders to receivers

> obj <- find_miRTalk(obj, if_doParallel = F)
[condition] 
[++++++++++++++++++++++++++++++] Finished:100% time:00:04:57

[6] Analysis of functional annotations for a miRNA and its target gene, for example, overlapped/shared pathways. Users can use their own gene2path and mir2path. See /data page for detailed information. Keep the data type and colnames consistent with the system data.frame when using your own gene2path_custom and mir2path_custom

> colnames(gene2path)
[1] "term"    "gene"    "type"    "species" "source" 
> colnames(mir2path)
[1] "term"   "mir"    "type"   "source"

> res_pathway <- get_miRTalk_pathway(object = obj,
                                     gene2path = gene2path_custom,
                                     mir2path = mir2path_custom,
                                     miRNA = "hsa-miR-133a-3p",
                                     targetgenes = "ANXA2")