Skip to content

Commit 0dc91c0

Browse files
committed
Merge branch 'release/v2.0.12' into main
2 parents 90a7e5c + 99bac0d commit 0dc91c0

9 files changed

Lines changed: 53 additions & 21 deletions

File tree

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: scigenex
22
Type: Package
33
Title: The scigenex package (Single-Cell Informative GENe Explorer)
4-
Version: 2.0.11
4+
Version: 2.0.12
55
Date: 2020-07-22
66
Author: J. Bavais, Sebastien Nin, Lionel Spinelli and Denis Puthier
77
Maintainer: J. Bavais <julie.bavais@yahoo.fr>

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
MAKEFILE=Makefile
2-
VERSION=2.0.11
2+
VERSION=2.0.12
33

44
.PHONY: help
55

R/gm_report.R

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#' @param FeaturePlot_params Some parameters for Seurat::FeaturePlot() function.
3636
#' @param SpatialFeaturePlot_params Some parameters for Seurat::SpatialFeaturePlot() function.
3737
#' @param SpatialDimPlot_params Some parameters for Seurat::SpatialDimPlot() function.
38+
#' @param DimPlot_params Some parameters for Seurat::DimPlot() function.
3839
#' @param plot_ggheatmap_params Some parameters for plot_ggheatmap() function.
3940
#' @param subsample_by_ident_params The number of cell to take per cell type when subsampling the data for plotting interactive heatmap.
4041
#' Reduce this number if you have a large dataset (e.g. > 10000 cells/spots). Otherwise the dataset will be too large to be handled by the web browser.
@@ -145,13 +146,15 @@ gm_report <- function(cluster_set = NULL,
145146
name = "MOD_",
146147
slot = "data"),
147148
plot_profiles_params=list(to_lin=TRUE, averaged = TRUE),
148-
plot_multi_profiles_params=list(legend_name="Gene\nModule"),
149+
plot_multi_profiles_params=list(legend_name="Gene\nModule",
150+
center=FALSE),
149151
FeaturePlot_params=list(cols=RColorBrewer::brewer.pal(3, "BuPu")),
150152
SpatialFeaturePlot_params=list(pt.size.factor = 1.7),
151-
SpatialDimPlot_params=list(pt.size.factor = 1.7,
152-
label = T,
153-
repel = T,
154-
label.size = 4),
153+
SpatialDimPlot_params=list(pt.size.factor = 1.7),
154+
DimPlot_params=list(label = TRUE,
155+
label.size = 4,
156+
repel = TRUE,
157+
split.by = "orig.ident"),
155158
plot_ggheatmap_params=list(use_top_genes=FALSE,
156159
hide_gene_name=TRUE,
157160
xlab = "Cells/Spots",

R/plot_profiles.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ plot_profiles <- function(data = NULL,
103103

104104
colnames(m) <- c("Cluster", "Cell", "Intensity")
105105
m$Cluster <- factor(
106-
paste0("Cluster: ", m$Cluster),
107-
levels = paste0("Cluster: ", unique(m$Cluster)),
106+
paste0("Module: ", m$Cluster),
107+
levels = paste0("Module: ", unique(m$Cluster)),
108108
ordered = T
109109
)
110110

@@ -141,7 +141,7 @@ plot_profiles <- function(data = NULL,
141141
}
142142

143143

144-
df_text$Cluster <- factor(paste0("Cluster: ",
144+
df_text$Cluster <- factor(paste0("Module: ",
145145
rownames(centers)),
146146
ordered = T)
147147

R/visualization.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ setMethod(
728728
p <- p + ggplot2::theme_bw()
729729
p <- p + ggplot2::scale_fill_gradientn(
730730
colours = color.ramp,
731-
name = "Signal"
731+
name = "Scaled\nsignal"
732732
)
733733

734734
nb_cell_classes <- length(table(m_melt$cell_clusters))

changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## v2.0.12
4+
5+
* Various minor modif including split.by in Dimplot
6+
37
## v2.0.11
48

59
* Added sample_gg_heatmap arg to gm_report

inst/rmarkdown/index.Rmd

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ knitr::asis_output("A 2D plot showing the first and second components of the PCA
147147
```
148148

149149
```{r section_gen_info_14c, echo=FALSE, eval="exp_pca" %in% section, echo=FALSE, results = "asis"}
150-
Seurat::DimPlot(seurat_object, reduction = "pca")
150+
Seurat::DimPlot(seurat_object, reduction = "pca", label = TRUE, label.size = 4, repel = TRUE)
151151
```
152152

153153
```{r, section_gen_info_14d, eval="exp_elbow" %in% section, echo=FALSE, results = "asis"}
@@ -171,10 +171,32 @@ knitr::asis_output("A UMAP showing the cell/spot classes.")
171171
```
172172

173173
```{r section_gen_info_17, echo=FALSE, eval="exp_umap" %in% section, echo=FALSE, results = "asis"}
174-
Seurat::DimPlot(seurat_object)
174+
DimPlot_used_params <- as.list(formals(Seurat::DimPlot))
175+
for(i in names(DimPlot_params)){
176+
DimPlot_used_params[[i]] <- DimPlot_params[[i]]}
177+
DimPlot_used_params$object <- seurat_object
178+
DimPlot_used_params$split.by <- NULL
179+
DimPlot_used_params$group.by <- NULL
180+
print(base::do.call(Seurat::DimPlot, DimPlot_used_params))
175181
```
176182

177183

184+
```{r, section_gen_info_15_1, eval="exp_umap" %in% section, echo=FALSE, results = "asis"}
185+
knitr::asis_output("### Dimplot (by origin)")
186+
```
187+
188+
```{r, section_gen_info_16_1, eval="exp_umap" %in% section, echo=FALSE, results = "asis"}
189+
knitr::asis_output("A UMAP showing the cell/spot classes according to origin.")
190+
```
191+
192+
```{r section_gen_info_17_1, echo=FALSE, eval="exp_umap" %in% section, echo=FALSE, results = "asis"}
193+
DimPlot_used_params <- as.list(formals(Seurat::DimPlot))
194+
for(i in names(DimPlot_params)){
195+
DimPlot_used_params[[i]] <- DimPlot_params[[i]]}
196+
DimPlot_used_params$object <- seurat_object
197+
print(base::do.call(Seurat::DimPlot, DimPlot_used_params))
198+
```
199+
178200

179201
```{r, section_gen_info_17a, eval="exp_metrics" %in% section, echo=FALSE, results = "asis"}
180202
knitr::asis_output("### QC Metrics")

inst/rmarkdown/module.Rmd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,18 +184,18 @@ knitr::asis_output("What Gemini tells us about the likely cell identity or under
184184
```
185185

186186
```{r, cell_annot_IA_3_MOD_MODULE_NUMBER, echo=FALSE, eval="module_cell_annot_IA" %in% section }
187-
prompt <- paste0("\n\nGiven that you are a biologist working with ", smp_region, " cell compartment from ", smp_organ, " at ", smp_stage , " stage. ",
187+
prompt <- paste0("\n\nGiven a biological sample from ", smp_region, " cell compartment from ", smp_organ, " at ", smp_stage , " stage. ",
188188
"This biological sample was analyzed using transcriptomic analysis.",
189189
" You found a list of co-regulated genes that contains :",
190-
paste0(unlist(cluster_set[MODULE_NUMBER,]@gene_clusters), collapse=", "),
190+
paste0(sort(unlist(cluster_set[MODULE_NUMBER,]@gene_clusters)), collapse=", "),
191191
". What could be the cells, functions or pathways most likely related to theses genes ? The answers (n=4 in total) should be ordered by likelyhood and formatted as a list with the following item : 'infered cell type/function/pathway' (#1, #2, #3, #4) and 'rational'\n\n.", collapse=" ")
192192
193193
knitr::asis_output("#### Prompt")
194194
195195
knitr::asis_output(prompt)
196-
196+
cat("\n\n")
197197
knitr::asis_output("#### IA Answer")
198-
198+
cat("\n\n")
199199
suppressMessages(gemini.R::setAPI("APIKEY"))
200200
answer <- NULL
201201
try_err <- try(suppressMessages(gemini.R::gemini_chat(prompt)))
@@ -204,7 +204,7 @@ if(inherits(try_err, "try-error")){
204204
cat("\n\nSeems we have an issue with Gemini...\n\n")
205205
}else{
206206
if(!is.null(try_err) )
207-
knitr::asis_output(try_err$outputs )
207+
knitr::asis_output(paste0("\n\n", try_err$outputs, "\n\n"))
208208
}
209209
210210
cat("\n\n")

man/gm_report.Rd

Lines changed: 6 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)