biopipen 0.27.8__py3-none-any.whl → 0.27.9__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.27.8"
1
+ __version__ = "0.27.9"
biopipen/ns/tcr.py CHANGED
@@ -1310,6 +1310,10 @@ class TCRClusterStats(Proc):
1310
1310
  numbers on the heatmap.
1311
1311
  - heatmap_meta (list): The columns of metadata to show on the
1312
1312
  heatmap.
1313
+ - cluster_rows (flag): Whether to cluster the rows on the heatmap.
1314
+ - sample_order: The order of the samples on the heatmap.
1315
+ Either a string separated by `,` or a list of sample names.
1316
+ This only works for columns if `cluster_rows` is `True`.
1313
1317
  - grouping: The groups to investigate the shared clusters.
1314
1318
  If specified, venn diagrams will be drawn instead of heatmaps.
1315
1319
  In such case, `numbers_on_heatmap` and `heatmap_meta` will be
@@ -1373,6 +1377,9 @@ class TCRClusterStats(Proc):
1373
1377
  "shared_clusters": {
1374
1378
  "numbers_on_heatmap": True,
1375
1379
  "heatmap_meta": [],
1380
+ "cluster_rows": True,
1381
+ "sample_order": None,
1382
+ "cluster_rows": True,
1376
1383
  "grouping": None,
1377
1384
  "devpars": {"width": 1000, "height": 1000, "res": 100},
1378
1385
  "cases": {},
@@ -137,6 +137,26 @@ shared_clusters = function(name) {
137
137
  anno = do_call(ComplexHeatmap::HeatmapAnnotation, anno)
138
138
  }
139
139
 
140
+ if (!is.null(case$sample_order) && length(case$sample_order) > 0) {
141
+ if (length(case$sample_order) == 1) {
142
+ case$sample_order = trimws(strsplit(case$sample_order, ",")[[1]])
143
+ }
144
+ nonexisting = setdiff(case$sample_order, samples)
145
+ if (length(nonexisting) > 0) {
146
+ stop(paste(" The following samples do not exist in `sample_order`:", paste(nonexisting, collapse=", ")))
147
+ }
148
+ plotdata = plotdata[, case$sample_order, drop=FALSE]
149
+ }
150
+
151
+ cluster_rows = case$cluster_rows && nrow(plotdata) > 2
152
+ col_samples = colnames(plotdata)
153
+ if (!cluster_rows) {
154
+ plotdata = plotdata[col_samples, ]
155
+ row_samples = col_samples
156
+ } else {
157
+ row_samples = samples
158
+ }
159
+
140
160
  # Plot heatmap
141
161
  plotHeatmap(
142
162
  plotdata,
@@ -144,12 +164,12 @@ shared_clusters = function(name) {
144
164
  name = "Shared TCR Clusters",
145
165
  col = c("#ffe1e1", "red3"),
146
166
  cluster_columns = FALSE,
147
- cluster_rows = nrow(plotdata) > 2,
167
+ cluster_rows = cluster_rows,
148
168
  top_annotation = anno,
149
169
  cell_fun = if (
150
170
  is.null(case$numbers_on_heatmap) || !case$numbers_on_heatmap
151
171
  ) NULL else function(j, i, x, y, width, height, fill) {
152
- grid.text(plotdata[samples[i], samples[j]], x, y, gp = gpar(fontsize = 10))
172
+ grid.text(row_samples[i], col_samples[j], x, y, gp = gpar(fontsize = 10))
153
173
  }
154
174
  ),
155
175
  devpars = case$devpars,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: biopipen
3
- Version: 0.27.8
3
+ Version: 0.27.9
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=tTYofCNMPRiC5Qs7KVRV32NVPrdQ2HjfgoMDf4fChsQ,23
1
+ biopipen/__init__.py,sha256=sJWdNHkiTx9zQyc6_YJknVzen19cpBrSswdfVQaZ7S8,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=20RCI30Peee1EQdfb_UbV3Hf74XUPndJnYZlUThytsw,1781
@@ -26,7 +26,7 @@ biopipen/ns/scrna_metabolic_landscape.py,sha256=6AhaynGG3lNRi96N2tReVT46BJMuEwoo
26
26
  biopipen/ns/snp.py,sha256=EQ2FS0trQ7YThPmBVTpS66lc2OSfgQ6lCh6WnyP-C2g,5499
27
27
  biopipen/ns/stats.py,sha256=yJ6C1CXF84T7DDs9mgufqUOr89Rl6kybE5ji8Vnx6cw,13693
28
28
  biopipen/ns/tcgamaf.py,sha256=AFbUJIxiMSvsVY3RcHgjRFuMnNh2DG3Mr5slLNEyz6o,1455
29
- biopipen/ns/tcr.py,sha256=7F_FulZ3UGouuvgH_ylZwJybr_310f9BTz_kouO1SjY,87905
29
+ biopipen/ns/tcr.py,sha256=0PCF8iPZ629z6P3RHoAWEpMWmuDslomTGcMopjqvXmE,88304
30
30
  biopipen/ns/vcf.py,sha256=cdkKroii0_nl_bSP2cnO09qESUAhHqu6btOiTSKS79Y,15314
31
31
  biopipen/ns/web.py,sha256=3zucrDo-IVsSnIvlw-deoScuxqWa6OMTm8Vo-R4E44Q,2224
32
32
  biopipen/reports/bam/CNAClinic.svelte,sha256=D4IxQcgDCPQZMbXog-aZP5iJEQTK2N4i0C60e_iXyfs,213
@@ -193,7 +193,7 @@ biopipen/scripts/tcr/ImmunarchFilter.R,sha256=o25O36FwH_0w6F8DFQ0SfpcwDzlzaGefXq
193
193
  biopipen/scripts/tcr/ImmunarchLoading.R,sha256=l_l-gojiCKI_MWgIUe2zG5boVtNipBv4rACRJEcrnFE,5734
194
194
  biopipen/scripts/tcr/ImmunarchSplitIdents.R,sha256=FGCeGV0uSmFU91lKkldUAeV4A2m3hHw5X4GNi8ffGzI,1873
195
195
  biopipen/scripts/tcr/SampleDiversity.R,sha256=jQ1OU3b8vswD8tZhLt3fkcqJKrl2bhQX0giHM2rXz3Y,2643
196
- biopipen/scripts/tcr/TCRClusterStats.R,sha256=D7q1svXQxl1uOya8bePvR9e6NJXjCjXbPsXnEPTWdlE,12004
196
+ biopipen/scripts/tcr/TCRClusterStats.R,sha256=aaY9w1GZWQLVQR7wl8POGCzzW7q0ge6cWxrzmqoWNA8,12743
197
197
  biopipen/scripts/tcr/TCRClustering.R,sha256=eflUsYfq4aEaX9BVL0MiB7lNlot_L-8VaReK516go84,9236
198
198
  biopipen/scripts/tcr/TCRDock.py,sha256=jjzxMWp-hs0LDtA1mVbiWDvUieSO7X-F9yeKGy1LSTM,3026
199
199
  biopipen/scripts/tcr/TESSA.R,sha256=bfOixWLZy8yi0MzXncP67KjtCukwXEzsK5fCdMzB5VM,6822
@@ -240,7 +240,7 @@ biopipen/utils/reference.py,sha256=6bPSwQa-GiDfr7xLR9a5T64Ey40y24yn3QfQ5wDFZkU,4
240
240
  biopipen/utils/rnaseq.R,sha256=Ro2B2dG-Z2oVaT5tkwp9RHBz4dp_RF-JcizlM5GYXFs,1298
241
241
  biopipen/utils/single_cell.R,sha256=pJjYP8bIZpNAtTQ32rOXhZxaM1Y-6D-xUcK3pql9tbk,4316
242
242
  biopipen/utils/vcf.py,sha256=ajXs0M_QghEctlvUlSRjWQIABVF02wPdYd-0LP4mIsU,9377
243
- biopipen-0.27.8.dist-info/METADATA,sha256=3rTtE5ECOr8Y67BOOCAfleIqkVabeEstjmhzKwxUI-w,882
244
- biopipen-0.27.8.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
245
- biopipen-0.27.8.dist-info/entry_points.txt,sha256=wu70aoBcv1UahVbB_5237MY-9M9_mzqmWjDD-oi3yz0,621
246
- biopipen-0.27.8.dist-info/RECORD,,
243
+ biopipen-0.27.9.dist-info/METADATA,sha256=-Uvdu_dbpiM0EPBLSFLhhpySPAPxGtA6_FjRlMo0bME,882
244
+ biopipen-0.27.9.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
245
+ biopipen-0.27.9.dist-info/entry_points.txt,sha256=wu70aoBcv1UahVbB_5237MY-9M9_mzqmWjDD-oi3yz0,621
246
+ biopipen-0.27.9.dist-info/RECORD,,