Skip to content

Commit

Permalink
add_build_orthg_db_tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
jiang-junyao committed Aug 27, 2024
1 parent f5483b7 commit f6cb72d
Show file tree
Hide file tree
Showing 9 changed files with 2,530 additions and 8 deletions.
Binary file removed .RDataTmp
Binary file not shown.
Binary file removed .RDataTmp1
Binary file not shown.
Binary file added .RDataTmp5
Binary file not shown.
512 changes: 512 additions & 0 deletions .Rhistory

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions .gitignore

This file was deleted.

4 changes: 3 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ For users who want to perform cross-species analysis quickly, we provide a brief

[Quick tutorial for identifying evolutionally conserved gene regulatory networks](https://jiang-junyao.github.io/CACIMAR/quick_grn.html)

[Quick tutorial for identifying evolutionally conserved ligand-receptor interaction and cell-cell communications (coming soon)]()
[Quick tutorial for identifying evolutionally conserved ligand-receptor interaction and cell-cell communications](https://jiang-junyao.github.io/CACIMAR/quick_interaction.html)

[Tutorial for build customized orthg database based on MGI](https://jiang-junyao.github.io/CACIMAR/build_db.html)

## Examples

Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ data](https://jiang-junyao.github.io/CACIMAR/quick_celltype.html)
networks](https://jiang-junyao.github.io/CACIMAR/quick_grn.html)

[Quick tutorial for identifying evolutionally conserved ligand-receptor
interaction and cell-cell communications (coming soon)]()
interaction and cell-cell
communications](https://jiang-junyao.github.io/CACIMAR/quick_interaction.html)

[Tutorial for build customized orthg database based on
MGI](https://jiang-junyao.github.io/CACIMAR/build_db.html)

## Examples

Expand Down
54 changes: 54 additions & 0 deletions docs/.Rhistory
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
## Global options
knitr::opts_chunk$set(cache = TRUE)
library(CACIMAR)
load(system.file("extdata", "zf_mm_markers.rda", package = "CACIMAR"))
### identify evolutionarily conserved cell types based on conservation score of cell types (CSCT)
OrthG <- OrthG_Mm_Zf
expression <- Identify_ConservedCellTypes(OrthG, Zf_marker, Mm_marker,'zf','mm')
### identify evolutionarily conserved cell types based on conservation score of cell types (CSCT)
OrthG <- OrthG_Mm_Zf
expression <- Identify_ConservedCellTypes(OrthG, zf_marker, mm_marker,'zf','mm')
SCT_matrix <- expression[[2]]
SNT_h <- SNT[grep('mm',rownames(SCT_matrix)),as.numeric(grep('zf',colnames(SCT_matrix)))]
SNT_h <- expression[[2]][grep('mm',rownames(SCT_matrix)),as.numeric(grep('zf',colnames(SCT_matrix)))]
Heatmap_Cor(SNT_h,cluster_cols=F, cluster_rows=F,Color1 = c(rgb(102/255,46/255,115/255),rgb(31/255,153/255,139/255),rgb(251/255,232/255,48/255)))
Heatmap_Cor(expression[[2]],cluster_cols=F, cluster_rows=F,Color1 = c(rgb(102/255,46/255,115/255),rgb(31/255,153/255,139/255),rgb(251/255,232/255,48/255)))
Heatmap_Cor(SNT_h,cluster_cols=T, cluster_rows=T,Color1 = c(rgb(102/255,46/255,115/255),rgb(31/255,153/255,139/255),rgb(251/255,232/255,48/255)))
### get the conserved cell types based on the mutually matched and bigger than 3/4 CSCT score
conserved_hm_celltypes <- get_conserved_hm_celltypes(SNT_h)
get_conserved_hm_celltypes <- function(data) {
conserved_hm_celltypes_df <- data.frame()
for (i in 1:nrow(data)) {
single_row <- data[i, ]
max_col_id <- which.max(single_row)
single_col <- data[, max_col_id]
max_row_id <- which.max(single_col)
if (max_row_id == i) {
if (data[i, max_col_id] > quantile(data, 0.75)) {
conserved_hm_celltypes_df <- rbind(conserved_hm_celltypes_df, c(rownames(data)[i], colnames(data)[max_col_id]))
}
}
}
conserved_hm_celltypes <- unlist(as.vector(conserved_hm_celltypes_df), use.names = FALSE)
return(conserved_hm_celltypes)
}
### get the conserved cell types based on the mutually matched and bigger than 3/4 CSCT score
conserved_hm_celltypes <- get_conserved_hm_celltypes(SNT_h)
### used my pointed colors
load(system.file("extdata", "zf_mm_colors_prefix.Rda", package = "CACIMAR"))
### generate a phylogenetic tree
p <- Plot_phylogenetic_tree(SCT_matrix = SCT_matrix,
species.vector = species.vector,
conserved_hm_celltype = conserved_hm_celltypes,
annotation_colors_df = bind_colors,
colors_labels = c("Mouse", "Zebrafish"))
View(mm_marker)
mm_marker$cluster
mm_marker$cluster = gsub('mm','',mm_marker$cluster)
zf_marker$cluster = gsub('zf','',zf_marker$cluster)
SCT_matrix <- expression[[2]]
SNT_h <- expression[[2]][grep('mm',rownames(SCT_matrix)),as.numeric(grep('zf',colnames(SCT_matrix)))]
### show the CSCT value with a heatmap
Heatmap_Cor(SNT_h,cluster_cols=F, cluster_rows=F,Color1 = c(rgb(102/255,46/255,115/255),rgb(31/255,153/255,139/255),rgb(251/255,232/255,48/255)))
save(mm_marker,zf_marker,'F:\\platform\\CCtMR\\inst\\extdata\\zf_mm_markers.rda')
save(mm_marker,zf_marker,file = 'F:\\platform\\CCtMR\\inst\\extdata\\zf_mm_markers.rda')
1,956 changes: 1,956 additions & 0 deletions docs/build_db.html

Large diffs are not rendered by default.

0 comments on commit f6cb72d

Please sign in to comment.