biopipen 0.33.0__py3-none-any.whl → 0.33.1__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.33.0"
1
+ __version__ = "0.33.1"
biopipen/ns/scrna.py CHANGED
@@ -2628,3 +2628,20 @@ class SlingShot(Proc):
2628
2628
  "seed": 8525,
2629
2629
  }
2630
2630
  script = "file://../scripts/scrna/SlingShot.R"
2631
+
2632
+
2633
+ class LoomTo10X(Proc):
2634
+ """Convert Loom file to 10X format
2635
+
2636
+ Input:
2637
+ loomfile: The Loom file
2638
+
2639
+ Output:
2640
+ outdir: The output directory for the 10X format files,
2641
+ including the `matrix.mtx.gz`, `barcodes.tsv.gz` and `features.tsv.gz`
2642
+ files.
2643
+ """
2644
+ input = "loomfile:file"
2645
+ output = "outdir:dir:{{in.loomfile | stem}}.10X"
2646
+ lang = config.lang.rscript
2647
+ script = "file://../scripts/scrna/LoomTo10X.R"
@@ -54,7 +54,16 @@ get_plotthis_fn <- function(plot_type, gglogger_register = TRUE, return_name = F
54
54
  pie = "PieChart",
55
55
  wordcloud = "WordCloudPlot",
56
56
  venn = "VennDiagram",
57
- paste0(tools::toTitleCase(plot_type), "Plot")
57
+ {
58
+ title_case_plot_type <- tools::toTitleCase(plot_type)
59
+ if (endsWith(title_case_plot_type, "Plot")) {
60
+ title_case_plot_type
61
+ } else if (endsWith(title_case_plot_type, "plot")) {
62
+ paste0(substr(title_case_plot_type, 1, nchar(title_case_plot_type) - 4), "Plot")
63
+ } else {
64
+ paste0(title_case_plot_type, "Plot")
65
+ }
66
+ }
58
67
  )
59
68
  if (return_name) {
60
69
  return(fn_name)
@@ -0,0 +1,51 @@
1
+ library(loomR)
2
+ library(DropletUtils)
3
+ library(Matrix)
4
+
5
+ loomfile <- {{in.loomfile | r}}
6
+ outdir <- {{out.outdir | r}}
7
+
8
+ lfile <- connect(filename = loomfile, mode = "r")
9
+
10
+ # Extract the expression matrix (genes x cells)
11
+ expr_matrix <- t(lfile[["matrix"]][, ])
12
+ if (!inherits(expr_matrix, "dgCMatrix")) {
13
+ expr_matrix <- Matrix::Matrix(expr_matrix, sparse = TRUE)
14
+ }
15
+
16
+ # Extract gene names and IDs
17
+ gene_names <- lfile[["row_attrs/Gene"]][]
18
+
19
+ gene_ids <- tryCatch({
20
+ lfile[["row_attrs/GeneID"]][]
21
+ }, error = function(e) {
22
+ NULL
23
+ })
24
+
25
+ if (is.null(gene_ids)) {
26
+ gene_ids <- gene_names
27
+ }
28
+
29
+ # Extract cell barcodes
30
+ cell_barcodes <- lfile[["col_attrs/CellID"]][]
31
+
32
+ # Close the LOOM file connection
33
+ lfile$close_all()
34
+
35
+ # Create a data frame for gene information
36
+ gene_info <- data.frame(
37
+ gene_id = gene_ids,
38
+ gene_name = gene_names
39
+ )
40
+
41
+ # Write the data to 10X format
42
+
43
+ write10xCounts(
44
+ path = outdir,
45
+ x = expr_matrix,
46
+ gene.id = gene_info$gene_id,
47
+ gene.symbol = gene_info$gene_name,
48
+ barcodes = cell_barcodes,
49
+ version = "3",
50
+ overwrite = TRUE
51
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: biopipen
3
- Version: 0.33.0
3
+ Version: 0.33.1
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=6K931DiWIOR94oP_7w9oZPyA0wEqkdgU1lkcLFyRTMU,23
1
+ biopipen/__init__.py,sha256=NGQajgIUpsHZBmlrDBG3bxWb5zT8ur6HMm3aE6rnc7M,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
@@ -22,7 +22,7 @@ biopipen/ns/plot.py,sha256=XzLq0A8qCIQRbxhPEdWhEfbRZ8g3e4KriVz0RP8enNY,18078
22
22
  biopipen/ns/protein.py,sha256=YJtlKoHI2p5yHdxKeQnNtm5QrbxDGOq1UXOdt_7tlTs,6391
23
23
  biopipen/ns/regulatory.py,sha256=gJjGVpJrdv-rg2t5UjK4AGuvtLNymaNYNvoD8PhlbvE,15929
24
24
  biopipen/ns/rnaseq.py,sha256=bKAa6friFWof4yDTWZQahm1MS-lrdetO1GqDKdfxXYc,7708
25
- biopipen/ns/scrna.py,sha256=bZjIppqwmFb7Sc3GLyed8jd0tsvybSBq80uanmzU9WE,127673
25
+ biopipen/ns/scrna.py,sha256=rsbBD81wGHlrrOcmjyToYSbd8tM7-q7ugAO62Y1usx4,128130
26
26
  biopipen/ns/scrna_metabolic_landscape.py,sha256=6AhaynGG3lNRi96N2tReVT46BJMuEwooSSd2irBoN80,28347
27
27
  biopipen/ns/snp.py,sha256=iXWrw7Lmhf4_ct57HGT7JGTClCXUD4sZ2FzOgsC2pTg,28123
28
28
  biopipen/ns/stats.py,sha256=DlPyK5Vsg6ZEkV9SDS3aAw21eXzvOHgqeZDkXPhg7go,20509
@@ -113,7 +113,7 @@ biopipen/scripts/cnvkit/CNVkitScatter.py,sha256=jDbYlMMuedih8qhbC65cqrNsNflWXSnH
113
113
  biopipen/scripts/cnvkit/CNVkitSegment.py,sha256=YIgLo6ka8fBG1Ylb8pmbquwUl5B7SY42YlzZHgmp8y0,1656
114
114
  biopipen/scripts/cnvkit/guess_baits.py,sha256=mTy3AmyH5tkC_Mb_5IhQ_c0RssEGaCmoLPEVsW81yrY,10691
115
115
  biopipen/scripts/delim/RowsBinder.R,sha256=1QtRiPdUoxR8st1nxBMyVXgpcLfeF-iGsMYHz-66L2s,1465
116
- biopipen/scripts/delim/SampleInfo.R,sha256=EyvpLHCn2jpMKKw7MvMPZVSmkV7ZBp02q93ZQxg_RPU,4296
116
+ biopipen/scripts/delim/SampleInfo.R,sha256=KCdjLQ744bfp3ho3ZPoyZxM5kLB6tqi76CHEKvfk6b0,4673
117
117
  biopipen/scripts/gene/GeneNameConversion.R,sha256=Jy2ykhCj9ClSdQUfdYavh2LaBm0nOIXY2kJKmpsqOlI,1818
118
118
  biopipen/scripts/gene/GenePromoters.R,sha256=0ukq3-wpN6uq_cyJlQvKDVvy0Dv8cI5Htd9t2xpkEyk,2021
119
119
  biopipen/scripts/gsea/Enrichr.R,sha256=gqN93oE3OeqW_TXZiE_gNH89_o_XFwnOWcHxhTUMvNs,724
@@ -161,6 +161,7 @@ biopipen/scripts/scrna/ExprImputation-alra.R,sha256=xNdQiXgY13-iF16o2KgCJWfPIy4P
161
161
  biopipen/scripts/scrna/ExprImputation-rmagic.R,sha256=jYIfqZpnvjKJkvItLnemPVtUApHBYQi1_L8rHVbEe1M,735
162
162
  biopipen/scripts/scrna/ExprImputation-scimpute.R,sha256=mg40qCUW7-nP5oHPvARq7dmtoahM0GRFWXQpum0BXVk,1082
163
163
  biopipen/scripts/scrna/ExprImputation.R,sha256=GcdZJpkDpq88hRQjtLZY5-byp8V43stEFm5T-pQbU6A,319
164
+ biopipen/scripts/scrna/LoomTo10X.R,sha256=c6F0p1udsL5UOlb84-53K5BsjSDWkdFyYTt5NQmlIec,1059
164
165
  biopipen/scripts/scrna/MarkersFinder.R,sha256=D3vhxVYAc6kgPLjw05_D5yaXOaYKHoiZ-4OvQ7RdZ6s,13297
165
166
  biopipen/scripts/scrna/MetaMarkers.R,sha256=gJexrokGg0Q53N4Y4UA6707mn9Jxv-g_Qpp4Pi6xrs8,12438
166
167
  biopipen/scripts/scrna/ModuleScoreCalculator.R,sha256=QJ_E6qjRC8GazoopcxZfT5cKxlubf4dK-V7KLBB-yRE,4210
@@ -299,7 +300,7 @@ biopipen/utils/repr.R,sha256=GO5F5FFE4XjFXO5JODAJ7Nwvr00yiPMG34vIPMkKkrU,4016
299
300
  biopipen/utils/rnaseq.R,sha256=Ro2B2dG-Z2oVaT5tkwp9RHBz4dp_RF-JcizlM5GYXFs,1298
300
301
  biopipen/utils/single_cell.R,sha256=3jmTV9-kHTXyBA6GRlRf_Ig0jx_5jRr6E1THoa1869k,7564
301
302
  biopipen/utils/vcf.py,sha256=MmMbAtLUcKPp02jUdk9TzuET2gWSeoWn7xgoOXFysK0,9393
302
- biopipen-0.33.0.dist-info/METADATA,sha256=J_5O1LtSrQUaYsnmwkw8Hh9IjwULZZGlsmGfbWJU6lc,930
303
- biopipen-0.33.0.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
304
- biopipen-0.33.0.dist-info/entry_points.txt,sha256=BYqHGBQJxyFDNLYqgH64ycI5PYwnlqwYcCFsMvJgzAU,653
305
- biopipen-0.33.0.dist-info/RECORD,,
303
+ biopipen-0.33.1.dist-info/METADATA,sha256=6HmgRewJOLTI8m8x9R6rLCfOOhHNsyLLepXq-DyKrX0,930
304
+ biopipen-0.33.1.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
305
+ biopipen-0.33.1.dist-info/entry_points.txt,sha256=BYqHGBQJxyFDNLYqgH64ycI5PYwnlqwYcCFsMvJgzAU,653
306
+ biopipen-0.33.1.dist-info/RECORD,,