Skip to content

Commit c28e91f

Browse files
authored
0.34.25 (#188)
1 parent 7a97994 commit c28e91f

8 files changed

Lines changed: 38 additions & 7 deletions

File tree

‎biopipen/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.34.24"
1+
__version__ = "0.34.25"

‎biopipen/ns/scrna.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1862,6 +1862,7 @@ class ScFGSEA(Proc):
18621862
group_by: The column name in metadata to group the cells.
18631863
ident_1: The first group of cells to compare
18641864
ident_2: The second group of cells to compare, if not provided, the rest of the cells that are not `NA`s in `group_by` column are used for `ident_2`.
1865+
assay: The assay to use. If not provided, the default assay will be used.
18651866
each: The column name in metadata to separate the cells into different subsets to do the analysis.
18661867
subset: An expression to subset the cells.
18671868
gmtfile: The pathways in GMT format, with the gene names/ids in the same format as the seurat object.
@@ -1929,6 +1930,7 @@ class ScFGSEA(Proc):
19291930
envs = {
19301931
"mutaters": {},
19311932
"ncores": config.misc.ncores,
1933+
"assay": None,
19321934
"group_by": None,
19331935
"ident_1": None,
19341936
"ident_2": None,
@@ -3208,7 +3210,7 @@ class PseudoBulkDEG(Proc):
32083210
"subset": None,
32093211
"aggregate_by": None,
32103212
"layer": "counts",
3211-
"assay": "RNA",
3213+
"assay": None,
32123214
"error": False,
32133215
"group_by": None,
32143216
"ident_1": None,

‎biopipen/scripts/scrna/CellTypeAnnotation.R‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ rename_idents <- function(sobj, ident_col, mapping) {
3030
mapping$object <- sobj
3131
sobj <- do_call(RenameIdents, mapping)
3232
}
33-
Idents(sobj) <- ident_col
33+
sobj@meta.data[[ident_col]] <- Idents(sobj)
3434
sobj
3535
}
3636

‎biopipen/scripts/scrna/PseudoBulkDEG.R‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
library(rlang)
22
library(dplyr)
33
library(plotthis)
4+
library(Seurat)
45
library(biopipen.utils)
56

67
sobjfile <- {{in.sobjfile | r}}

‎biopipen/scripts/scrna/ScFGSEA.R‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ mutaters <- {{envs.mutaters | r}} # nolint
1010
group_by <- {{envs.group_by | default: envs["group-by"] | default: None | r}} # nolint
1111
ident_1 <- {{envs.ident_1 | default: envs["ident-1"] | default: None | r}} # nolint
1212
ident_2 <- {{envs.ident_2 | default: envs["ident-2"] | default: None | r}} # nolint
13+
assay <- {{envs.assay | r}} # nolint
1314
each <- {{envs.each | r}} # nolint
1415
subset <- {{envs.subset | r}} # nolint
1516
gmtfile <- {{envs.gmtfile | r}} # nolint
@@ -43,6 +44,7 @@ defaults <- list(
4344
group_by = group_by,
4445
ident_1 = ident_1,
4546
ident_2 = ident_2,
47+
assay = assay,
4648
each = each,
4749
subset = subset,
4850
gmtfile = gmtfile,
@@ -230,7 +232,7 @@ do_case <- function(name) {
230232
case$ident_2 <- "Other"
231233
allclasses[allclasses != case$ident_1] <- "Other"
232234
}
233-
exprs <- GetAssayData(sobj, layer = "data")
235+
exprs <- GetAssayData(sobj, layer = "data", assay = case$assay)
234236

235237
# get preranks
236238
log$info(" Getting preranks...")

‎docs/CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Change Log
22

3+
## 0.34.25
4+
5+
- fix(scrna.PseudoBulkDEG): change default assay from "RNA" to None so that default assay can be used by default
6+
- feat(scrna.ScFGSEA): add assay parameter to allow specification of assay in analysis
7+
- fix(scrna.CellTypeAnnotation): correct assignment of identities in rename_idents function
8+
39
## 0.34.24
410

511
- feat(tcr.ClonalStats): add save_data parameter to ClonalStats for saving plot data

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "biopipen"
3-
version = "0.34.24"
3+
version = "0.34.25"
44
description = "Bioinformatics processes/pipelines that can be run from `pipen run`"
55
authors = ["pwwang <pwwang@pwwang.com>"]
66
license = "MIT"

‎tests/test_scrna/Seurat/test.py‎

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,33 @@ class CellTypeAnnotation(CellTypeAnnotation_):
115115
}
116116

117117

118+
class CellTypeAnnotationDirect(CellTypeAnnotation_):
119+
requires = SeuratClustering
120+
envs = {
121+
"tool": "direct",
122+
"cell_types": [
123+
"Naive CD4+ T",
124+
"B",
125+
"Memory CD4+",
126+
"Naive CD4+ T",
127+
"DC",
128+
"DC",
129+
"CD8+ T",
130+
"NK",
131+
"FCFR3A+ Mono",
132+
"CD8+ T",
133+
],
134+
"merge": True,
135+
}
136+
137+
118138
class TopExpressingGenes(TopExpressingGenes_):
119139
requires = CellTypeAnnotation
120140
envs = {"cases": {"Cluster": {}}}
121141

122142

123143
class SeuratSubClustering(SeuratSubClustering_):
124-
requires = CellTypeAnnotation
144+
requires = SeuratClustering
125145
envs = {
126146
"cache": False,
127147
"cases": {
@@ -245,7 +265,7 @@ class SeuratClusterStats(SeuratClusterStats_):
245265
},
246266
"Number of cells in each old cluster": {
247267
"plot_type": "pie",
248-
"ident": "seurat_clusters_id",
268+
"ident": "seurat_clusters.0.2",
249269
},
250270
},
251271
"features": {

0 commit comments

Comments
 (0)