biopipen 0.34.6__py3-none-any.whl → 0.34.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of biopipen might be problematic. Click here for more details.

biopipen/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.34.6"
1
+ __version__ = "0.34.7"
@@ -165,10 +165,12 @@ post_casing <- function(name, case) {
165
165
 
166
166
  if (length(cases) == 0 && name == "Marker Discovery") {
167
167
  name <- case$each
168
+ } else {
169
+ name <- paste0(name, " (", case$each, ")")
168
170
  }
169
171
 
170
172
  for (each in eachs) {
171
- newname <- paste0(name, " - ", each)
173
+ newname <- paste0(name, "::", each)
172
174
  newcase <- case
173
175
 
174
176
  newcase$original_case <- name
@@ -131,12 +131,14 @@ expand_each <- function(name, case) {
131
131
 
132
132
  if (length(cases) == 0 && name == "DEG Analysis") {
133
133
  name <- case$each
134
+ } else {
135
+ name <- paste0(name, " (", case$each, ")")
134
136
  }
135
137
 
136
138
  case$aggregate_by <- unique(c(case$aggregate_by, case$group_by, case$paired_by, case$each))
137
139
 
138
140
  for (each in eachs) {
139
- newname <- paste0(case$each, "::", each)
141
+ newname <- paste0(name, "::", each)
140
142
  newcase <- case
141
143
 
142
144
  newcase$original_case <- name
@@ -212,7 +214,52 @@ process_markers <- function(markers, info, case) {
212
214
  # markers <- markers %>%
213
215
  # mutate(gene = as.character(gene)) %>%
214
216
  # arrange(p_val_adj, desc(abs(avg_log2FC)))
217
+
218
+ empty <- if (case$enrich_style == "enrichr") {
219
+ data.frame(
220
+ Database = character(0),
221
+ Term = character(0),
222
+ Overlap = character(0),
223
+ P.value = numeric(0),
224
+ Adjusted.P.value = numeric(0),
225
+ Odds.Ratio = numeric(0),
226
+ Combined.Score = numeric(0),
227
+ Genes = character(0),
228
+ Rank = numeric(0)
229
+ )
230
+ } else { # clusterProfiler
231
+ data.frame(
232
+ ID = character(0),
233
+ Description = character(0),
234
+ GeneRatio = character(0),
235
+ BgRatio = character(0),
236
+ Count = integer(0),
237
+ pvalue = numeric(0),
238
+ p.adjust = numeric(0),
239
+ qvalue = numeric(0),
240
+ geneID = character(0),
241
+ Database = character(0)
242
+ )
243
+ }
244
+ if (is.null(markers) || nrow(markers) == 0) {
245
+ if (case$error) {
246
+ stop("Error: No markers found in case '", info$name, "'.")
247
+ } else {
248
+ log$warn("! Warning: No markers found in case '", info$name, "'.")
249
+ reporter$add2(
250
+ list(
251
+ name = "Warning",
252
+ contents = list(list(kind = "error", content = "No markers found.", kind_ = "warning"))),
253
+ hs = c(info$section, info$name),
254
+ hs2 = "DEG Analysis",
255
+ ui = "tabs"
256
+ )
257
+ return(empty)
258
+ }
259
+ }
215
260
  markers$gene <- as.character(markers$gene)
261
+ markers$p_val_adj <- as.numeric(markers$p_val_adj)
262
+ markers$log2FC <- as.numeric(markers$log2FC)
216
263
  markers <- markers[order(markers$p_val_adj, -abs(markers$log2FC)), ]
217
264
 
218
265
  # Save markers
@@ -287,7 +334,7 @@ process_markers <- function(markers, info, case) {
287
334
  stop("Error: Not enough significant DEGs with '", case$sigmarkers, "' in case '", info$name, "' found (< 5) for enrichment analysis.")
288
335
  } else {
289
336
  message <- paste0("Not enough significant DEGs with '", case$sigmarkers, "' found (< 5) for enrichment analysis.")
290
- log$warn(" ! Error: {message}")
337
+ log$warn("! Error: {message}")
291
338
  reporter$add2(
292
339
  list(
293
340
  name = "Warning",
@@ -345,7 +392,7 @@ process_markers <- function(markers, info, case) {
345
392
  if (case$error) {
346
393
  stop("Error: ", e$message)
347
394
  } else {
348
- log$warn(" ! Error: {e$message}")
395
+ log$warn("! Error: {e$message}")
349
396
  reporter$add2(
350
397
  list(
351
398
  name = "Warning",
@@ -478,6 +525,7 @@ process_overlaps <- function(markers, ovcases, casename, groupname) {
478
525
 
479
526
  run_case <- function(name) {
480
527
  case <- cases[[name]]
528
+ log$info("----------------------------------------")
481
529
  log$info("Case: {name} ...")
482
530
 
483
531
  case <- extract_vars(
@@ -558,16 +606,35 @@ run_case <- function(name) {
558
606
  return(invisible())
559
607
  }
560
608
 
609
+ info <- case_info(name, outdir, create = TRUE)
561
610
  exprs <- AggregateExpressionPseudobulk(
562
611
  srtobj, aggregate_by = aggregate_by, layer = layer, assay = assay,
563
612
  subset = subset, log = log
564
613
  )
565
- markers <- RunDEGAnalysis(
566
- exprs, group_by = group_by, ident_1 = ident_1, ident_2 = ident_2,
567
- paired_by = paired_by, tool = tool, log = log
614
+ markers <- tryCatch(
615
+ {
616
+ RunDEGAnalysis(
617
+ exprs, group_by = group_by, ident_1 = ident_1, ident_2 = ident_2,
618
+ paired_by = paired_by, tool = tool, log = log
619
+ )
620
+ }, error = function(e) {
621
+ if (error) {
622
+ stop("Error: ", e$message)
623
+ } else {
624
+ log$warn("! Error: {e$message}")
625
+ reporter$add2(
626
+ list(
627
+ name = "Warning",
628
+ contents = list(list(kind = "error", content = e$message, kind_ = "warning"))),
629
+ hs = c(info$section, info$name),
630
+ hs2 = "DEG Analysis",
631
+ ui = "tabs"
632
+ )
633
+ return(invisible())
634
+ }
635
+ }
568
636
  )
569
637
 
570
- info <- case_info(name, outdir, create = TRUE)
571
638
  enrich <- process_markers(markers, info = info, case = list(
572
639
  dbs = dbs,
573
640
  sigmarkers = sigmarkers,
@@ -83,10 +83,12 @@ expand_each <- function(name, case) {
83
83
 
84
84
  if (length(cases) == 0 && name == "GSEA") {
85
85
  name <- case$each
86
+ } else {
87
+ name <- paste0(name, " (", case$each, ")")
86
88
  }
87
89
 
88
90
  for (each in eachs) {
89
- newname <- paste0(case$each, "::", each)
91
+ newname <- paste0(name, "::", each)
90
92
  newcase <- case
91
93
 
92
94
  newcase$original_case <- paste0(name, " (all ", case$each,")")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: biopipen
3
- Version: 0.34.6
3
+ Version: 0.34.7
4
4
  Summary: Bioinformatics processes/pipelines that can be run from `pipen run`
5
5
  License: MIT
6
6
  Author: pwwang
@@ -1,4 +1,4 @@
1
- biopipen/__init__.py,sha256=QHGuacl6zpfoE0OOXgLhITO4iY3VuSxXyJ6Kvvrpg-E,23
1
+ biopipen/__init__.py,sha256=vVRUKRt0zUNKxfGQQE5WrQiVWQ-bg4UrgyEGX7LclcA,23
2
2
  biopipen/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  biopipen/core/config.py,sha256=edK5xnDhM8j27srDzsxubi934NMrglLoKrdcC8qsEPk,1069
4
4
  biopipen/core/config.toml,sha256=lZV_vbYWk6uqm19ZWJcsZCcSNqAdIfN2fOfamzxZpg4,2148
@@ -155,13 +155,13 @@ biopipen/scripts/scrna/ExprImputation-rmagic.R,sha256=ePgbMZ_3bKbeUrjsMdkdtBM_MS
155
155
  biopipen/scripts/scrna/ExprImputation-scimpute.R,sha256=MI_bYfvCDKJsuGntUxfx_-NdrssBoQgL95-DGwJVE5s,1191
156
156
  biopipen/scripts/scrna/ExprImputation.R,sha256=GcdZJpkDpq88hRQjtLZY5-byp8V43stEFm5T-pQbU6A,319
157
157
  biopipen/scripts/scrna/LoomTo10X.R,sha256=c6F0p1udsL5UOlb84-53K5BsjSDWkdFyYTt5NQmlIec,1059
158
- biopipen/scripts/scrna/MarkersFinder.R,sha256=P6BgseCrXTeJR8X52hzD16qBUuCeHmPc96h5pKE_-qY,24207
158
+ biopipen/scripts/scrna/MarkersFinder.R,sha256=A-YCJ2WogU2QR8PqVn71lXCP63Vq1sMyAAIhqZYYawg,24278
159
159
  biopipen/scripts/scrna/MetaMarkers.R,sha256=BgYaWYEj6obwqaZaDWqNPtxb1IEEAnXAeBE0Ji9PvBA,12426
160
160
  biopipen/scripts/scrna/ModuleScoreCalculator.R,sha256=-tByCPk7i070LynAb0z2ANeRxr1QqiKP0dfrJm52jH4,4198
161
- biopipen/scripts/scrna/PseudoBulkDEG.R,sha256=32Hd3x2WyTFv175Os4bxf6goAcIq7QN8m1i7i7emnMI,22308
161
+ biopipen/scripts/scrna/PseudoBulkDEG.R,sha256=Y5OuVCaIIppBqMxxXM3HpJQk5kA42wSgbBBIC1Rr1s0,24608
162
162
  biopipen/scripts/scrna/RadarPlots.R,sha256=Kn1E-hpczuujpgNjR8MqeIIVN-S3PbpmfcKWGKcNCVY,14546
163
163
  biopipen/scripts/scrna/SCImpute.R,sha256=dSJOHhmJ3x_72LBRXT72dbCti5oiB85CJ-OjWtqONbk,2958
164
- biopipen/scripts/scrna/ScFGSEA.R,sha256=Cbr1RE4jD3CbR7K4Y1XWKfcqiqhZmzATCKEd3ysCnCc,11517
164
+ biopipen/scripts/scrna/ScFGSEA.R,sha256=EyRbsH5d1daIxtOHjYz24Udmv1PhV0nUC9HqEtzRnpE,11584
165
165
  biopipen/scripts/scrna/ScSimulation.R,sha256=q0-dXD9px1cApc_TxGmR-OdNHE8W1VSVWfSI57B96bo,1697
166
166
  biopipen/scripts/scrna/ScVelo.py,sha256=SPUZFgZW1Zhw-bnjJo98RK0vpuNFODQ8Q3eTguNc84k,21359
167
167
  biopipen/scripts/scrna/Seurat2AnnData.R,sha256=F8g5n2CqX4-KBggxd8ittz8TejYuqqNLMudAHdFt1QM,184
@@ -284,7 +284,7 @@ biopipen/utils/misc.py,sha256=pDZ-INWVNqHuXYvcjmu8KqNAigkh2lsHy0BxX44CPvc,4048
284
284
  biopipen/utils/reference.py,sha256=Oc6IlA1giLxymAuI7DO-IQLHQ7-DbsWzOQE86oTDfMU,5955
285
285
  biopipen/utils/reporter.py,sha256=VwLl6xyVDWnGY7NEXyqBlkW8expKJoNQ5iTyZSELf5c,4922
286
286
  biopipen/utils/vcf.py,sha256=MmMbAtLUcKPp02jUdk9TzuET2gWSeoWn7xgoOXFysK0,9393
287
- biopipen-0.34.6.dist-info/METADATA,sha256=xjkZ-4jHx3uZyZwVYbfc0vlPlatZ927dHLpxm6y9ys0,975
288
- biopipen-0.34.6.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
289
- biopipen-0.34.6.dist-info/entry_points.txt,sha256=BYqHGBQJxyFDNLYqgH64ycI5PYwnlqwYcCFsMvJgzAU,653
290
- biopipen-0.34.6.dist-info/RECORD,,
287
+ biopipen-0.34.7.dist-info/METADATA,sha256=uR3Q2oygeFSoT96Lp0wQGCcigCJGaIyzbYzdJ2wlWVw,975
288
+ biopipen-0.34.7.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
289
+ biopipen-0.34.7.dist-info/entry_points.txt,sha256=BYqHGBQJxyFDNLYqgH64ycI5PYwnlqwYcCFsMvJgzAU,653
290
+ biopipen-0.34.7.dist-info/RECORD,,