biopipen 0.22.1__py3-none-any.whl → 0.22.2__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.22.1"
1
+ __version__ = "0.22.2"
biopipen/core/config.toml CHANGED
@@ -4,6 +4,8 @@
4
4
  bedtools = "bedtools"
5
5
  # bcftools to handle bcf/vcf files
6
6
  bcftools = "bcftools"
7
+ # cellranger
8
+ cellranger = "cellranger"
7
9
  # Control-FREEC to call cnvs
8
10
  freec = "freec"
9
11
  # liftover coordinates across genomes
@@ -59,6 +61,10 @@ liftover_chain = ""
59
61
  # tmpdir = ""
60
62
 
61
63
  [ref]
64
+ # The reference for cellranger gex
65
+ ref_cellranger_gex = ""
66
+ # The reference for cellranger vdj
67
+ ref_cellranger_vdj = ""
62
68
  # The reference genome
63
69
  reffa = ""
64
70
  # The directory with reference for each chromosome
biopipen/core/filters.py CHANGED
@@ -15,6 +15,7 @@ filtermanager = FilterManager()
15
15
  @filtermanager.register
16
16
  def dict_to_cli_args(
17
17
  dic: Mapping[str, Any],
18
+ exclude: List[str] = None,
18
19
  prefix: str | None = None,
19
20
  sep: str | None = " ",
20
21
  dup_key: bool = True,
@@ -27,6 +28,7 @@ def dict_to_cli_args(
27
28
 
28
29
  Args:
29
30
  dic: The dict to convert
31
+ exclude: The keys to exclude
30
32
  prefix: The prefix of the keys after conversion
31
33
  Defaults to `None`, mean `-` for short keys and `--` for long keys
32
34
  sep: The separator between key and value
@@ -37,6 +39,13 @@ def dict_to_cli_args(
37
39
  If `sep` is `None` or `=`, this must be True, otherwise an error
38
40
  will be raised
39
41
  join: Whether to join the arguments into a single string
42
+ start_key: The key to start the arguments
43
+ This is useful when you want to put some arguments at the beginning
44
+ of the command line
45
+ end_key: The key to end the arguments
46
+ This is useful when you want to put some arguments at the end
47
+ of the command line
48
+ dashify: Whether to replace `_` with `-` in the keys
40
49
 
41
50
  Returns:
42
51
  The converted string or list of strings
@@ -44,6 +53,9 @@ def dict_to_cli_args(
44
53
  if sep in [None, "="] and not dup_key:
45
54
  raise ValueError("`dup_key` must be True when sep is `None` or `=`")
46
55
 
56
+ if exclude:
57
+ dic = {k: v for k, v in dic.items() if k not in exclude}
58
+
47
59
  starts = []
48
60
  ends = []
49
61
  out = []
@@ -0,0 +1,101 @@
1
+ """Cellranger pipeline module for BioPipen"""
2
+ from ..core.proc import Proc
3
+ from ..core.config import config
4
+
5
+
6
+ class CellRangerCount(Proc):
7
+ """Run cellranger count
8
+
9
+ to count gene expression and/or feature barcode reads
10
+
11
+ Input:
12
+ fastqs: The input fastq files
13
+ Either a list of fastq files or a directory containing fastq files
14
+ If a directory is provided, it should be passed as a list with one
15
+ element.
16
+
17
+ Output:
18
+ outdir: The output directory
19
+
20
+ Envs:
21
+ ncores: Number of cores to use
22
+ cellranger: Path to cellranger
23
+ ref: Path of folder containing 10x-compatible transcriptome reference
24
+ tmpdir: Path to temporary directory, used to save the soft-lined fastq files
25
+ to pass to cellranger
26
+ include_introns: Set to false to exclude intronic reads in count.
27
+ <more>: Other environment variables required by `cellranger count`
28
+ See `cellranger count --help` for more details or
29
+ https://www.10xgenomics.com/support/software/cell-ranger/advanced/cr-command-line-arguments#count
30
+ """ # noqa: E501
31
+ input = "fastqs:files"
32
+ output = """outdir:dir:
33
+ {%- set fastqs = in.fastqs -%}
34
+ {%- if len(fastqs) == 1 and isdir(fastqs[0]) -%}
35
+ {%- set fastqs = fastqs[0] | glob: "*.fastq.gz" -%}
36
+ {%- endif -%}
37
+ {%- set sample = commonprefix(*fastqs) |
38
+ regex_replace: "_L\\d+_$", "" |
39
+ regex_replace: "_S\\d+$", "" -%}
40
+ {{- sample -}}
41
+ """
42
+ lang = config.lang.python
43
+ envs = {
44
+ "ncores": config.misc.ncores,
45
+ "cellranger": config.exe.cellranger,
46
+ "ref": config.ref.ref_cellranger_gex,
47
+ "tmpdir": config.path.tmpdir,
48
+ "include_introns": "true",
49
+ }
50
+ script = "file://../scripts/cellranger/CellRangerCount.py"
51
+ plugin_opts = {
52
+ "report": "file://../reports/cellranger/CellRangerCount.svelte",
53
+ }
54
+
55
+
56
+ class CellRangerVdj(Proc):
57
+ """Run cellranger vdj
58
+
59
+ to perform sequence assembly and paired clonotype calling
60
+
61
+ Input:
62
+ fastqs: The input fastq files
63
+ Either a list of fastq files or a directory containing fastq files
64
+ If a directory is provided, it should be passed as a list with one
65
+ element.
66
+
67
+ Output:
68
+ outdir: The output directory
69
+
70
+ Envs:
71
+ ncores: Number of cores to use
72
+ cellranger: Path to cellranger
73
+ ref: Path of folder containing 10x-compatible transcriptome reference
74
+ tmpdir: Path to temporary directory, used to save the soft-lined fastq files
75
+ to pass to cellranger
76
+ <more>: Other environment variables required by `cellranger vdj`
77
+ See `cellranger vdj --help` for more details or
78
+ https://www.10xgenomics.com/support/software/cell-ranger/advanced/cr-command-line-arguments#vdj
79
+ """ # noqa: E501
80
+ input = "fastqs:files"
81
+ output = """outdir:dir:
82
+ {%- set fastqs = in.fastqs -%}
83
+ {%- if len(fastqs) == 1 and isdir(fastqs[0]) -%}
84
+ {%- set fastqs = fastqs[0] | glob: "*.fastq.gz" -%}
85
+ {%- endif -%}
86
+ {%- set sample = commonprefix(*fastqs) |
87
+ regex_replace: "_L\\d+_$", "" |
88
+ regex_replace: "_S\\d+$", "" -%}
89
+ {{- sample -}}
90
+ """
91
+ lang = config.lang.python
92
+ envs = {
93
+ "ncores": config.misc.ncores,
94
+ "cellranger": config.exe.cellranger,
95
+ "ref": config.ref.ref_cellranger_vdj,
96
+ "tmpdir": config.path.tmpdir,
97
+ }
98
+ script = "file://../scripts/cellranger/CellRangerVdj.py"
99
+ plugin_opts = {
100
+ "report": "file://../reports/cellranger/CellRangerVdj.svelte",
101
+ }
biopipen/ns/scrna.py CHANGED
@@ -1422,6 +1422,8 @@ class CellTypeAnnotation(Proc):
1422
1422
  If the length of `cell_types` is shorter than the number of
1423
1423
  clusters, the remaining clusters will be kept as the original cell
1424
1424
  types.
1425
+ You can also use `NA` to remove the clusters from downstream analysis. This
1426
+ only works when `envs.newcol` is not specified.
1425
1427
 
1426
1428
  /// Note
1427
1429
  If `tool` is `direct` and `cell_types` is not specified or an empty list,
@@ -0,0 +1,16 @@
1
+ {% from "utils/misc.liq" import report_jobs, table_of_images -%}
2
+
3
+ {%- macro report_job(job, h=1) -%}
4
+ <h{{h}}>{{job.out.outdir | basename | escape}}</h{{h}}>
5
+ <iframe
6
+ src="{{job.out.outdir}}/outs/web_summary.html"
7
+ width="100%"
8
+ frameborder="0"
9
+ style="min-height: 80vh"></iframe>
10
+ {%- endmacro -%}
11
+
12
+ {%- macro head_job(job) -%}
13
+ <h1>{{job.out.outdir | basename | escape}}</h1>
14
+ {%- endmacro -%}
15
+
16
+ {{ report_jobs(jobs, head_job, report_job) }}
@@ -0,0 +1,16 @@
1
+ {% from "utils/misc.liq" import report_jobs, table_of_images -%}
2
+
3
+ {%- macro report_job(job, h=1) -%}
4
+ <h{{h}}>{{job.out.outdir | basename | escape}}</h{{h}}>
5
+ <iframe
6
+ src="{{job.out.outdir}}/outs/web_summary.html"
7
+ width="100%"
8
+ frameborder="0"
9
+ style="min-height: 80vh"></iframe>
10
+ {%- endmacro -%}
11
+
12
+ {%- macro head_job(job) -%}
13
+ <h1>{{job.out.outdir | basename | escape}}</h1>
14
+ {%- endmacro -%}
15
+
16
+ {{ report_jobs(jobs, head_job, report_job) }}
@@ -0,0 +1,79 @@
1
+ import uuid
2
+ import re
3
+ from pathlib import Path
4
+ from biopipen.utils.misc import run_command
5
+
6
+ fastqs = {{in.fastqs | repr}} # pyright: ignore # noqa
7
+ outdir = {{out.outdir | quote}} # pyright: ignore
8
+
9
+ cellranger = {{envs.cellranger | quote}} # pyright: ignore
10
+ tmpdir = Path({{envs.tmpdir | quote}}) # pyright: ignore
11
+ ref = {{envs.ref | quote}} # pyright: ignore
12
+ ncores = {{envs.ncores | int}} # pyright: ignore
13
+
14
+ {% if "id" in envs -%}
15
+ id = {{envs.id | quote}} # pyright: ignore
16
+ {%- else -%}
17
+ id = {{out.outdir | basename | quote}} # pyright: ignore
18
+ {%- endif %}
19
+
20
+ {% if "sample" in envs -%}
21
+ sample = {{envs.sample | quote}} # pyright: ignore
22
+ {%- else -%}
23
+ sample = {{out.outdir | basename | quote}} # pyright: ignore
24
+ {%- endif %}
25
+
26
+ # create a temporary unique directory to store the soft-linked fastq files
27
+ fastqdir = tmpdir / f"cellranger_count_{uuid.uuid4()}"
28
+ fastqdir.mkdir(parents=True, exist_ok=True)
29
+ if len(fastqs) == 1 and fastqs[0].is_dir():
30
+ fastqs = list(fastqs[0].glob("*.fastq.gz"))
31
+
32
+ # soft-link the fastq files to the temporary directory
33
+ for fastq in fastqs:
34
+ fastq = Path(fastq)
35
+ (fastqdir / fastq.name).symlink_to(fastq)
36
+
37
+ other_args = {{envs | dict_to_cli_args: dashify=True, exclude=['cellranger', 'transcriptome', 'ref', 'tmpdir', 'id', 'sample', 'ncores']}} # pyright: ignore
38
+
39
+ command = [
40
+ cellranger,
41
+ "count",
42
+ "--id",
43
+ id,
44
+ "--sample",
45
+ sample,
46
+ "--fastqs",
47
+ fastqdir,
48
+ "--transcriptome",
49
+ ref,
50
+ "--localcores",
51
+ ncores,
52
+ "--disable-ui",
53
+ *other_args,
54
+ ]
55
+
56
+ run_command(command, fg=True, cwd=str(Path(outdir).parent))
57
+
58
+ web_summary_html = Path(outdir) / "outs" / "web_summary.html"
59
+ if not web_summary_html.exists():
60
+ raise RuntimeError(
61
+ f"web_summary.html does not exist in {outdir}/outs. "
62
+ "cellranger count failed."
63
+ )
64
+
65
+ # Modify web_summary.html to move javascript to a separate file
66
+ # to void vscode live server breaking the page by injecting some code
67
+ print("# Modify web_summary.html to move javascript to a separate file")
68
+ try:
69
+ web_summary_js = Path(outdir) / "outs" / "web_summary.js"
70
+ web_summary_content = web_summary_html.read_text()
71
+ regex = re.compile(r"<script>(?=/\*! For license)(.+)</script>", re.DOTALL)
72
+ web_summary_html.write_text(regex.sub(
73
+ '<script src="web_summary.js"></script>',
74
+ web_summary_content,
75
+ ))
76
+ web_summary_js.write_text(regex.search(web_summary_content).group(1))
77
+ except Exception as e:
78
+ print(f"Error modifying web_summary.html: {e}")
79
+ raise e
@@ -0,0 +1,79 @@
1
+ import uuid
2
+ import re
3
+ from pathlib import Path
4
+ from biopipen.utils.misc import run_command
5
+
6
+ fastqs = {{in.fastqs | repr}} # pyright: ignore # noqa
7
+ outdir = {{out.outdir | quote}} # pyright: ignore
8
+
9
+ cellranger = {{envs.cellranger | quote}} # pyright: ignore
10
+ tmpdir = Path({{envs.tmpdir | quote}}) # pyright: ignore
11
+ ref = {{envs.ref | quote}} # pyright: ignore
12
+ ncores = {{envs.ncores | int}} # pyright: ignore
13
+
14
+ {% if "id" in envs -%}
15
+ id = {{envs.id | quote}} # pyright: ignore
16
+ {%- else -%}
17
+ id = {{out.outdir | basename | quote}} # pyright: ignore
18
+ {%- endif %}
19
+
20
+ {% if "sample" in envs -%}
21
+ sample = {{envs.sample | quote}} # pyright: ignore
22
+ {%- else -%}
23
+ sample = {{out.outdir | basename | quote}} # pyright: ignore
24
+ {%- endif %}
25
+
26
+ # create a temporary unique directory to store the soft-linked fastq files
27
+ fastqdir = tmpdir / f"cellranger_count_{uuid.uuid4()}"
28
+ fastqdir.mkdir(parents=True, exist_ok=True)
29
+ if len(fastqs) == 1 and fastqs[0].is_dir():
30
+ fastqs = list(fastqs[0].glob("*.fastq.gz"))
31
+
32
+ # soft-link the fastq files to the temporary directory
33
+ for fastq in fastqs:
34
+ fastq = Path(fastq)
35
+ (fastqdir / fastq.name).symlink_to(fastq)
36
+
37
+ other_args = {{envs | dict_to_cli_args: dashify=True, exclude=['cellranger', 'reference', 'ref', 'tmpdir', 'id', 'sample', 'ncores']}} # pyright: ignore
38
+
39
+ command = [
40
+ cellranger,
41
+ "vdj",
42
+ "--id",
43
+ id,
44
+ "--sample",
45
+ sample,
46
+ "--fastqs",
47
+ fastqdir,
48
+ "--reference",
49
+ ref,
50
+ "--localcores",
51
+ ncores,
52
+ "--disable-ui",
53
+ *other_args,
54
+ ]
55
+
56
+ run_command(command, fg=True, cwd=str(Path(outdir).parent))
57
+
58
+ web_summary_html = Path(outdir) / "outs" / "web_summary.html"
59
+ if not web_summary_html.exists():
60
+ raise RuntimeError(
61
+ f"web_summary.html does not exist in {outdir}/outs. "
62
+ "cellranger vdj failed."
63
+ )
64
+
65
+ # Modify web_summary.html to move javascript to a separate file
66
+ # to void vscode live server breaking the page by injecting some code
67
+ print("# Modify web_summary.html to move javascript to a separate file")
68
+ try:
69
+ web_summary_js = Path(outdir) / "outs" / "web_summary.js"
70
+ web_summary_content = web_summary_html.read_text()
71
+ regex = re.compile(r"<script>(?=/\*! For license)(.+)</script>", re.DOTALL)
72
+ web_summary_html.write_text(regex.sub(
73
+ '<script src="web_summary.js"></script>',
74
+ web_summary_content,
75
+ ))
76
+ web_summary_js.write_text(regex.search(web_summary_content).group(1))
77
+ except Exception as e:
78
+ print(f"Error modifying web_summary.html: {e}")
79
+ raise e
@@ -1,47 +1,54 @@
1
1
  source("{{biopipen_dir}}/utils/misc.R")
2
2
  library(Seurat)
3
3
 
4
- sobjfile = {{in.sobjfile | r}}
5
- outfile = {{out.outfile | r}}
6
- celltypes = {{envs.cell_types | r}}
7
- newcol = {{envs.newcol | r}}
4
+ sobjfile <- {{in.sobjfile | r}}
5
+ outfile <- {{out.outfile | r}}
6
+ celltypes <- {{envs.cell_types | r}}
7
+ newcol <- {{envs.newcol | r}}
8
8
 
9
9
  if (is.null(celltypes) || length(celltypes) == 0) {
10
- warning("No cell types are given!")
10
+ log_warn("No cell types are given!")
11
11
 
12
12
  # create a symbolic link to the input file
13
13
  file.symlink(sobjfile, outfile)
14
14
  } else {
15
- sobj = readRDS(sobjfile)
16
- idents = as.character(unique(Idents(sobj)))
17
- idents = idents[order(as.numeric(idents))]
15
+ log_info("Loading Seurat object ...")
16
+ sobj <- readRDS(sobjfile)
17
+ idents <- as.character(unique(Idents(sobj)))
18
+ idents <- idents[order(as.numeric(idents))]
18
19
 
19
20
  if (length(celltypes) < length(idents)) {
20
- celltypes = c(celltypes, idents[(length(celltypes) + 1):length(idents)])
21
+ celltypes <- c(celltypes, idents[(length(celltypes) + 1):length(idents)])
21
22
  } else if (length(celltypes) > length(idents)) {
22
- celltypes = celltypes[1:length(idents)]
23
- warning(
24
- "The length of cell types is longer than the number of clusters!",
25
- immediate. = TRUE
26
- )
23
+ celltypes <- celltypes[1:length(idents)]
24
+ log_warn("The length of cell types is longer than the number of clusters!")
27
25
  }
28
26
  for (i in seq_along(celltypes)) {
29
27
  if (celltypes[i] == "-" || celltypes[i] == "") {
30
- celltypes[i] = idents[i]
28
+ celltypes[i] <- idents[i]
31
29
  }
32
30
  }
33
- names(celltypes) = idents
31
+ names(celltypes) <- idents
34
32
 
33
+ log_info("Renaming cell types ...")
35
34
  if (is.null(newcol)) {
36
- sobj$seurat_clusters_id = Idents(sobj)
37
- celltypes$object = sobj
38
- sobj = do_call(RenameIdents, celltypes)
39
- sobj$seurat_clusters = Idents(sobj)
35
+ has_na <- "NA" %in% unlist(celltypes) || anyNA(unlist(celltypes))
36
+ sobj$seurat_clusters_id <- Idents(sobj)
37
+ celltypes$object <- sobj
38
+ sobj <- do_call(RenameIdents, celltypes)
39
+ sobj$seurat_clusters <- Idents(sobj)
40
+ if (has_na) {
41
+ log_info("Filtering clusters if NA ...")
42
+ sobj <- subset(
43
+ sobj,
44
+ subset = seurat_clusters != "NA" & !is.na(seurat_clusters)
45
+ )
46
+ }
40
47
  } else {
41
- celltypes$object = sobj
42
- sobj = do_call(RenameIdents, celltypes)
43
- sobj[[newcol]] = Idents(sobj)
44
- Idents(sobj) = "seurat_clusters"
48
+ celltypes$object <- sobj
49
+ sobj <- do_call(RenameIdents, celltypes)
50
+ sobj[[newcol]] <- Idents(sobj)
51
+ Idents(sobj) <- "seurat_clusters"
45
52
  }
46
53
 
47
54
  saveRDS(sobj, outfile)
@@ -142,13 +142,8 @@ do_case <- function(name, case) {
142
142
  info <- casename_info(name, create = TRUE)
143
143
  cells_by <- trimws(strsplit(case$cells_by, ",")[[1]])
144
144
 
145
- sec_case_names <- strsplit(name, ":")[[1]]
146
- sec_dir <- file.path(outdir, sec_case_names[1])
147
- casename <- paste(sec_case_names[-1], collapse = ":")
148
- dir.create(sec_dir, showWarnings = FALSE, recursive = TRUE)
149
-
150
- outfile <- file.path(info$sec_dir, paste0("case-", info$case_slug, ".png"))
151
- txtfile <- file.path(info$sec_dir, paste0("case-", info$case_slug, ".txt"))
145
+ outfile <- file.path(info$sec_dir, paste0(info$case_slug, ".png"))
146
+ txtfile <- file.path(info$sec_dir, paste0(info$case_slug, ".txt"))
152
147
 
153
148
  # subset the seurat object
154
149
  meta <- srtobj@meta.data
@@ -242,7 +237,7 @@ do_case <- function(name, case) {
242
237
  ),
243
238
  txtfile,
244
239
  sep = "\t",
245
- row.names = TRUE,
240
+ row.names = FALSE,
246
241
  col.names = TRUE,
247
242
  quote = FALSE
248
243
  )
@@ -143,11 +143,13 @@ for (name in names(cases)) {
143
143
  } else if (is.null(case$each)) {
144
144
  # is.null(case$ident.1)
145
145
  sections <- c(sections, name)
146
- idents <- srtobj@meta.data %>% pull(case$group.by) %>% unique() %>% na.omit()
147
- for (ident in idents) {
148
- newcases[[paste0(name, ":", ident)]] <- case
149
- newcases[[paste0(name, ":", ident)]]$ident.1 <- ident
150
- }
146
+ newcases[[name]] <- case
147
+ newcases[[name]]$findall <- TRUE
148
+ # idents <- srtobj@meta.data %>% pull(case$group.by) %>% unique() %>% na.omit()
149
+ # for (ident in idents) {
150
+ # newcases[[paste0(name, ":", ident)]] <- case
151
+ # newcases[[paste0(name, ":", ident)]]$ident.1 <- ident
152
+ # }
151
153
  } else {
152
154
  eachs <- srtobj@meta.data %>% pull(case$each) %>% unique() %>% na.omit()
153
155
  for (each in eachs) {
@@ -160,18 +162,22 @@ for (name in names(cases)) {
160
162
  )
161
163
  )
162
164
  if (is.null(case$ident.1)) {
163
- idents <- srtobj@meta.data %>% pull(case$group.by) %>% unique() %>% na.omit()
164
- for (ident in idents) {
165
- kname <- if (name == "DEFAULT") "" else paste0(" - ", name)
166
- sections <- c(sections, paste0(each, kname))
167
- key <- paste0(each, kname, ":", ident)
168
- if (case$prefix_each) {
169
- key <- paste0(case$each, " - ", key)
170
- }
171
- newcases[[key]] <- case
172
- newcases[[key]]$ident.1 <- ident
173
- newcases[[key]]$group.by <- by
174
- }
165
+ kname <- if (name == "DEFAULT") "" else paste0(" - ", name)
166
+ sections <- c(sections, paste0(each, kname))
167
+ key <- paste0(each, kname)
168
+ newcases[[key]] <- case
169
+ newcases[[key]]$group.by <- by
170
+ newcases[[key]]$findall <- TRUE
171
+ # idents <- srtobj@meta.data %>% pull(case$group.by) %>% unique() %>% na.omit()
172
+ # for (ident in idents) {
173
+ # key <- paste0(each, kname, ":", ident)
174
+ # if (case$prefix_each) {
175
+ # key <- paste0(case$each, " - ", key)
176
+ # }
177
+ # newcases[[key]] <- case
178
+ # newcases[[key]]$ident.1 <- ident
179
+ # newcases[[key]]$group.by <- by
180
+ # }
175
181
  } else {
176
182
  sections <- c(sections, case$each)
177
183
  key <- paste0(case$each, ":", each)
@@ -312,11 +318,11 @@ do_enrich <- function(info, markers, sig, volgenes) {
312
318
  }
313
319
 
314
320
 
315
- do_dotplot <- function(info, siggenes, case, args) {
316
- dotplot_devpars <- case$dotplot$devpars
321
+ do_dotplot <- function(info, siggenes, dotplot, args) {
322
+ dotplot_devpars <- dotplot$devpars
317
323
  if (is.null(args$ident.2)) {
318
- case$dotplot$object <- args$object
319
- case$dotplot$object@meta.data <- case$dotplot$object@meta.data %>%
324
+ dotplot$object <- args$object
325
+ dotplot$object@meta.data <- dotplot$object@meta.data %>%
320
326
  mutate(
321
327
  !!sym(args$group.by) := if_else(
322
328
  !!sym(args$group.by) == args$ident.1,
@@ -329,17 +335,16 @@ do_dotplot <- function(info, siggenes, case, args) {
329
335
  )
330
336
  )
331
337
  } else {
332
- case$dotplot$object <- args$object %>%
338
+ dotplot$object <- args$object %>%
333
339
  filter(!!sym(args$group.by) %in% c(args$ident.1, args$ident.2)) %>%
334
340
  mutate(!!sym(args$group.by) := factor(
335
341
  !!sym(args$group.by),
336
342
  levels = c(args$ident.1, args$ident.2)
337
343
  ))
338
344
  }
339
- case$dotplot$devpars <- NULL
340
- case$dotplot$features <- siggenes
341
- case$dotplot$group.by <- args$group.by
342
- case$dotplot$assay <- case$assay
345
+ dotplot$devpars <- NULL
346
+ dotplot$features <- siggenes
347
+ dotplot$group.by <- args$group.by
343
348
  dotplot_width = ifelse(
344
349
  is.null(dotplot_devpars$width),
345
350
  if (length(siggenes) <= 20) length(siggenes) * 60 else length(siggenes) * 30,
@@ -351,7 +356,7 @@ do_dotplot <- function(info, siggenes, case, args) {
351
356
  png(dotplot_file, res = dotplot_res, width = dotplot_height, height = dotplot_width)
352
357
  # rotate x axis labels
353
358
  print(
354
- do_call(DotPlot, case$dotplot) +
359
+ do_call(DotPlot, dotplot) +
355
360
  theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
356
361
  coord_flip()
357
362
  )
@@ -456,9 +461,79 @@ add_case_report <- function(info, sigmarkers, siggenes) {
456
461
  }
457
462
 
458
463
 
464
+ do_case_findall <- function(casename) {
465
+ log_info("- Using FindAllMarkers for case: {casename}...")
466
+
467
+ case = cases[[casename]]
468
+ args <- case$rest
469
+ args$group.by <- case$group.by
470
+ if (is.null(args$logfc.threshold)) {
471
+ args$locfc.threshold <- 0
472
+ }
473
+ if (is.null(args$min.cells.group)) {
474
+ args$min.cells.group <- 1
475
+ }
476
+ if (is.null(args$min.cells.feature)) {
477
+ args$min.cells.feature <- 1
478
+ }
479
+ if (is.null(args$min.pct)) {
480
+ args$min.pct <- 0
481
+ }
482
+ if (!is.null(case$subset)) {
483
+ args$object <- srtobj %>% filter(!!parse_expr(case$subset) & filter(!is.na(!!sym(case$group.by))))
484
+ } else {
485
+ args$object <- srtobj %>% filter(!is.na(!!sym(case$group.by)))
486
+ }
487
+ Idents(args$object) <- case$group.by
488
+ markers <- tryCatch({
489
+ do_call(FindAllMarkers, args)
490
+ # gene, p_val, avg_log2FC, pct.1, pct.2, p_val_adj, cluster
491
+ }, error = function(e) {
492
+ log_warn(e$message)
493
+ data.frame(
494
+ gene = character(),
495
+ p_val = numeric(),
496
+ avg_log2FC = numeric(),
497
+ pct.1 = numeric(),
498
+ pct.2 = numeric(),
499
+ p_val_adj=numeric(),
500
+ cluster = character()
501
+ )
502
+ })
503
+
504
+ if (is.null(case$dotplot$assay)) {
505
+ case$dotplot$assay <- assay
506
+ }
507
+ idents <- unique(markers$cluster)
508
+ for (ident in idents) {
509
+ log_info("- Dealing with ident: {ident}...")
510
+ info <- casename_info(paste0(casename, ":", ident), create = TRUE)
511
+ siggenes <- do_enrich(info, markers %>% filter(cluster == ident), case$sigmarkers, case$volcano_genes)
512
+
513
+ if (length(siggenes) > 0) {
514
+ args$ident.1 <- as.character(ident)
515
+ do_dotplot(info, siggenes, case$dotplot, args)
516
+ }
517
+ add_case_report(info, case$sigmarkers, siggenes)
518
+
519
+ if (info$section %in% overlap) {
520
+ if (is.null(overlaps[[info$section]])) {
521
+ overlaps[[info$section]] <<- list()
522
+ }
523
+ overlaps[[info$section]][[info$case]] <<- siggenes
524
+ }
525
+ }
526
+ }
527
+
528
+
459
529
  do_case <- function(casename) {
460
530
  log_info("Dealing with case: {casename}...")
461
531
 
532
+ if (isTRUE(cases[[casename]]$findall)) {
533
+ do_case_findall(casename)
534
+ return()
535
+ }
536
+
462
537
  info <- casename_info(casename, create = TRUE)
463
538
  case <- cases[[casename]]
464
539
  # ident1
@@ -507,7 +582,10 @@ do_case <- function(casename) {
507
582
  siggenes <- do_enrich(info, markers, case$sigmarkers, case$volcano_genes)
508
583
 
509
584
  if (length(siggenes) > 0) {
510
- do_dotplot(info, siggenes, case, args)
585
+ if (is.null(case$dotplot$assay)) {
586
+ case$dotplot$assay <- assay
587
+ }
588
+ do_dotplot(info, siggenes, case$dotplot, args)
511
589
  }
512
590
 
513
591
  if (info$section %in% overlap) {
@@ -173,8 +173,8 @@ do_one_features = function(name) {
173
173
  rownames_to_column("Feature") %>%
174
174
  select(Feature, everything())
175
175
 
176
- exprfile = paste0(slugify(name), ".txt")
177
- write.table(expr, file.path(odir, exprfile), sep="\t", quote=FALSE, row.names=FALSE)
176
+ exprfile = file.path(odir, paste0(slugify(name), ".txt"))
177
+ write.table(expr, exprfile, sep="\t", quote=FALSE, row.names=FALSE)
178
178
 
179
179
  add_report(
180
180
  list(
@@ -46,11 +46,14 @@ Those functions take following arguments:
46
46
  * `group-by`: The column name in metadata to group the cells.
47
47
  * `idents`: The first group or both groups of cells to compare (value in `group-by` column). If only the first group is given, the rest of the cells (with non-NA in `group-by` column) will be used as the second group.
48
48
  * `subset`: An expression to subset the cells, will be passed to `dplyr::filter()`. Default is `TRUE` (no filtering).
49
+ * `each`: A column name (without quotes) in metadata to split the cells.
50
+ Each comparison will be done for each value in this column.
49
51
  * `id`: The column name in metadata for the group ids (i.e. `CDR3.aa`).
50
52
  * `compare`: Either a (numeric) column name (i.e. `Clones`) in metadata to compare between groups, or `.n` to compare the number of cells in each group.
51
53
  If numeric column is given, the values should be the same for all cells in the same group.
52
54
  This will not be checked (only the first value is used).
53
55
  * `uniq`: Whether to return unique ids or not. Default is `TRUE`. If `FALSE`, you can mutate the meta data frame with the returned ids. For example, `df |> mutate(expanded = expanded(...))`.
56
+ * `debug`: Return the data frame with intermediate columns instead of the ids. Default is `FALSE`.
54
57
  * `order`: The order of the returned ids. It could be `sum` or `diff`, which is the sum or diff of the `compare` between idents.
55
58
  Two kinds of modifiers can be added, including `desc` and `abs`.
56
59
  For example, `sum,desc` means the sum of `compare` between idents in descending order.
@@ -1,6 +1,7 @@
1
1
  suppressPackageStartupMessages(library(rlang))
2
2
  suppressPackageStartupMessages(library(tidyselect))
3
3
  suppressPackageStartupMessages(library(dplyr))
4
+ suppressPackageStartupMessages(library(tidyr))
4
5
 
5
6
  #' Get expanded, collapsed, emerged or vanished clones from a meta data frame
6
7
  #'
@@ -15,6 +16,8 @@ suppressPackageStartupMessages(library(dplyr))
15
16
  #' be used as `ident_2`.
16
17
  #' @param subset An expression to subset the cells, will be passed to
17
18
  #' `dplyr::filter()`. Default is `TRUE` (no filtering).
19
+ #' @param each A column name (without quotes) in metadata to split the cells.
20
+ #' Each comparison will be done for each value in this column.
18
21
  #' @param id The column name (without quotes) in metadata for the
19
22
  #' group ids (i.e. `CDR3.aa`)
20
23
  #' @param compare Either a (numeric) column name (i.e. `Clones`, without quotes)
@@ -25,6 +28,7 @@ suppressPackageStartupMessages(library(dplyr))
25
28
  #' @param uniq Whether to return unique ids or not. Default is `TRUE`.
26
29
  #' If `FALSE`, you can mutate the meta data frame with the returned ids.
27
30
  #' For example, `df %>% mutate(expanded = expanded(...))`.
31
+ #' @param debug Return the transformed data frame with counts, predicates, sum, and diff.
28
32
  #' @param order The order of the returned ids. It could be `sum` or `diff`,
29
33
  #' which is the sum or diff of the `compare` between idents. Two kinds of
30
34
  #' modifiers can be added, including `desc` and `abs`. For example,
@@ -82,8 +86,10 @@ suppressPackageStartupMessages(library(dplyr))
82
86
  id,
83
87
  compare,
84
88
  fun,
89
+ each,
85
90
  uniq,
86
- order
91
+ order,
92
+ debug
87
93
  ) {
88
94
  if (length(idents) == 1) {
89
95
  ident_1 <- idents[1]
@@ -119,100 +125,82 @@ suppressPackageStartupMessages(library(dplyr))
119
125
 
120
126
  if (!compare_is_count && !compare_label %in% colnames(df)) {
121
127
  stop(paste0(
122
- "`compare` must be either a column name in df, or 'count'/'n'. ",
128
+ "`compare` must be either a column name in df, or 'count'/'.n'. ",
123
129
  'Got "',
124
130
  compare_label,
125
131
  '"'
126
132
  ))
127
133
  }
128
134
 
129
- predicate <- function(comp) {
135
+ predicate <- function(ident_1, ident_2) {
130
136
  if (fun == "expanded") {
131
- comp[1] > comp[2] && comp[2] > 0
137
+ ident_1 > ident_2 && ident_2 > 0
132
138
  } else if (fun == "expanded+") {
133
- comp[1] > comp[2]
139
+ ident_1 > ident_2
134
140
  } else if (fun == "collapsed") {
135
- comp[1] < comp[2] && comp[1] > 0
141
+ ident_1 < ident_2 && ident_1 > 0
136
142
  } else if (fun == "collapsed+") {
137
- comp[1] < comp[2]
143
+ ident_1 < ident_2
138
144
  } else if (fun == "emerged") {
139
- comp[1] > 0 && comp[2] == 0
145
+ ident_1 > 0 && ident_2 == 0
140
146
  } else if (fun == "vanished") {
141
- comp[1] == 0 && comp[2] > 0
147
+ ident_1 == 0 && ident_2 > 0
142
148
  }
143
149
  }
144
150
 
145
151
  # subset the data frame
146
- trans <- df %>% dplyr::filter(!!subset) %>%
147
- # remove NA values in group.by column
148
- dplyr::filter(!is.na(!!group.by)) %>%
149
- # mark the group.by column (as ..group) as ident_1 or ident_2 or NA
152
+ trans <- df %>%
153
+ dplyr::filter(!!subset) %>%
154
+ drop_na(!!id) %>%
155
+ # # remove NA values in group.by column
156
+ # dplyr::filter(!is.na(!!group.by)) %>%
157
+ # mark the group.by column (as .group) as ident_1 or ident_2 or NA
150
158
  mutate(
151
- ..group = if_else(
159
+ .group = if_else(
152
160
  !!group.by == ident_1,
153
161
  "ident_1",
154
162
  if_else(ident_2 != "<NULL>" & !!group.by != ident_2, NA, "ident_2")
155
163
  )
156
164
  ) %>%
157
165
  # remove NA values in ..group column
158
- dplyr::filter(!is.na(..group)) %>%
159
- # for each clone and group (ident_1 and ident_2)
160
- group_by(!!id, ..group) %>%
161
- # summarise the number of cells in each clone and group
162
- # so that we can compare between groups later
163
- summarise(
164
- ..compare = ifelse(compare_is_count, n(), first(!!compare)),
165
- .groups = "drop"
166
- ) %>%
167
- # for each clone, either compare Clones or ..count between groups
168
- # (ident_1 and ident_2)
169
- group_by(!!id) %>%
170
- # add missing group (either ident_1 or ident_2)
171
- group_modify(function(d, ...) {
172
- if (nrow(d) == 1) {
173
- d <- d %>% add_row(
174
- ..group = ifelse(
175
- d$..group == "ident_1", "ident_2", "ident_1"
176
- ),
177
- ..compare = 0
178
- )
179
- }
180
- d
181
- }) %>%
182
- # make sure ident_1 and ident_2 are in order
183
- arrange(..group, .by_group = TRUE) %>%
166
+ drop_na(.group)
167
+
168
+ if (is.null(each)) {
169
+ trans <- trans %>% group_by(!!id, .group)
170
+ } else {
171
+ trans <- trans %>% group_by(!!each, !!id, .group)
172
+ }
173
+
174
+ if (compare_is_count) {
175
+ trans <- trans %>% summarise(.n = n(), .groups = "drop")
176
+ } else {
177
+ trans <- trans %>% summarise(.n = first(!!compare), .groups = "drop")
178
+ }
179
+
180
+ trans <- trans %>% pivot_wider(names_from = .group, values_from = .n) %>%
181
+ replace_na(list(ident_1 = 0, ident_2 = 0)) %>%
182
+ rowwise() %>%
184
183
  # add the predicates, sums and diffs
185
- summarise(
186
- ..predicate = predicate(..compare),
187
- ..sum = sum(..compare),
188
- ..diff = ..compare[1] - ..compare[2]
184
+ mutate(
185
+ .predicate = predicate(ident_1, ident_2),
186
+ .sum = ident_1 + ident_2,
187
+ .diff = ident_1 - ident_2
189
188
  ) %>%
190
- # filter the clones
191
- dplyr::filter(..predicate)
189
+ ungroup() %>%
190
+ arrange(!!order)
192
191
 
193
- order_sum <- grepl("sum", order)
194
- order_diff <- grepl("diff", order)
195
- order_desc <- grepl("desc", order)
196
- order_abs <- grepl("abs", order)
197
- if (order_sum && !order_desc) {
198
- out <- trans %>% arrange(..sum) %>% pull(!!id)
199
- } else if (order_sum) {
200
- out <- trans %>% arrange(desc(..sum)) %>% pull(!!id)
201
- } else if (order_diff && !order_desc && !order_abs) {
202
- out <- trans %>% arrange(..diff) %>% pull(!!id)
203
- } else if (order_diff && !order_desc && order_abs) {
204
- out <- trans %>% arrange(abs(..diff)) %>% pull(!!id)
205
- } else if (order_diff && order_desc && !order_abs) {
206
- out <- trans %>% arrange(desc(..diff)) %>% pull(!!id)
207
- } else if (order_diff && order_desc && order_abs) {
208
- out <- trans %>% arrange(desc(abs(..diff))) %>% pull(!!id)
209
- } else {
210
- out <- trans %>% pull(!!id)
192
+ if (debug) {
193
+ return(trans)
211
194
  }
212
195
 
213
- if (uniq) { return(out) }
196
+ uniq_ids <- trans %>% filter(.predicate) %>% pull(!!id) %>% as.vector() %>% unique()
197
+ if (uniq) {
198
+ return(uniq_ids)
199
+ }
214
200
 
215
- df %>% mutate(..out = if_else(!!id %in% out, !!id, NA)) %>% pull(..out)
201
+ out <- df %>% pull(!!id)
202
+ out[!out %in% uniq_ids] <- NA
203
+ out
216
204
  }
217
205
 
218
206
  #' @export
@@ -221,10 +209,12 @@ expanded <- function(
221
209
  group.by, # nolint
222
210
  idents,
223
211
  subset = TRUE,
212
+ each = NULL,
224
213
  id = CDR3.aa,
225
- compare = Clones,
214
+ compare = .n,
226
215
  uniq = TRUE,
227
- order = "diff+desc",
216
+ debug = FALSE,
217
+ order = desc(.sum),
228
218
  include_emerged = FALSE
229
219
  ) {
230
220
  lbl <- as_label(enquo(df))
@@ -233,15 +223,17 @@ expanded <- function(
233
223
  }
234
224
  fun = if (include_emerged) "expanded+" else "expanded"
235
225
  .size_compare(
236
- df,
237
- enquo(group.by),
238
- idents,
239
- enquo(subset),
240
- enquo(id),
241
- enquo(compare),
242
- fun,
226
+ df = df,
227
+ group.by = enquo(group.by),
228
+ idents = idents,
229
+ subset = enquo(subset),
230
+ id = enquo(id),
231
+ compare = enquo(compare),
232
+ fun = fun,
233
+ each = tryCatch(enquo(each), error = function(e) NULL),
243
234
  uniq = uniq,
244
- order = order
235
+ order = enexpr(order),
236
+ debug = debug
245
237
  )
246
238
  }
247
239
 
@@ -251,10 +243,12 @@ collapsed <- function(
251
243
  group.by, # nolint
252
244
  idents,
253
245
  subset = TRUE,
246
+ each = NULL,
254
247
  id = CDR3.aa,
255
- compare = Clones,
248
+ compare = .n,
256
249
  uniq = TRUE,
257
- order = "diff+desc",
250
+ debug = FALSE,
251
+ order = desc(.sum),
258
252
  include_vanished = FALSE
259
253
  ) {
260
254
  lbl <- as_label(enquo(df))
@@ -263,15 +257,17 @@ collapsed <- function(
263
257
  }
264
258
  fun = if (include_vanished) "collapsed+" else "collapsed"
265
259
  .size_compare(
266
- df,
267
- enquo(group.by),
268
- idents,
269
- enquo(subset),
270
- enquo(id),
271
- enquo(compare),
272
- fun,
260
+ df = df,
261
+ group.by = enquo(group.by),
262
+ idents = idents,
263
+ subset = enquo(subset),
264
+ id = enquo(id),
265
+ compare = enquo(compare),
266
+ fun = fun,
267
+ each = tryCatch(enquo(each), error = function(e) NULL),
273
268
  uniq = uniq,
274
- order = order
269
+ order = enexpr(order),
270
+ debug = debug
275
271
  )
276
272
  }
277
273
 
@@ -281,25 +277,29 @@ emerged <- function(
281
277
  group.by, # nolint
282
278
  idents,
283
279
  subset = TRUE,
280
+ each = NULL,
284
281
  id = CDR3.aa,
285
- compare = Clones,
282
+ compare = .n,
286
283
  uniq = TRUE,
287
- order = "diff+desc"
284
+ debug = FALSE,
285
+ order = desc(.sum)
288
286
  ) {
289
287
  lbl <- as_label(enquo(df))
290
288
  if (length(lbl) == 1 && lbl == ".") {
291
289
  df <- across(everything())
292
290
  }
293
291
  .size_compare(
294
- df,
295
- enquo(group.by),
296
- idents,
297
- enquo(subset),
298
- enquo(id),
299
- enquo(compare),
300
- "emerged",
292
+ df = df,
293
+ group.by = enquo(group.by),
294
+ idents = idents,
295
+ subset = enquo(subset),
296
+ id = enquo(id),
297
+ compare = enquo(compare),
298
+ fun = "emerged",
299
+ each = tryCatch(enquo(each), error = function(e) NULL),
301
300
  uniq = uniq,
302
- order = order
301
+ order = enexpr(order),
302
+ debug = debug
303
303
  )
304
304
  }
305
305
 
@@ -309,25 +309,29 @@ vanished <- function(
309
309
  group.by, # nolint
310
310
  idents,
311
311
  subset = TRUE,
312
+ each = NULL,
312
313
  id = CDR3.aa,
313
- compare = Clones,
314
+ compare = .n,
314
315
  uniq = TRUE,
315
- order = "diff+desc"
316
+ debug = FALSE,
317
+ order = desc(.sum)
316
318
  ) {
317
319
  lbl <- as_label(enquo(df))
318
320
  if (length(lbl) == 1 && lbl == ".") {
319
321
  df <- across(everything())
320
322
  }
321
323
  .size_compare(
322
- df,
323
- enquo(group.by),
324
- idents,
325
- enquo(subset),
326
- enquo(id),
327
- enquo(compare),
328
- "vanished",
324
+ df = df,
325
+ group.by = enquo(group.by),
326
+ idents = idents,
327
+ subset = enquo(subset),
328
+ id = enquo(id),
329
+ compare = enquo(compare),
330
+ fun = "vanished",
331
+ each = tryCatch(enquo(each), error = function(e) NULL),
329
332
  uniq = uniq,
330
- order = order
333
+ order = enexpr(order),
334
+ debug = debug
331
335
  )
332
336
  }
333
337
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: biopipen
3
- Version: 0.22.1
3
+ Version: 0.22.2
4
4
  Summary: Bioinformatics processes/pipelines that can be run from `pipen run`
5
5
  License: MIT
6
6
  Author: pwwang
@@ -1,15 +1,16 @@
1
- biopipen/__init__.py,sha256=mjWPUw5WSKjOdLE532eMicR6Gvc0AStLxFjzYGRWcns,23
1
+ biopipen/__init__.py,sha256=Bh5Z0gPzleot68P4r2qTs7W0HNi5DFO8t_uKNyCoA94,23
2
2
  biopipen/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  biopipen/core/config.py,sha256=edK5xnDhM8j27srDzsxubi934NMrglLoKrdcC8qsEPk,1069
4
- biopipen/core/config.toml,sha256=JALO2S7TfmV3gIRPJ0cLTFWncPXXheQJS3vYQlyX6wQ,1600
4
+ biopipen/core/config.toml,sha256=Rn7Cta7WsMtmQkKGC4h9d5dU_STaIVBgR8UliiGgL6o,1757
5
5
  biopipen/core/defaults.py,sha256=yPeehPLk_OYCf71IgRVCWuQRxLAMixDF81Ium0HtPKI,344
6
- biopipen/core/filters.py,sha256=5Qi7do0JT8_mwd80ddf4TgsX7yZh__ZpOex270Jjrbc,11037
6
+ biopipen/core/filters.py,sha256=bsH5an2Wfk4JaEEYpa5xFLy9-QVN3fdA_nl7_ceSM68,11562
7
7
  biopipen/core/proc.py,sha256=7TsjBM7EEtMMB-w4jbxV_CSRY8J970gM8320Ga1YeHU,717
8
8
  biopipen/core/testing.py,sha256=5vR15kkCjfXM7Bx0HBzabNLtDLAEX4uU94TskCkPni8,1447
9
9
  biopipen/ns/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  biopipen/ns/bam.py,sha256=5AsYrB0mtr_mH6mCL6gjJ5rC4NywpjFkpFjUrBGp7Fk,9301
11
11
  biopipen/ns/bcftools.py,sha256=puCDfIL-1z6cz2y1Rlz-ESNIr8xJgeIjEQ440qicCvM,3467
12
12
  biopipen/ns/bed.py,sha256=UN38qUChDeE-ipuSBY8RVLwvJqM2wxSRmlhOiDo4JG0,5395
13
+ biopipen/ns/cellranger.py,sha256=0A6pCpBLg1zKm2Ve2cXvGvNNK4lMqdsek2iTer5X_TI,3679
13
14
  biopipen/ns/cnv.py,sha256=vq6dZfEOyuVuqg3nP6FQtNmQ-JocpBJMX9IYlZ0OPD0,6803
14
15
  biopipen/ns/cnvkit.py,sha256=5mA2Q8-YDs4g1HoxtpB_NWnyZYwEThNr3s3wlubLQrQ,31130
15
16
  biopipen/ns/cnvkit_pipeline.py,sha256=2fJLn70L2jJ81ZMNdnU84Sf3HoKA2CSnHuDzLGR8jmw,36854
@@ -19,7 +20,7 @@ biopipen/ns/gsea.py,sha256=EsNRAPYsagaV2KYgr4Jv0KCnZGqayM209v4yOGGTIOI,7423
19
20
  biopipen/ns/misc.py,sha256=fzn0pXvdghMkQhu-e3MMapPNMyO6IAJbtTzVU3GbFa0,3246
20
21
  biopipen/ns/plot.py,sha256=yguxmErUOH-hOM10JfuI_sXw2p49XF8yGR_gXfbd5yQ,4066
21
22
  biopipen/ns/rnaseq.py,sha256=l4vFeRasGhkexopGTM_VfSyIFewOxg-9L5niFzhWUNA,565
22
- biopipen/ns/scrna.py,sha256=F5j1TmjsS2swwm-uDyT6sTys5pldIJ_M2hNITAQdflc,82728
23
+ biopipen/ns/scrna.py,sha256=jLK_K90B36ZbmDZcR8PT2x1ntBpvxKHzeNhWYkrexhM,82876
23
24
  biopipen/ns/scrna_basic.py,sha256=Py90IveDI5Alm6FUeC89xp3W79VPRvAQctQpc5JtO2M,8639
24
25
  biopipen/ns/scrna_metabolic_landscape.py,sha256=dSL-y1Gx1fcgebX7vk3wcSbm9aBALfCZKz0vjcDxQ_8,28139
25
26
  biopipen/ns/tcgamaf.py,sha256=AFbUJIxiMSvsVY3RcHgjRFuMnNh2DG3Mr5slLNEyz6o,1455
@@ -29,6 +30,8 @@ biopipen/ns/web.py,sha256=3zucrDo-IVsSnIvlw-deoScuxqWa6OMTm8Vo-R4E44Q,2224
29
30
  biopipen/reports/bam/CNAClinic.svelte,sha256=D4IxQcgDCPQZMbXog-aZP5iJEQTK2N4i0C60e_iXyfs,213
30
31
  biopipen/reports/bam/CNVpytor.svelte,sha256=s03SlhbEPd8-_44Dy_cqE8FSErhUdqStLK39te5o7ZE,1364
31
32
  biopipen/reports/bam/ControlFREEC.svelte,sha256=OwN96RW0dN-gtQ1zWKbXYZCYkkrOC0RQmP3UG4x7zqU,837
33
+ biopipen/reports/cellranger/CellRangerCount.svelte,sha256=oR7WzqY_FcjeCi5rir0qyUdUe09mkYBgg4-V1dB9ph4,478
34
+ biopipen/reports/cellranger/CellRangerVdj.svelte,sha256=oR7WzqY_FcjeCi5rir0qyUdUe09mkYBgg4-V1dB9ph4,478
32
35
  biopipen/reports/cnv/AneuploidyScore.svelte,sha256=x0LbhqjauZpqMzmzDWmYgx-rEh5Tzo8qBrXcLcM0h78,1020
33
36
  biopipen/reports/cnv/AneuploidyScoreSummary.svelte,sha256=AWlns70mChJGhH3z8r5uXuI4tc7VbVN_cOUdqBr3ZKg,4414
34
37
  biopipen/reports/cnv/TMADScoreSummary.svelte,sha256=tJutaMOqeXxKroAosOIqOJVyhTTFet-soMwuOYVHTYU,2060
@@ -76,6 +79,8 @@ biopipen/scripts/bed/Bed2Vcf.py,sha256=u0mp_2Y4UtEA839zq9UENesH6Gyiwd4sZQW9wFnBV
76
79
  biopipen/scripts/bed/BedConsensus.py,sha256=gfAxuIalvCEpS0tiOyAJGPYGgHN0L-hm0K37Iteh5yw,2386
77
80
  biopipen/scripts/bed/BedLiftOver.sh,sha256=Y4gBsz9w4zhE29UmWojO6F4PXMMMWC1uCzjrxa19eOs,256
78
81
  biopipen/scripts/bed/BedtoolsMerge.py,sha256=TjKO5MpUzDj931bQAWku2660MVSiZzdMHt_v2Xbt0IE,355
82
+ biopipen/scripts/cellranger/CellRangerCount.py,sha256=ZDcry8suLhulXiTsl01LGKmSJkewJ-TgHazLtfsBr6U,2516
83
+ biopipen/scripts/cellranger/CellRangerVdj.py,sha256=-QbhPKqFBZ15Es6NJaU7Lwf1KQW_3Lyv0aISh-Urk2M,2504
79
84
  biopipen/scripts/cnv/AneuploidyScore.R,sha256=liAN8u8_lj8voJ01oBW9Dw09yi388KF5f_gwPOv0wdE,8437
80
85
  biopipen/scripts/cnv/AneuploidyScoreSummary.R,sha256=9Zni5zqYfzevs5XSAt3fqD9WZ_RWr_ByUnXReKLLWoY,12337
81
86
  biopipen/scripts/cnv/TMADScore.R,sha256=uCLHQR6sMt-4uVUAEJlJxYXlai9ZE5J7xBl0sl-EkjU,1065
@@ -105,26 +110,26 @@ biopipen/scripts/misc/Str2File.py,sha256=99oQNxChxChNJ9vmD77b48cu-r_P_heSpx7A5wi
105
110
  biopipen/scripts/plot/Heatmap.R,sha256=4v_oRME8ZiwczIlBIp-OP_YPWLAvBKzbHiwNBCZ0Xog,1982
106
111
  biopipen/scripts/plot/VennDiagram.R,sha256=GVc-kyHqnXrbXZvy-evcxI1XGtlLSChBiVnMjPywNMA,731
107
112
  biopipen/scripts/rnaseq/UnitConversion.R,sha256=9etSQ6ivtlrgSg4mLjViZAl8nUtCxfEROxXvFCpN9sg,1928
108
- biopipen/scripts/scrna/CellTypeAnnotation-direct.R,sha256=jBEc2OTjC4hbVCJJXzZ4KC9Db5W-7kfJ3N5U5rE05AQ,1449
113
+ biopipen/scripts/scrna/CellTypeAnnotation-direct.R,sha256=Qp8w3-Xh67F6QHYzpTjWdSDdCVlhcjGjgoAi7PGUbmI,1797
109
114
  biopipen/scripts/scrna/CellTypeAnnotation-hitype.R,sha256=6_DBAlLKcHqaMyWGZWvTd4gFfHymfz9s2XLja8aj1qA,1869
110
115
  biopipen/scripts/scrna/CellTypeAnnotation-sccatch.R,sha256=1ejye0hs-EOwzzdP9gFWSLPcF6dOAA6VmNKXEjmS11E,1654
111
116
  biopipen/scripts/scrna/CellTypeAnnotation-sctype.R,sha256=u1eQsBWv1GKTbkwp6OFyiPuMFFcgwoa4-VI-d4q8nM4,3877
112
117
  biopipen/scripts/scrna/CellTypeAnnotation.R,sha256=6Le1SvZcKI8D0SLkFZ5SibGsW9ZWqirnBl3Q1BNZOuU,513
113
- biopipen/scripts/scrna/CellsDistribution.R,sha256=8bDwA1xQHCHnGRBW5XfW35BOpNLydxbWX93TId9vRa8,12908
118
+ biopipen/scripts/scrna/CellsDistribution.R,sha256=shfgljiveRMrMM9GAbvemn9vSUCL9vNwTxH2Hiq9Yyk,12669
114
119
  biopipen/scripts/scrna/DimPlots.R,sha256=-mXOTMnpPxvR30XLjwcohFfFx7xTqWKKiICwJiD6yEo,1554
115
120
  biopipen/scripts/scrna/ExprImpution-alra.R,sha256=8wcyZk1Whf45SXsYOM_ykl8m-iBxr27KEjtslbl2JQQ,782
116
121
  biopipen/scripts/scrna/ExprImpution-rmagic.R,sha256=yYnkyVfqIaNynsbaZZLGS6DrAJ_XhVQj1Ox598w8yOY,651
117
122
  biopipen/scripts/scrna/ExprImpution-scimpute.R,sha256=mg40qCUW7-nP5oHPvARq7dmtoahM0GRFWXQpum0BXVk,1082
118
123
  biopipen/scripts/scrna/ExprImpution.R,sha256=7768ezrr59xUZDXq8lO9jj2XhnkSsx-xxBmOD9_DO7c,313
119
124
  biopipen/scripts/scrna/GeneExpressionInvistigation.R,sha256=FI5MWic3xRml2DN7ONcyT7pbceOnL30Zd4nBHRZRFNQ,3800
120
- biopipen/scripts/scrna/MarkersFinder.R,sha256=mPyKZcYcrhTjLqqp406-wkGZzpTUSBUQnDSsGJe-SL4,18669
125
+ biopipen/scripts/scrna/MarkersFinder.R,sha256=v_PIhg-QcuaY_6F_sNGMkNohLmlZL_BkGNiXNPxRn6I,21137
121
126
  biopipen/scripts/scrna/MetaMarkers.R,sha256=3gZdMjO4sGQLq0XvlLooMrQUKEAIYUCTsxVHrkYe7HM,11119
122
127
  biopipen/scripts/scrna/ModuleScoreCalculator.R,sha256=0mLGoTvJRpTbCnmuYbYKqZnP3ZdJQkTn6getJddBKRs,2495
123
128
  biopipen/scripts/scrna/RadarPlots.R,sha256=1oicly0wxLaQDrDUojKtyCD052cYnMrBcW8TpbFY7wE,8535
124
129
  biopipen/scripts/scrna/SCImpute.R,sha256=dSJOHhmJ3x_72LBRXT72dbCti5oiB85CJ-OjWtqONbk,2958
125
130
  biopipen/scripts/scrna/ScFGSEA.R,sha256=wePSQYGjGv_InJEmi0Hf0zNt1gmqhkItjFqYE-wiYec,5999
126
131
  biopipen/scripts/scrna/SeuratClusterStats-dimplots.R,sha256=BknWb-5Vc_LHB3hlOgsAEooHObG6xoU1JV2KeNVrEGk,1623
127
- biopipen/scripts/scrna/SeuratClusterStats-features.R,sha256=NLdv5un_mntsNSukChUCXY3u41GARrNMqM4Ko0kN384,7705
132
+ biopipen/scripts/scrna/SeuratClusterStats-features.R,sha256=ft1sSF2pXuDb4H2vSkPYuzcDgOOpXpCZGv9_17DdZN8,7705
128
133
  biopipen/scripts/scrna/SeuratClusterStats-stats.R,sha256=KSD4GSssj-UZeMlWPbHbCLyonACGhSvVwAD4jeoJ_60,4099
129
134
  biopipen/scripts/scrna/SeuratClusterStats.R,sha256=SO4AGgF95YoLvjGMiC6fb3OIQkXne2Lqt5G7n50JYJo,616
130
135
  biopipen/scripts/scrna/SeuratClustering.R,sha256=JBJkwZmdjMsWzHaa_WvYCN1tXQimgclmgAOj3VJ1b3A,9114
@@ -200,20 +205,20 @@ biopipen/scripts/vcf/VcfSplitSamples.py,sha256=GraKi7WluzDAvVVGljwd3Yif6MriniF8s
200
205
  biopipen/scripts/web/Download.py,sha256=WKC_t5ZEeJoKFyY9XwksHARcMbKmHMcxNEUDLMGJ0Cc,924
201
206
  biopipen/scripts/web/DownloadList.py,sha256=cZvdi3LVzlATiTvAXe0uuDDXGqB5jcR2zHrMLCEb2U8,1130
202
207
  biopipen/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
203
- biopipen/utils/common_docstrs.py,sha256=7jnUhJ0GKV9YR6-wZYqycenGoQIz8Nol5auhKYuIGMM,3060
208
+ biopipen/utils/common_docstrs.py,sha256=77whqrhTg6kA7XHW5s7RJT3tGLo-d0XzgPc3LriBdgI,3296
204
209
  biopipen/utils/gene.R,sha256=BzAwlLA8hO12vF-3t6IwEuTEeLa_jBll4zm_5qe3qoE,1243
205
210
  biopipen/utils/gene.py,sha256=qE_BqTayrJWxRdniffhcz6OhZcw9GUoOrj2EtFWH9Gw,2246
206
211
  biopipen/utils/gsea.R,sha256=o3RC-wejsfFXPXzRIpFw22F-aif27qnuKEPavvXIlkc,5794
207
212
  biopipen/utils/io.R,sha256=jIYdqdn0iRWfQYAZa5CjXi3fikqmYvPPLIXhobRe8sw,537
208
213
  biopipen/utils/misc.R,sha256=nkjiAsEsilq0AeiKRDNqrhTx-1Grqg-rFlkjOEOEDYg,5224
209
214
  biopipen/utils/misc.py,sha256=Pmh3CBiKJ3vC_RqorfOfRAvTVKXrGDJT8DMLfYbTivs,3055
210
- biopipen/utils/mutate_helpers.R,sha256=E4OcaMC7aqb6D6m3dXSDLdHhTZb8RUksjtFwHweMGF8,13219
215
+ biopipen/utils/mutate_helpers.R,sha256=F_DYYjmmlPp2FppNIFUI1cNKsR2vUCwDn7NlvinasBQ,13068
211
216
  biopipen/utils/plot.R,sha256=pzl37PomNeUZPxohHZ2w93j3Fc4T0Qrc62FF-9MTKdw,4417
212
217
  biopipen/utils/reference.py,sha256=6bPSwQa-GiDfr7xLR9a5T64Ey40y24yn3QfQ5wDFZkU,4420
213
218
  biopipen/utils/rnaseq.R,sha256=Ro2B2dG-Z2oVaT5tkwp9RHBz4dp_RF-JcizlM5GYXFs,1298
214
219
  biopipen/utils/single_cell.R,sha256=bKduqOQjSC8BtZJuwfUShR49omoEMbB57n3Gi6dYlqA,4147
215
220
  biopipen/utils/vcf.py,sha256=ajXs0M_QghEctlvUlSRjWQIABVF02wPdYd-0LP4mIsU,9377
216
- biopipen-0.22.1.dist-info/METADATA,sha256=0PvmDBQ2Ffe1tvlcVMcEz5AdFbhLhPrswGpxHYXB5KM,886
217
- biopipen-0.22.1.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
218
- biopipen-0.22.1.dist-info/entry_points.txt,sha256=sfI6oDEEuMvAg0KNujE9uu-c29y7IwQQA1_A2sUjPhc,527
219
- biopipen-0.22.1.dist-info/RECORD,,
221
+ biopipen-0.22.2.dist-info/METADATA,sha256=vtGP0R0JZ3mSaEgRjhGbqNuLnbmYp1Rc7XoErM1JCxo,886
222
+ biopipen-0.22.2.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
223
+ biopipen-0.22.2.dist-info/entry_points.txt,sha256=-rKo4gInvzqlh7_2oEVmEo9gKO9y1ba3rHWTWOM5xP4,561
224
+ biopipen-0.22.2.dist-info/RECORD,,
@@ -2,6 +2,7 @@
2
2
  bam=biopipen.ns.bam
3
3
  bcftools=biopipen.ns.bcftools
4
4
  bed=biopipen.ns.bed
5
+ cellranger=biopipen.ns.cellranger
5
6
  cnv=biopipen.ns.cnv
6
7
  cnvkit=biopipen.ns.cnvkit
7
8
  cnvkit_pipeline=biopipen.ns.cnvkit_pipeline