Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
multitalk committed Sep 29, 2024
1 parent dfd7653 commit c544f8e
Show file tree
Hide file tree
Showing 8 changed files with 568 additions and 469 deletions.
20 changes: 3 additions & 17 deletions R/demo.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ demo_sc_data <- function() {
#' @examples geneinfo_demo <- demo_geneinfo()

demo_geneinfo <- function() {
gene1 <- c("A1BG", "A1BG", "A2MP1", "Aco1", "Alb1")
gene2 <- c("A1B", "ABG", "A2MP", "Aco", "Alb")
species <- c("Human", "Human", "Human", "Mouse", "Rat")
geneinfo_demo <- data.frame(symbol = gene1, synonyms = gene2, species = species, stringsAsFactors = FALSE)
return(geneinfo_demo)
return(head(geneinfo))
}

#' @title Demo data of mir_info
Expand All @@ -41,12 +37,7 @@ demo_geneinfo <- function() {
#' @examples mir_info_demo <- demo_mir_info()

demo_mir_info <- function() {
miRNA <- c("hsa-miR-1", "hsa-miR-1", "hsa-miR-1", "hsa-miR-1", "mmu-miR-105", "rno-miR-106b")
miRNA_mature <- c("hsa-miR-1-5p", "hsa-miR-1-5p", "hsa-miR-1-3p", "hsa-miR-1-3p", "mmu-miR-105", "rno-miR-106b-5p")
gene <- c("MIR1-1", "MIR1-2","MIR1-1", "MIR1-2", "Mir105", "Mir106b")
species <- c("Human", "Human", "Human", "Human", "Mouse", "Rat")
mir_info_demo <- data.frame(miRNA = miRNA, miRNA_mature = miRNA_mature, gene = gene, species = species, stringsAsFactors = FALSE)
return(mir_info_demo)
return(head(mir_info))
}

#' @title Demo data of mir2tar
Expand All @@ -57,10 +48,5 @@ demo_mir_info <- function() {
#' @examples mir2tar_demo <- demo_mir2tar()

demo_mir2tar <- function() {
miRNA <- c("hsa-miR-1", "hsa-miR-1", "mmu-miR-105", "rno-miR-106b")
miRNA_mature <- c("hsa-miR-1-5p", "hsa-miR-1-3p", "mmu-miR-105", "rno-miR-106b-5p")
target_gene <- c("BDNF", "RBM28", "Abl2", "Mcl1")
species <- c("Human", "Human", "Mouse", "Rat")
mir2tar_demo <- data.frame(miRNA = miRNA, miRNA_mature = miRNA_mature, target_gene = target_gene, species = species, stringsAsFactors = FALSE)
return(mir2tar_demo)
return(head(mir2tar))
}
5 changes: 2 additions & 3 deletions R/methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ find_hvtg <- function(object, pvalue = 0.05, log2fc = 0.5, min_cell_num = 10, nf
#' @description Find expressed miRNAs among all cells and generate background distribution for permutation test
#' @param object miRTalk object after \code{\link{create_miRTalk}}
#' @param mir_info A data.frame of the system data containing information of EV-derived miRNA of \code{'Human'}, \code{'Mouse'} or \code{'Rat'}. see \code{\link{demo_mir_info}}
#' @param mir2tar A data.frame of the system data containing relationship of miRNA and its target genes for \code{'Human'}, \code{'Mouse'} or \code{'Rat'}. see \code{\link{demo_mir2tar}}
#' @param mir2tar A data.frame of the system data containing miRNA-target interactions for \code{'Human'}, \code{'Mouse'} or \code{'Rat'}. see \code{\link{demo_mir2tar}}
#' @param min_percent Min percent of expressed cells for target genes of miRNA. Default is \code{0.05}
#' @param database Which database of miRNA-target interactions to use, "miRTarBase" and/or "TarBase". Default is the "miRTarBase". It can also be "TarBase" or c("miRTarBase", "TarBase")
#' @param resolution Correct to precursor or mature miRNAs. Use 'precursor' or 'mature'. Default is \code{'mature'}
Expand Down Expand Up @@ -253,7 +253,6 @@ find_miRNA <- function(object, mir_info, mir2tar, min_percent = 0.05, database =
#' @param min_percent Min percent of expressed cells for target genes of miRNA. Default is \code{0.05}
#' @param pvalue Cutoff of p value. Default is \code{0.05}
#' @param if_filter_miRNA Whether to filter the significantly highly expressed miRNAs. Default is FALSE
#' @param if_consider_condition Whether to infer for each condition. Default is TRUE
#' @param if_doParallel Use doParallel. Default is TRUE
#' @param use_n_cores Number of CPU cores to use. Default is 4
#' @return miRTalk object containing the inferred cell-cell communications mediated by EV-derived miRNAs
Expand All @@ -262,7 +261,7 @@ find_miRNA <- function(object, mir_info, mir2tar, min_percent = 0.05, database =
#' @importFrom correlation correlation
#' @export

find_miRTalk <- function(object, min_cell_num = 10, min_percent = 0.05, pvalue = 0.05, per_num = 1000, if_filter_miRNA = FALSE, if_consider_condition = TRUE, if_doParallel = TRUE, use_n_cores = 4) {
find_miRTalk <- function(object, min_cell_num = 10, min_percent = 0.05, pvalue = 0.05, per_num = 1000, if_filter_miRNA = FALSE, if_doParallel = TRUE, use_n_cores = 4) {
# check input
if (!is(object, "miRTalk")) {
stop("Invalid class for object: must be 'miRTalk'!")
Expand Down
1 change: 0 additions & 1 deletion R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,6 @@ plot_miR_bubble <- function(object, condition = NULL, celltype = NULL, miRNA = N
#' @param miRNA which miRNAs to use. Default is to plot all inferred miRNAs in senders.
#' @param edge_color Colors for the edges from the sender cell type
#' @param edge_type Types for the edges from the sender cell type. Default is \code{"circle"}. \code{"big.arrow"} for big arrow, "triangle" for triangle, "ellipse" for ellipse, "curved" for curved. Details see \code{\link[circlize]{chordDiagram}}
#' @param show_type which type of miRNAs to show, \code{"prob"} or \code{"score"} for inferred miRNAs-target interactions. Default is \code{"prob"}
#' @param text_size Size of text labels. Default is \code{0.5}
#' @param y_scale y_scale to adjust the text. Default is \code{1}
#' @param ... parameters pass to \code{\link[circlize]{chordDiagram}}, e.g., link.arr.width, link.arr.length, link.arr.col
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# miRTalk
[![R-CMD-check](https://img.shields.io/badge/R--CMD--check-passing-brightgreen?logo=github)](https://github.com/multitalk/miRTalk/actions/runs/5220129987) [![miRTalkDB](https://img.shields.io/badge/miRTalkDB-v1.0-yellow)](https://github.com/multitalk/miRTalk/tree/main/data) [![miRTalk-tutorial](https://img.shields.io/badge/miRTalk-tutorial-blue)](https://raw.githack.com/multitalk/miRTalk/main/vignettes/tutorial.html)
[![R-CMD-check](https://img.shields.io/badge/R--CMD--check-passing-brightgreen?logo=github)](https://github.com/multitalk/miRTalk/actions) [![miRTalkDB](https://img.shields.io/badge/miRTalkDB-v1.0-yellow)](https://github.com/multitalk/miRTalk/tree/main/data) [![miRTalk-tutorial](https://img.shields.io/badge/miRTalk-tutorial-blue)](https://raw.githack.com/multitalk/miRTalk/main/vignettes/tutorial.html)

### Extracellular vesicle-derived miRNA-mediated cell-cell communication inference for single-cell transcriptomic data

Expand Down
2 changes: 1 addition & 1 deletion man/find_miRNA.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions man/find_miRTalk.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions man/plot_miR2tar_chord.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1,002 changes: 561 additions & 441 deletions vignettes/tutorial.html

Large diffs are not rendered by default.

0 comments on commit c544f8e

Please sign in to comment.