biopipen 0.34.14__py3-none-any.whl → 0.34.15__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.14"
1
+ __version__ = "0.34.15"
@@ -600,6 +600,28 @@ run_case <- function(name) {
600
600
 
601
601
  if (length(allenrich_plots) > 0 && !is.null(enriches) && nrow(enriches) > 0) {
602
602
  log$info("- Visualizing all enrichments together ...")
603
+ # add other metadata columns if any by mapping groupname
604
+ # only add the metadata columns from object if there is a single value mapped
605
+ metacols <- srtobj@meta.data %>% group_by(!!sym(each)) %>%
606
+ summarize(across(everything(), ~ n_distinct(.) == 1), .groups = "keep") %>%
607
+ select(where(~ all(. == TRUE))) %>%
608
+ colnames()
609
+
610
+ if (length(metacols) > 1) {
611
+ metadf <- srtobj@meta.data[, metacols, drop = FALSE] %>%
612
+ distinct(!!sym(each), .keep_all = TRUE)
613
+
614
+ for (col in setdiff(metacols, each)) {
615
+ if (col %in% colnames(enriches)) {
616
+ warning("Column name conflict: {col}, adding with suffix '_meta'", immediate. = TRUE)
617
+ metadf[[paste0(col, "_meta")]] <- metadf[[col]]
618
+ metadf[[col]] <- NULL
619
+ }
620
+ }
621
+
622
+ enriches <- left_join(enriches, metadf, by = each)
623
+ }
624
+
603
625
  process_allenriches(enriches, allenrich_plots, name, each)
604
626
  }
605
627
  }
@@ -659,6 +681,29 @@ run_case <- function(name) {
659
681
 
660
682
  if (length(allenrich_plots) > 0) {
661
683
  log$info("- Visualizing all enrichments together ...")
684
+ # add other metadata columns if any by mapping groupname
685
+ # only add the metadata columns from object if there is a single value mapped
686
+ metacols <- subobj@meta.data %>% group_by(!!sym(case$group_by)) %>%
687
+ summarize(across(everything(), ~ n_distinct(.) == 1), .groups = "keep") %>%
688
+ select(where(~ all(. == TRUE))) %>%
689
+ colnames()
690
+
691
+ if (length(metacols) > 1) {
692
+ metadf <- subobj@meta.data[, metacols, drop = FALSE] %>%
693
+ distinct(!!sym(case$group_by), .keep_all = TRUE)
694
+
695
+ for (col in setdiff(metacols, case$group_by)) {
696
+ if (col %in% colnames(enriches[[1]])) {
697
+ warning("Column name conflict: {col}, adding with suffix '_meta'", immediate. = TRUE)
698
+ metadf[[paste0(col, "_meta")]] <- metadf[[col]]
699
+ metadf[[col]] <- NULL
700
+ }
701
+ }
702
+
703
+ for (ne in names(enriches)) {
704
+ enriches[[ne]] <- left_join(enriches[[ne]], metadf, by = case$group_by)
705
+ }
706
+ }
662
707
  process_allenriches(enriches, allenrich_plots, name, case$group_by)
663
708
  }
664
709
  } else {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: biopipen
3
- Version: 0.34.14
3
+ Version: 0.34.15
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=EumHAzPCe3UipaK_9iqfQf47_8LP5jWSnXBVUZmzQTA,24
1
+ biopipen/__init__.py,sha256=Rz3xEpDF80HTbA8ImEKPXgpJjUW3trCJqVbTVpBlx44,24
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,7 +155,7 @@ 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=nz18T_70ni9sfoFYp8weQMCiojphF61l5yHe9f_gOSM,26320
158
+ biopipen/scripts/scrna/MarkersFinder.R,sha256=SBh3cA2WZQIlZTysAlU-U9knzO9gU0XW-yi8mk2iJG4,28588
159
159
  biopipen/scripts/scrna/MetaMarkers.R,sha256=BgYaWYEj6obwqaZaDWqNPtxb1IEEAnXAeBE0Ji9PvBA,12426
160
160
  biopipen/scripts/scrna/ModuleScoreCalculator.R,sha256=_mvo35a-wk5miUb_kMIVwvKK0b6InRa1NKtN8zznGwk,4457
161
161
  biopipen/scripts/scrna/PseudoBulkDEG.R,sha256=IuM4hl-KHZ5aaaTqZeylw4b1ZenMZaY4qobD5qxAlHs,25199
@@ -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.14.dist-info/METADATA,sha256=uIS3ZdJr3bVM1TspZIe2NmoVavOa_XGKe4qsuRk7gdw,1027
288
- biopipen-0.34.14.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
289
- biopipen-0.34.14.dist-info/entry_points.txt,sha256=BYqHGBQJxyFDNLYqgH64ycI5PYwnlqwYcCFsMvJgzAU,653
290
- biopipen-0.34.14.dist-info/RECORD,,
287
+ biopipen-0.34.15.dist-info/METADATA,sha256=ArJuTPoapr8eXqqyw0QMZkzalGdJLJED0QpmttmNSA0,1027
288
+ biopipen-0.34.15.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
289
+ biopipen-0.34.15.dist-info/entry_points.txt,sha256=BYqHGBQJxyFDNLYqgH64ycI5PYwnlqwYcCFsMvJgzAU,653
290
+ biopipen-0.34.15.dist-info/RECORD,,