From 5c8d50d9ec8994da107cbc5f554df35da8d430a8 Mon Sep 17 00:00:00 2001 From: Adina Jailova Date: Tue, 25 Feb 2025 20:37:33 -0500 Subject: [PATCH 1/2] Fixed bugs --- README.md | 45 +++++++++++++++------------------------------ 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 31421ec..70afe68 100644 --- a/README.md +++ b/README.md @@ -23,21 +23,20 @@ remotes::install_github('JEFworks-Lab/CRAWDAD') library(crawdad) library(tidyverse) -library(dplyr) -library(ggplot2) +library(gridExtra) + ## Load the spleen data of the pkhl sample data('pkhl') ## Load the spleen data of the ksfb sample data('ksfb') - all_celltypes <- unique(c(pkhl$celltype, ksfb$celltype)) colors <- rainbow(length(all_celltypes)) names(colors) <- all_celltypes ## Plot 1: pkhl dataset p1 <- pkhl %>% - ggplot(aes(pkhl$x, pkhl$y, color = pkhl$celltype)) + + ggplot(aes(x,y,color = celltype)) + geom_point(size = .01) + scale_color_manual(values = colors) + guides(colour = guide_legend(override.aes = list(size = 1))) + @@ -46,7 +45,7 @@ p1 <- pkhl %>% ## Plot 2: ksfb dataset p2 <- ksfb %>% - ggplot(aes(ksfb$x, ksfb$y, color = ksfb$celltype)) + + ggplot(aes(x,y,color = celltype)) + geom_point(size = .01) + scale_color_manual(values = colors) + guides(colour = guide_legend(override.aes = list(size = 1))) + @@ -56,7 +55,7 @@ p2 <- ksfb %>% options(repr.plot.width = 20, repr.plot.height = 9) grid.arrange(p1, p2, nrow = 1) ``` - + ## Determine neighboring distance @@ -67,6 +66,8 @@ For choosing neighboring distance for CRAWDAD analysis, please refer to the [CRA ```r ## pkhl sample +## Convert dataframe to spatial points (SP) +cells1 <- crawdad::toSF(pos = pkhl[,c("x", "y")], cellTypes = pkhl$celltypes) ## Define the scales to analyze the data scales1 <- c(100, 200, 300, 400, 500, 600, 700, 800, 900, 1000) ## Shuffle cells to create null background @@ -94,6 +95,8 @@ vizColocDotplot(dat_pkhl, zSigThresh = zsig1, zScoreLimit = 2*zsig1, ## ksfb sample +## Convert dataframe to spatial points (SP) +cells2 <- crawdad::toSF(pos = ksfb[,c("x", "y")], cellTypes = ksfb$celltypes) ## Define the scales to analyze the data scales2 <- c(100, 200, 300, 400, 500, 600, 700, 800, 900, 1000) ## Shuffle cells to create null background @@ -121,7 +124,7 @@ vizColocDotplot(dat_ksfb, zSigThresh = zsig2, zScoreLimit = 2*zsig2, theme(axis.text.x = element_text(angle = 35, h = 0)) ``` - + ## Multiple sample analysis ```r @@ -134,7 +137,7 @@ auc_samples <- calculateAUC(list(dat_pkhl, dat_ksfb)) options(repr.plot.width = 10, repr.plot.height = 9) vizVarianceSamples(auc_samples) ``` - + ## Visualize trends for one cell-type pair ```r @@ -148,8 +151,7 @@ d %>% vizTrends(lines = TRUE, withPerms = TRUE, zSigThresh = zsig1) ``` - - + ```r @@ -163,9 +165,7 @@ d %>% vizTrends(lines = TRUE, withPerms = TRUE, zSigThresh = zsig1) ``` - - - + ## Visualize cell-type relationships ```r @@ -219,8 +219,7 @@ neighbor_cell <- 'Fol B cells' plot_celltypes(c(reference_cell, neighbor_cell)) ``` - - + ```r @@ -229,20 +228,6 @@ neighbor_cell <- 'Fol B cells' plot_celltypes(c(reference_cell, neighbor_cell)) ``` - - - + -More details can be found in the tutorials. - -## Tutorials -- [`CRAWDAD` applied to simulated data](https://github.com/JEFworks/CRAWDAD/blob/main/docs/1_simulations.md) -- [`CRAWDAD` applied to a mouse embryo seqfish data](https://github.com/JEFworks/CRAWDAD/blob/main/docs/2_seqfish.md) -- [`CRAWDAD` applied to a mouse cerebellum slideseq data](https://github.com/JEFworks/CRAWDAD/blob/main/docs/2_slideseq.md) -- [`CRAWDAD` applied to a human spleen codex data](https://github.com/JEFworks/CRAWDAD/blob/main/docs/3_spleen.md) - -## Instalation - -CRAWDAD was tested on R version 4.3.0 (2023-04-21) -- "Already Tomorrow". -Installation time is 1 minute in a Mac Pro Computer. From 308c3d6e3cb030f475ec5dbeb5964060000719b9 Mon Sep 17 00:00:00 2001 From: Adina Jailova Date: Tue, 25 Feb 2025 20:41:52 -0500 Subject: [PATCH 2/2] Fixed bugs --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 70afe68..81d1228 100644 --- a/README.md +++ b/README.md @@ -231,3 +231,15 @@ plot_celltypes(c(reference_cell, neighbor_cell)) +More details can be found in the tutorials. + +## Tutorials +- [`CRAWDAD` applied to simulated data](https://github.com/JEFworks/CRAWDAD/blob/main/docs/1_simulations.md) +- [`CRAWDAD` applied to a mouse embryo seqfish data](https://github.com/JEFworks/CRAWDAD/blob/main/docs/2_seqfish.md) +- [`CRAWDAD` applied to a mouse cerebellum slideseq data](https://github.com/JEFworks/CRAWDAD/blob/main/docs/2_slideseq.md) +- [`CRAWDAD` applied to a human spleen codex data](https://github.com/JEFworks/CRAWDAD/blob/main/docs/3_spleen.md) + +## Instalation + +CRAWDAD was tested on R version 4.3.0 (2023-04-21) -- "Already Tomorrow". +Installation time is 1 minute in a Mac Pro Computer.