-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f5483b7
commit f6cb72d
Showing
9 changed files
with
2,530 additions
and
8 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
Large diffs are not rendered by default.
Oops, something went wrong.