biopipen 0.21.1__py3-none-any.whl → 0.22.0__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 +1 -1
- biopipen/core/filters.py +142 -0
- biopipen/ns/scrna.py +19 -1
- biopipen/ns/tcr.py +27 -0
- biopipen/reports/delim/SampleInfo.svelte +2 -22
- biopipen/reports/scrna/CellsDistribution.svelte +4 -39
- biopipen/reports/scrna/MarkersFinder.svelte +6 -126
- biopipen/reports/scrna/MetaMarkers.svelte +3 -75
- biopipen/reports/scrna/RadarPlots.svelte +4 -20
- biopipen/reports/scrna/ScFGSEA.svelte +4 -23
- biopipen/reports/scrna/SeuratClusterStats.svelte +3 -69
- biopipen/reports/scrna/SeuratPreparing.svelte +3 -26
- biopipen/reports/scrna/TopExpressingGenes.svelte +3 -41
- biopipen/reports/scrna_metabolic_landscape/MetabolicFeatures.svelte +17 -16
- biopipen/reports/scrna_metabolic_landscape/MetabolicFeaturesIntraSubset.svelte +13 -16
- biopipen/reports/scrna_metabolic_landscape/MetabolicPathwayActivity.svelte +44 -52
- biopipen/reports/scrna_metabolic_landscape/MetabolicPathwayHeterogeneity.svelte +2 -8
- biopipen/reports/tcr/CDR3AAPhyschem.svelte +18 -65
- biopipen/reports/tcr/CloneResidency.svelte +3 -93
- biopipen/reports/tcr/Immunarch.svelte +4 -155
- biopipen/reports/tcr/TCRClusterStats.svelte +3 -45
- biopipen/reports/tcr/TESSA.svelte +11 -28
- biopipen/scripts/delim/SampleInfo.R +41 -7
- biopipen/scripts/scrna/CellsDistribution.R +121 -16
- biopipen/scripts/scrna/MarkersFinder.R +245 -100
- biopipen/scripts/scrna/MetaMarkers.R +163 -82
- biopipen/scripts/scrna/RadarPlots.R +163 -110
- biopipen/scripts/scrna/ScFGSEA.R +51 -11
- biopipen/scripts/scrna/SeuratClusterStats-dimplots.R +26 -13
- biopipen/scripts/scrna/SeuratClusterStats-features.R +58 -53
- biopipen/scripts/scrna/SeuratClusterStats-stats.R +39 -21
- biopipen/scripts/scrna/SeuratClusterStats.R +4 -2
- biopipen/scripts/scrna/SeuratClustering.R +73 -26
- biopipen/scripts/scrna/SeuratPreparing.R +93 -19
- biopipen/scripts/scrna/TopExpressingGenes.R +100 -18
- biopipen/scripts/scrna_metabolic_landscape/MetabolicFeatures.R +21 -8
- biopipen/scripts/scrna_metabolic_landscape/MetabolicFeaturesIntraSubset.R +25 -3
- biopipen/scripts/scrna_metabolic_landscape/MetabolicPathwayActivity.R +1 -0
- biopipen/scripts/scrna_metabolic_landscape/MetabolicPathwayHeterogeneity.R +14 -3
- biopipen/scripts/tcr/CDR3AAPhyschem.R +122 -9
- biopipen/scripts/tcr/CloneResidency.R +114 -34
- biopipen/scripts/tcr/Immunarch-basic.R +26 -6
- biopipen/scripts/tcr/Immunarch-clonality.R +22 -2
- biopipen/scripts/tcr/Immunarch-diversity.R +132 -22
- biopipen/scripts/tcr/Immunarch-geneusage.R +33 -4
- biopipen/scripts/tcr/Immunarch-kmer.R +57 -7
- biopipen/scripts/tcr/Immunarch-overlap.R +72 -3
- biopipen/scripts/tcr/Immunarch-spectratyping.R +28 -5
- biopipen/scripts/tcr/Immunarch-tracking.R +33 -4
- biopipen/scripts/tcr/Immunarch-vjjunc.R +118 -0
- biopipen/scripts/tcr/Immunarch.R +17 -0
- biopipen/scripts/tcr/TCRClusterStats.R +124 -11
- biopipen/scripts/tcr/TESSA.R +43 -11
- biopipen/utils/misc.R +96 -1
- {biopipen-0.21.1.dist-info → biopipen-0.22.0.dist-info}/METADATA +1 -1
- {biopipen-0.21.1.dist-info → biopipen-0.22.0.dist-info}/RECORD +58 -57
- {biopipen-0.21.1.dist-info → biopipen-0.22.0.dist-info}/WHEEL +0 -0
- {biopipen-0.21.1.dist-info → biopipen-0.22.0.dist-info}/entry_points.txt +0 -0
biopipen/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.
|
|
1
|
+
__version__ = "0.22.0"
|
biopipen/core/filters.py
CHANGED
|
@@ -7,6 +7,7 @@ from typing import Any, List, Mapping
|
|
|
7
7
|
|
|
8
8
|
from argx import Namespace
|
|
9
9
|
from liquid.filters.manager import FilterManager
|
|
10
|
+
from pipen_report.filters import register_component, render_ui, _tag
|
|
10
11
|
|
|
11
12
|
filtermanager = FilterManager()
|
|
12
13
|
|
|
@@ -206,3 +207,144 @@ def r(
|
|
|
206
207
|
return r(vars(obj), ignoreintkey, todot, sortkeys, skip, _i)
|
|
207
208
|
|
|
208
209
|
return repr(obj)
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
@register_component("fgsea")
|
|
213
|
+
def _render_fgsea(
|
|
214
|
+
cont: Mapping[str, Any],
|
|
215
|
+
job: Mapping[str, Any],
|
|
216
|
+
level: int,
|
|
217
|
+
na_arg: str = "10",
|
|
218
|
+
) -> str:
|
|
219
|
+
"""Render fgsea report"""
|
|
220
|
+
# cont["dir"] is required
|
|
221
|
+
n_pathways = int(na_arg)
|
|
222
|
+
pathways = []
|
|
223
|
+
with Path(cont["dir"]).joinpath("fgsea.txt").open() as f:
|
|
224
|
+
next(f) # skip header
|
|
225
|
+
for line in f:
|
|
226
|
+
pathway, _ = line.split("\t", 1)
|
|
227
|
+
pathways.append(pathway)
|
|
228
|
+
if len(pathways) >= n_pathways:
|
|
229
|
+
break
|
|
230
|
+
|
|
231
|
+
components = [
|
|
232
|
+
# Summary
|
|
233
|
+
{
|
|
234
|
+
"title": "Enrichment Analysis Summary",
|
|
235
|
+
"ui": "tabs",
|
|
236
|
+
"contents": [
|
|
237
|
+
{
|
|
238
|
+
"title": "Plot",
|
|
239
|
+
"ui": "flat",
|
|
240
|
+
"contents": [
|
|
241
|
+
{
|
|
242
|
+
"kind": "image",
|
|
243
|
+
"src": str(Path(cont["dir"]).joinpath("gsea_table.png")),
|
|
244
|
+
}
|
|
245
|
+
],
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"title": "Table",
|
|
249
|
+
"ui": "flat",
|
|
250
|
+
"contents": [
|
|
251
|
+
{
|
|
252
|
+
"kind": "table",
|
|
253
|
+
"src": str(Path(cont["dir"]).joinpath("fgsea.txt")),
|
|
254
|
+
}
|
|
255
|
+
],
|
|
256
|
+
},
|
|
257
|
+
]
|
|
258
|
+
},
|
|
259
|
+
# Pathways
|
|
260
|
+
{
|
|
261
|
+
"title": f"Enriched Pathways (Top {n_pathways})",
|
|
262
|
+
"ui": "table_of_images",
|
|
263
|
+
"contents": [
|
|
264
|
+
{
|
|
265
|
+
"src": str(Path(cont["dir"]) / f"fgsea_{pw.replace('/', '-')}.png"),
|
|
266
|
+
"title": pw,
|
|
267
|
+
}
|
|
268
|
+
for pw in pathways
|
|
269
|
+
]
|
|
270
|
+
},
|
|
271
|
+
]
|
|
272
|
+
|
|
273
|
+
return render_ui(components, "accordion", job, level)
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
@register_component("pdf")
|
|
277
|
+
def _render_pdf(
|
|
278
|
+
cont: Mapping[str, Any],
|
|
279
|
+
job: Mapping[str, Any],
|
|
280
|
+
level: int,
|
|
281
|
+
) -> str:
|
|
282
|
+
"""Render pdf report"""
|
|
283
|
+
# cont["src"] is required
|
|
284
|
+
height = cont.get("height", "600")
|
|
285
|
+
return _tag(
|
|
286
|
+
"embed",
|
|
287
|
+
src=str(cont["src"]),
|
|
288
|
+
type="application/pdf",
|
|
289
|
+
width="100%",
|
|
290
|
+
height=height,
|
|
291
|
+
)
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
@register_component("gsea")
|
|
295
|
+
def _render_gsea(
|
|
296
|
+
cont: Mapping[str, Any],
|
|
297
|
+
job: Mapping[str, Any],
|
|
298
|
+
level: int,
|
|
299
|
+
) -> str:
|
|
300
|
+
"""Render gsea report"""
|
|
301
|
+
# cont["dir"] is required
|
|
302
|
+
raise NotImplementedError()
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
@register_component("enrichr")
|
|
306
|
+
def _render_enrichr(
|
|
307
|
+
cont: Mapping[str, Any],
|
|
308
|
+
job: Mapping[str, Any],
|
|
309
|
+
level: int,
|
|
310
|
+
) -> str:
|
|
311
|
+
"""Render enrichr report"""
|
|
312
|
+
# cont["dir"] is required
|
|
313
|
+
dbs = [sumfile.stem[8:] for sumfile in Path(cont["dir"]).glob("Enrichr-*.txt")]
|
|
314
|
+
components = []
|
|
315
|
+
|
|
316
|
+
for db in dbs:
|
|
317
|
+
components.append(
|
|
318
|
+
{
|
|
319
|
+
"title": db,
|
|
320
|
+
"ui": "tabs",
|
|
321
|
+
"contents": [
|
|
322
|
+
{
|
|
323
|
+
"title": "Plot",
|
|
324
|
+
"ui": "flat",
|
|
325
|
+
"contents": [
|
|
326
|
+
{
|
|
327
|
+
"kind": "image",
|
|
328
|
+
"src": str(
|
|
329
|
+
Path(cont["dir"]).joinpath(f"Enrichr-{db}.png")
|
|
330
|
+
),
|
|
331
|
+
}
|
|
332
|
+
],
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"title": "Table",
|
|
336
|
+
"ui": "flat",
|
|
337
|
+
"contents": [
|
|
338
|
+
{
|
|
339
|
+
"kind": "table",
|
|
340
|
+
"src": str(
|
|
341
|
+
Path(cont["dir"]).joinpath(f"Enrichr-{db}.txt")
|
|
342
|
+
),
|
|
343
|
+
}
|
|
344
|
+
],
|
|
345
|
+
},
|
|
346
|
+
],
|
|
347
|
+
}
|
|
348
|
+
)
|
|
349
|
+
|
|
350
|
+
return render_ui(components, "accordion", job, level)
|
biopipen/ns/scrna.py
CHANGED
|
@@ -257,6 +257,16 @@ class SeuratClustering(Proc):
|
|
|
257
257
|
`object` is specified internally, and `-` in the key will be replaced with `.`.
|
|
258
258
|
- resolution (type=float): The resolution of the clustering
|
|
259
259
|
- <more>: See <https://satijalab.org/seurat/reference/findclusters>
|
|
260
|
+
cache (type=auto): Whether to cache the seurat object with cluster information.
|
|
261
|
+
If `True`, the seurat object will be cached in the job output directory, which will be not cleaned up when job is rerunning.
|
|
262
|
+
The cached seurat object will be saved as `<signature>.cached.RDS` file, where `<signature>` is the signature determined by
|
|
263
|
+
the input and envs of the process.
|
|
264
|
+
See <https://github.com/satijalab/seurat/issues/7849>, <https://github.com/satijalab/seurat/issues/5358> and
|
|
265
|
+
<https://github.com/satijalab/seurat/issues/6748> for more details.
|
|
266
|
+
To not use the cached seurat object, you can either set `cache` to `False` or delete the cached file at
|
|
267
|
+
`.pipen/<Pipeline>/SeuratClustering/0/output/<signature>.cached.RDS`.
|
|
268
|
+
You can also specify the directory to save the cached seurat object by setting `cache` to the directory path.
|
|
269
|
+
|
|
260
270
|
|
|
261
271
|
Requires:
|
|
262
272
|
r-seurat:
|
|
@@ -286,6 +296,7 @@ class SeuratClustering(Proc):
|
|
|
286
296
|
"RunUMAP": {"reduction": "pca", "dims": 30},
|
|
287
297
|
"FindNeighbors": {},
|
|
288
298
|
"FindClusters": {"resolution": 0.8},
|
|
299
|
+
"cache": True,
|
|
289
300
|
}
|
|
290
301
|
script = "file://../scripts/scrna/SeuratClustering.R"
|
|
291
302
|
|
|
@@ -418,6 +429,7 @@ class SeuratClusterStats(Proc):
|
|
|
418
429
|
- group-by: Same as `ident`. How the points are colored.
|
|
419
430
|
- split-by: The column name in metadata to split the cells into different plots.
|
|
420
431
|
- shape-by: The column name in metadata to use as the shape.
|
|
432
|
+
- subset: An expression to subset the cells, will be passed to `tidyrseurat::filter()`.
|
|
421
433
|
- devpars (ns): The device parameters for the plots.
|
|
422
434
|
- res (type=int): The resolution of the plots.
|
|
423
435
|
- height (type=int): The height of the plots.
|
|
@@ -482,6 +494,7 @@ class SeuratClusterStats(Proc):
|
|
|
482
494
|
"group-by": None,
|
|
483
495
|
"split-by": None,
|
|
484
496
|
"shape-by": None,
|
|
497
|
+
"subset": None,
|
|
485
498
|
"reduction": "dim",
|
|
486
499
|
"devpars": {"res": 100, "height": 800, "width": 1000},
|
|
487
500
|
},
|
|
@@ -642,6 +655,7 @@ class CellsDistribution(Proc):
|
|
|
642
655
|
Ignored if `cells_order` is specified.
|
|
643
656
|
subset: An expression to subset the cells, will be passed to `dplyr::filter()` on metadata.
|
|
644
657
|
This will be applied prior to `each`.
|
|
658
|
+
descr: The description of the case, will be shown in the report.
|
|
645
659
|
devpars (ns): The device parameters for the plots.
|
|
646
660
|
- res (type=int): The resolution of the plots
|
|
647
661
|
- height (type=int): The height of the plots
|
|
@@ -676,6 +690,7 @@ class CellsDistribution(Proc):
|
|
|
676
690
|
"cells_orderby": None,
|
|
677
691
|
"cells_n": 10,
|
|
678
692
|
"subset": None,
|
|
693
|
+
"descr": None,
|
|
679
694
|
"devpars": {},
|
|
680
695
|
"each": None,
|
|
681
696
|
"section": "DEFAULT",
|
|
@@ -1669,7 +1684,7 @@ class RadarPlots(Proc):
|
|
|
1669
1684
|
"cluster_order": [],
|
|
1670
1685
|
"breaks": [],
|
|
1671
1686
|
"direction": "intra-cluster",
|
|
1672
|
-
"section":
|
|
1687
|
+
"section": "DEFAULT",
|
|
1673
1688
|
"devpars": {
|
|
1674
1689
|
"res": 100,
|
|
1675
1690
|
"width": 1200,
|
|
@@ -1719,6 +1734,8 @@ class MetaMarkers(Proc):
|
|
|
1719
1734
|
dbs (list): The dbs to do enrichment analysis for significant
|
|
1720
1735
|
markers See below for all libraries.
|
|
1721
1736
|
<https://maayanlab.cloud/Enrichr/#libraries>
|
|
1737
|
+
subset: The subset of the cells to do the analysis.
|
|
1738
|
+
An expression passed to `dplyr::filter()`.
|
|
1722
1739
|
p_adjust (choice): The method to adjust the p values, which can be used to filter the significant markers.
|
|
1723
1740
|
See also <https://rdrr.io/r/stats/p.adjust.html>
|
|
1724
1741
|
- holm: Holm-Bonferroni method
|
|
@@ -1759,6 +1776,7 @@ class MetaMarkers(Proc):
|
|
|
1759
1776
|
"group-by": None,
|
|
1760
1777
|
"idents": None,
|
|
1761
1778
|
"each": None,
|
|
1779
|
+
"subset": None,
|
|
1762
1780
|
"prefix_each": True,
|
|
1763
1781
|
"p_adjust": "BH",
|
|
1764
1782
|
"dbs": [
|
biopipen/ns/tcr.py
CHANGED
|
@@ -180,6 +180,7 @@ class Immunarch(Proc):
|
|
|
180
180
|
- The dynamics of repertoires across time points/samples, provided by [`immunarch::trackClonotypes`](https://immunarch.com/reference/trackClonotypes.html)
|
|
181
181
|
- The spectratype of clonotypes, provided by [`immunarch::spectratype`](https://immunarch.com/reference/spectratype.html)
|
|
182
182
|
- The distributions of kmers and sequence profiles, provided by [`immunarch::getKmers`](https://immunarch.com/reference/getKmers.html)
|
|
183
|
+
- The V-J junction circos plots, implemented within the script of this process.
|
|
183
184
|
|
|
184
185
|
Environment Variable Design:
|
|
185
186
|
With different sets of arguments, a single function of the above can perform different tasks.
|
|
@@ -657,6 +658,24 @@ class Immunarch(Proc):
|
|
|
657
658
|
The values will be passed to the corresponding arguments above.
|
|
658
659
|
If any of these arguments are not specified, the default case will be added, with the name `DEFAULT` and the
|
|
659
660
|
values of `envs.kmers.k`, `envs.kmers.head`, `envs.kmers.vis_args` and `envs.kmers.devpars`.
|
|
661
|
+
vj_junc (ns): Arguments for VJ junction circos plots.
|
|
662
|
+
This analysis is not included in `immunarch`. It is a separate implementation using [`circlize`](https://github.com/jokergoo/circlize).
|
|
663
|
+
- by: Groupings to show VJ usages. Typically, this is the `Sample` column, so that the VJ usages are shown for each sample.
|
|
664
|
+
But you can also use other columns, such as `Subject` to show the VJ usages for each subject.
|
|
665
|
+
Multiple columns should be separated by `,`.
|
|
666
|
+
- by_clones (flag): If True, the VJ usages will be calculated based on the distinct clonotypes, instead of the individual cells.
|
|
667
|
+
- subset: Subset the data before plotting VJ usages.
|
|
668
|
+
The whole data will be expanded to cell level, and then subsetted.
|
|
669
|
+
Clone sizes will be re-calculated based on the subsetted data, which will affect the VJ usages at cell level (by_clones=False).
|
|
670
|
+
- devpars (ns): The parameters for the plotting device.
|
|
671
|
+
- width (type=int): The width of the plot.
|
|
672
|
+
- height (type=int): The height of the plot.
|
|
673
|
+
- res (type=int): The resolution of the plot.
|
|
674
|
+
- cases (type=json;order=9): If you have multiple cases, you can use this argument to specify them.
|
|
675
|
+
The keys will be used as the names of the cases. The values will be passed to the corresponding arguments above.
|
|
676
|
+
If any of these arguments are not specified, the values in `envs.vj_junc` will be used.
|
|
677
|
+
If NO cases are specified, the default case will be added, with the name `DEFAULT` and the
|
|
678
|
+
values of `envs.vj_junc.by`, `envs.vj_junc.by_clones` `envs.vj_junc.subset` and `envs.vj_junc.devpars`.
|
|
660
679
|
""" # noqa: E501
|
|
661
680
|
input = "immdata:file,metafile:file"
|
|
662
681
|
output = "outdir:dir:{{in.immdata | stem}}.immunarch"
|
|
@@ -801,6 +820,14 @@ class Immunarch(Proc):
|
|
|
801
820
|
},
|
|
802
821
|
"cases": {},
|
|
803
822
|
},
|
|
823
|
+
# VJ junction
|
|
824
|
+
"vj_junc": {
|
|
825
|
+
"by": "Sample",
|
|
826
|
+
"by_clones": True,
|
|
827
|
+
"devpars": {"width": 800, "height": 800, "res": 100},
|
|
828
|
+
"subset": None,
|
|
829
|
+
"cases": {},
|
|
830
|
+
},
|
|
804
831
|
}
|
|
805
832
|
script = "file://../scripts/tcr/Immunarch.R"
|
|
806
833
|
plugin_opts = {
|
|
@@ -1,31 +1,11 @@
|
|
|
1
1
|
{% from "utils/misc.liq" import report_jobs, table_of_images -%}
|
|
2
2
|
|
|
3
3
|
<script>
|
|
4
|
-
import { Image, DataTable } from "$libs";
|
|
4
|
+
import { Image, DataTable, Descr } from "$libs";
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
{%- macro report_job(job, h=1) -%}
|
|
8
|
-
|
|
9
|
-
{% if envs.stats %}
|
|
10
|
-
<h{{h}}>Sample Information</h{{h}}>
|
|
11
|
-
{% endif %}
|
|
12
|
-
{% if envs.exclude_cols and isinstance(envs.exclude_cols, str) %}
|
|
13
|
-
{% set excluded_cols = envs.exclude_cols | replace: " ", "" | split: "," %}
|
|
14
|
-
{% else %}
|
|
15
|
-
{% set excluded_cols = envs.exclude_cols %}
|
|
16
|
-
{% endif %}
|
|
17
|
-
|
|
18
|
-
<DataTable
|
|
19
|
-
data={ {{ job.out.outfile | datatable: sep="\t", excluded=excluded_cols }} }
|
|
20
|
-
pageSize={50}
|
|
21
|
-
/>
|
|
22
|
-
|
|
23
|
-
{% if envs.stats %}
|
|
24
|
-
<h{{h}}>Statistics</h{{h}}>
|
|
25
|
-
{%- set stat_imgs = job.outdir | glob: "*.png" -%}
|
|
26
|
-
{{- table_of_images(stat_imgs) -}}
|
|
27
|
-
{% endif %}
|
|
28
|
-
|
|
8
|
+
{{ job | render_job: h=h }}
|
|
29
9
|
{%- endmacro -%}
|
|
30
10
|
|
|
31
11
|
{%- macro head_job(job) -%}
|
|
@@ -1,50 +1,15 @@
|
|
|
1
1
|
{% from "utils/misc.liq" import report_jobs, table_of_images -%}
|
|
2
2
|
<script>
|
|
3
|
-
import { Image } from "$libs";
|
|
3
|
+
import { Image, DataTable, Descr } from "$libs";
|
|
4
|
+
import { Tabs, Tab, TabContent } from "$ccs";
|
|
4
5
|
</script>
|
|
5
6
|
|
|
6
7
|
{%- macro report_job(job, h=1) -%}
|
|
7
|
-
{
|
|
8
|
-
{%- if len(secdirs) == 1 -%}
|
|
9
|
-
{%- set secname = secdirs | first | basename -%}
|
|
10
|
-
{%- if secdirs[0] | joinpaths: "venn.png" | exists -%}
|
|
11
|
-
{%- if secname == "DEFAULT" -%}
|
|
12
|
-
<h{{h}}>Case overlapping</h{{h}}>
|
|
13
|
-
{%- else -%}
|
|
14
|
-
<h{{h}}>{{ secname | escape }} - Case overlapping</h{{h}}>
|
|
15
|
-
{%- endif -%}
|
|
16
|
-
{{ table_of_images(
|
|
17
|
-
[joinpaths(secdirs[0], "venn.png"), joinpaths(secdirs[0], "upset.png")],
|
|
18
|
-
["Venn plot", "Upset plot"]) }}
|
|
19
|
-
{%- endif -%}
|
|
20
|
-
{%- for plotfile in secdirs[0] | glob: "case-*.png" -%}
|
|
21
|
-
{%- if secname == "DEFAULT" -%}
|
|
22
|
-
<h{{h}}>{{ plotfile | stem | escape }}</h{{h}}>
|
|
23
|
-
{%- else -%}
|
|
24
|
-
<h{{h}}>{{ secname | escape }} - {{ plotfile | stem | escape }}</h{{h}}>
|
|
25
|
-
{%- endif -%}
|
|
26
|
-
<Image src={{plotfile | quote}} />
|
|
27
|
-
{%- endfor -%}
|
|
28
|
-
{%- else -%}
|
|
29
|
-
{%- for secdir in secdirs -%}
|
|
30
|
-
{%- set sec = secdir | basename -%}
|
|
31
|
-
<h{{h}}>{{sec | escape}}</h{{h}}>
|
|
32
|
-
{%- if secdir | joinpaths: "venn.png" | exists -%}
|
|
33
|
-
<h{{h+1}}>Case overlapping</h{{h+1}}>
|
|
34
|
-
{{ table_of_images(
|
|
35
|
-
[joinpaths(secdir, "venn.png"), joinpaths(secdir, "upset.png")],
|
|
36
|
-
["Venn plot", "Upset plot"]) }}
|
|
37
|
-
{%- endif -%}
|
|
38
|
-
{%- for plotfile in secdir | glob: "case-*.png" -%}
|
|
39
|
-
<h{{h+1}}>{{ plotfile | stem }}</h{{h+1}}>
|
|
40
|
-
<Image src={{plotfile | quote}} />
|
|
41
|
-
{%- endfor -%}
|
|
42
|
-
{%- endfor -%}
|
|
43
|
-
{%- endif -%}
|
|
8
|
+
{{ job | render_job: h=h }}
|
|
44
9
|
{%- endmacro -%}
|
|
45
10
|
|
|
46
11
|
{%- macro head_job(job) -%}
|
|
47
|
-
<h1>{{job.in.srtobj | stem0 | escape}}</h1>
|
|
12
|
+
<h1>{{job.in.srtobj | stem0 | escape}}</h1>
|
|
48
13
|
{%- endmacro -%}
|
|
49
14
|
|
|
50
15
|
{{ report_jobs(jobs, head_job, report_job) }}
|
|
@@ -1,138 +1,18 @@
|
|
|
1
1
|
{% from "utils/misc.liq" import report_jobs -%}
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
<script>
|
|
4
|
-
import { Image, DataTable } from "$libs";
|
|
5
|
-
import { Tabs, Tab, TabContent, InlineNotification } from "$ccs";
|
|
4
|
+
import { Image, DataTable, Descr } from "$libs";
|
|
5
|
+
import { Tabs, Tab, TabContent, InlineNotification, Accordion, AccordionItem } from "$ccs";
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
{%- macro report_job(job, h=1) -%}
|
|
10
|
-
{
|
|
11
|
-
{%- set ovdir = job.out.outdir | joinpaths: "OVERLAPS" -%}
|
|
12
|
-
{%- set secdirs = [] -%}
|
|
13
|
-
{%- for adir in alldirs -%}
|
|
14
|
-
{%- if basename(adir) != "OVERLAPS" -%}
|
|
15
|
-
{%- set _ = secdirs.append(adir) -%}
|
|
16
|
-
{%- endif -%}
|
|
17
|
-
{%- endfor -%}
|
|
18
|
-
|
|
19
|
-
{%- if len(secdirs) == 1 -%}
|
|
20
|
-
{%- set secname = secdirs | first | basename -%}
|
|
21
|
-
{%- for casedir in secdirs[0] | glob: "*" -%}
|
|
22
|
-
{%- if secname == "DEFAULT" -%}
|
|
23
|
-
<h{{h}}>{{casedir | basename | escape}}</h{{h}}>
|
|
24
|
-
{%- else -%}
|
|
25
|
-
<h{{h}}>{{secname | escape}} - {{casedir | basename | escape}}</h{{h}}>
|
|
26
|
-
{%- endif -%}
|
|
27
|
-
{%- if casedir | joinpaths: "error.txt" | exists -%}
|
|
28
|
-
<InlineNotification
|
|
29
|
-
hideCloseButton
|
|
30
|
-
lowContrast
|
|
31
|
-
kind="warning"
|
|
32
|
-
subtitle={{ casedir | joinpaths: "error.txt" | read | quote }}
|
|
33
|
-
/>
|
|
34
|
-
{%- else -%}
|
|
35
|
-
<h{{h+1}}>Markers</h{{h+1}}>
|
|
36
|
-
<Tabs>
|
|
37
|
-
<Tab label="Markers" />
|
|
38
|
-
<Tab label="Volcano Plot" />
|
|
39
|
-
<Tab label="Dot Plot" />
|
|
40
|
-
<svelte:fragment slot="content">
|
|
41
|
-
<TabContent>
|
|
42
|
-
<DataTable
|
|
43
|
-
src={{ casedir | joinpaths: "markers.txt" | quote }}
|
|
44
|
-
data={ {{ casedir | joinpaths: "markers.txt" | datatable: sep="\t", nrows=100 }} }
|
|
45
|
-
/>
|
|
46
|
-
</TabContent>
|
|
47
|
-
<TabContent>
|
|
48
|
-
<Image src={{ casedir | joinpaths: "volcano.png" | quote }} />
|
|
49
|
-
</TabContent>
|
|
50
|
-
<TabContent>
|
|
51
|
-
<Image src={{ casedir | joinpaths: "dotplot.png" | quote }} />
|
|
52
|
-
</TabContent>
|
|
53
|
-
</svelte:fragment>
|
|
54
|
-
</Tabs>
|
|
55
|
-
|
|
56
|
-
<h{{h+1}}>Enrichment analysis</h{{h+1}}>
|
|
57
|
-
{{ enrichr_report(casedir) }}
|
|
58
|
-
{%- endif -%}
|
|
59
|
-
{%- endfor -%}
|
|
60
|
-
{%- else -%}
|
|
61
|
-
{%- for secdir in secdirs -%}
|
|
62
|
-
{%- set sec = secdir | basename -%}
|
|
63
|
-
<h{{h}}>{{sec | escape}}</h{{h}}>
|
|
64
|
-
{%- for casedir in secdir | glob: "*" -%}
|
|
65
|
-
<h{{h+1}}>{{casedir | basename | escape}}</h{{h+1}}>
|
|
66
|
-
{%- if casedir | joinpaths: "error.txt" | exists -%}
|
|
67
|
-
<InlineNotification
|
|
68
|
-
hideCloseButton
|
|
69
|
-
lowContrast
|
|
70
|
-
kind="warning"
|
|
71
|
-
subtitle={{ casedir | joinpaths: "error.txt" | read | quote }}
|
|
72
|
-
/>
|
|
73
|
-
{%- else -%}
|
|
74
|
-
<h{{h+2}}>Markers</h{{h+2}}>
|
|
75
|
-
<Tabs>
|
|
76
|
-
<Tab label="Markers" />
|
|
77
|
-
<Tab label="Volcano Plot" />
|
|
78
|
-
<Tab label="Dot Plot" />
|
|
79
|
-
<svelte:fragment slot="content">
|
|
80
|
-
<TabContent>
|
|
81
|
-
<DataTable
|
|
82
|
-
src={{ casedir | joinpaths: "markers.txt" | quote }}
|
|
83
|
-
data={ {{ casedir | joinpaths: "markers.txt" | datatable: sep="\t", nrows=100 }} }
|
|
84
|
-
/>
|
|
85
|
-
</TabContent>
|
|
86
|
-
<TabContent>
|
|
87
|
-
<Image src={{ casedir | joinpaths: "volcano.png" | quote }} />
|
|
88
|
-
</TabContent>
|
|
89
|
-
<TabContent>
|
|
90
|
-
<Image src={{ casedir | joinpaths: "dotplot.png" | quote }} />
|
|
91
|
-
</TabContent>
|
|
92
|
-
</svelte:fragment>
|
|
93
|
-
</Tabs>
|
|
94
|
-
|
|
95
|
-
<h{{h+2}}>Enrichment analysis</h{{h+2}}>
|
|
96
|
-
{{ enrichr_report(casedir) }}
|
|
97
|
-
{%- endif -%}
|
|
98
|
-
{%- endfor -%}
|
|
99
|
-
{%- endfor -%}
|
|
100
|
-
{%- endif -%}
|
|
101
|
-
|
|
102
|
-
{%- if ovdir | exists -%}
|
|
103
|
-
<h{{h}}>Overlapping Markers</h{{h}}>
|
|
104
|
-
{%- for casedir in ovdir | glob: "*" -%}
|
|
105
|
-
<h{{h+1}}>{{casedir | basename | escape}}</h{{h+1}}>
|
|
106
|
-
<Tabs>
|
|
107
|
-
{%- if casedir | joinpaths: "venn.png" | exists -%}
|
|
108
|
-
<Tab label="Venn Diagram" />
|
|
109
|
-
{%- endif -%}
|
|
110
|
-
<Tab label="UpSet Plot" />
|
|
111
|
-
<Tab label="Marks" />
|
|
112
|
-
<svelte:fragment slot="content">
|
|
113
|
-
{%- if casedir | joinpaths: "venn.png" | exists -%}
|
|
114
|
-
<TabContent>
|
|
115
|
-
<Image src={{ casedir | joinpaths: "venn.png" | quote }} />
|
|
116
|
-
</TabContent>
|
|
117
|
-
{%- endif -%}
|
|
118
|
-
<TabContent>
|
|
119
|
-
<Image src={{ casedir | joinpaths: "upset.png" | quote }} />
|
|
120
|
-
</TabContent>
|
|
121
|
-
<TabContent>
|
|
122
|
-
<DataTable
|
|
123
|
-
src={{ casedir | joinpaths: "markers.txt" | quote }}
|
|
124
|
-
data={ {{ casedir | joinpaths: "markers.txt" | datatable: sep="\t" }} }
|
|
125
|
-
/>
|
|
126
|
-
</TabContent>
|
|
127
|
-
</svelte:fragment>
|
|
128
|
-
</Tabs>
|
|
129
|
-
{%- endfor -%}
|
|
130
|
-
{%- endif -%}
|
|
10
|
+
{{ job | render_job: h=h }}
|
|
131
11
|
{%- endmacro -%}
|
|
132
12
|
|
|
133
13
|
|
|
134
14
|
{%- macro head_job(job) -%}
|
|
135
|
-
|
|
15
|
+
<h1>{{job.in.srtobj | stem | escape}}</h1>
|
|
136
16
|
{%- endmacro -%}
|
|
137
17
|
|
|
138
|
-
{{ report_jobs(jobs, head_job, report_job) }}
|
|
18
|
+
{{ report_jobs(jobs, head_job, report_job) }}
|
|
@@ -1,85 +1,13 @@
|
|
|
1
1
|
{% from "utils/misc.liq" import report_jobs, table_of_images -%}
|
|
2
2
|
{% from "utils/gsea.liq" import enrichr_report -%}
|
|
3
3
|
<script>
|
|
4
|
-
import { Image, DataTable } from "$libs";
|
|
5
|
-
import { Tabs, Tab, TabContent, InlineNotification } from "$ccs";
|
|
4
|
+
import { Image, DataTable, Descr } from "$libs";
|
|
5
|
+
import { Tabs, Tab, TabContent, InlineNotification, Accordion, AccordionItem } from "$ccs";
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
{%- macro report_job(job, h=1) -%}
|
|
10
|
-
{
|
|
11
|
-
{%- if len(secdirs) == 1 -%}
|
|
12
|
-
{%- set secname = secdirs | first | basename -%}
|
|
13
|
-
{%- for casedir in secdirs[0] | glob: "*" -%}
|
|
14
|
-
{%- if secname == "DEFAULT" -%}
|
|
15
|
-
<h{{h}}>{{casedir | basename | escape}}</h{{h}}>
|
|
16
|
-
{%- else -%}
|
|
17
|
-
<h{{h}}>{{secname | escape}} - {{casedir | basename | escape}}</h{{h}}>
|
|
18
|
-
{%- endif -%}
|
|
19
|
-
{%- if casedir | joinpaths: "error.txt" | exists -%}
|
|
20
|
-
<InlineNotification
|
|
21
|
-
hideCloseButton
|
|
22
|
-
lowContrast
|
|
23
|
-
kind="warning"
|
|
24
|
-
subtitle={{ casedir | joinpaths: "error.txt" | read | quote }}
|
|
25
|
-
/>
|
|
26
|
-
{%- else -%}
|
|
27
|
-
<h{{h+1}}>Markers</h{{h+1}}>
|
|
28
|
-
<Tabs>
|
|
29
|
-
<Tab label="Top 10 genes" />
|
|
30
|
-
<Tab label="Table of top 100 genes" />
|
|
31
|
-
<div slot="content">
|
|
32
|
-
<TabContent>
|
|
33
|
-
{{ table_of_images(glob(casedir, "plots", "*.png"), col = 4) }}
|
|
34
|
-
</TabContent>
|
|
35
|
-
<TabContent>
|
|
36
|
-
<DataTable
|
|
37
|
-
src={{ casedir | joinpaths: "markers.txt" | quote }}
|
|
38
|
-
data={ {{ casedir | joinpaths: "markers.txt" | datatable: sep="\t", nrows=100 }} }
|
|
39
|
-
/>
|
|
40
|
-
</TabContent>
|
|
41
|
-
</div>
|
|
42
|
-
</Tabs>
|
|
43
|
-
|
|
44
|
-
<h{{h+1}}>Enrichment analysis</h{{h+1}}>
|
|
45
|
-
{{ enrichr_report(casedir) }}
|
|
46
|
-
{%- endif -%}
|
|
47
|
-
{%- endfor -%}
|
|
48
|
-
{%- else -%}
|
|
49
|
-
{%- for secdir in secdirs -%}
|
|
50
|
-
{%- set sec = secdir | basename -%}
|
|
51
|
-
<h{{h}}>{{sec | escape}}</h{{h}}>
|
|
52
|
-
{%- for casedir in secdir | glob: "*" -%}
|
|
53
|
-
<h{{h+1}}>{{casedir | basename | escape}}</h{{h+1}}>
|
|
54
|
-
{%- if casedir | joinpaths: "error.txt" | exists -%}
|
|
55
|
-
<InlineNotification
|
|
56
|
-
hideCloseButton
|
|
57
|
-
lowContrast
|
|
58
|
-
kind="warning"
|
|
59
|
-
subtitle={{ casedir | joinpaths: "error.txt" | read | quote }}
|
|
60
|
-
/>
|
|
61
|
-
{%- else -%}
|
|
62
|
-
<h{{h+2}}>Markers</h{{h+2}}>
|
|
63
|
-
<Tabs>
|
|
64
|
-
<Tab label="Top 10 genes" />
|
|
65
|
-
<Tab label="Table of top 100 genes" />
|
|
66
|
-
<TabContent>
|
|
67
|
-
{{ table_of_images(glob(casedir, "plots", "*.png"), col = 4) }}
|
|
68
|
-
</TabContent>
|
|
69
|
-
<TabContent>
|
|
70
|
-
<DataTable
|
|
71
|
-
src={{ casedir | joinpaths: "markers.txt" | quote }}
|
|
72
|
-
data={ {{ casedir | joinpaths: "markers.txt" | datatable: sep="\t", nrows=100 }} }
|
|
73
|
-
/>
|
|
74
|
-
</TabContent>
|
|
75
|
-
</Tabs>
|
|
76
|
-
|
|
77
|
-
<h{{h+2}}>Enrichment analysis</h{{h+2}}>
|
|
78
|
-
{{ enrichr_report(casedir) }}
|
|
79
|
-
{%- endif -%}
|
|
80
|
-
{%- endfor -%}
|
|
81
|
-
{%- endfor -%}
|
|
82
|
-
{%- endif -%}
|
|
10
|
+
{{ job | render_job: h=h }}
|
|
83
11
|
{%- endmacro -%}
|
|
84
12
|
|
|
85
13
|
|
|
@@ -1,31 +1,15 @@
|
|
|
1
1
|
{% from "utils/misc.liq" import report_jobs, table_of_images -%}
|
|
2
2
|
<script>
|
|
3
|
-
import { Image } from "$libs";
|
|
3
|
+
import { Image, DataTable } from "$libs";
|
|
4
|
+
import { Tabs, Tab, TabContent } from "$ccs";
|
|
4
5
|
</script>
|
|
5
6
|
|
|
6
7
|
{%- macro report_job(job, h=1) -%}
|
|
7
|
-
{
|
|
8
|
-
{%- if section_file | exists -%}
|
|
9
|
-
{%- set sections = section_file | config: "toml" -%}
|
|
10
|
-
{%- for section, cases in sections.items() -%}
|
|
11
|
-
<h{{h}}>{{section | escape}}</h{{h}}>
|
|
12
|
-
{%- set imgs = [] -%}
|
|
13
|
-
{%- for case in cases -%}
|
|
14
|
-
{%- set img = job.out.outdir | joinpaths: case + ".png" -%}
|
|
15
|
-
{%- set _ = imgs.append(img) -%}
|
|
16
|
-
{%- endfor -%}
|
|
17
|
-
{{ table_of_images(imgs) }}
|
|
18
|
-
{%- endfor -%}
|
|
19
|
-
{%- else -%}
|
|
20
|
-
{%- for img in job.out.outdir | glob: "*.png" -%}
|
|
21
|
-
<h{{h}}>{{img | stem | escape}}</h{{h}}>
|
|
22
|
-
<Image src={{img | quote}} />
|
|
23
|
-
{%- endfor -%}
|
|
24
|
-
{%- endif -%}
|
|
8
|
+
{{ job | render_job: h=h }}
|
|
25
9
|
{%- endmacro -%}
|
|
26
10
|
|
|
27
11
|
{%- macro head_job(job) -%}
|
|
28
|
-
<h1>{{job.in.srtobj | stem}}</h1>
|
|
12
|
+
<h1>{{job.in.srtobj | stem}}</h1>
|
|
29
13
|
{%- endmacro -%}
|
|
30
14
|
|
|
31
15
|
{{ report_jobs(jobs, head_job, report_job) }}
|