biopipen 0.32.3__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 +1 -1
- biopipen/core/config.toml +6 -0
- biopipen/core/filters.py +35 -23
- biopipen/core/testing.py +6 -1
- biopipen/ns/bam.py +39 -0
- biopipen/ns/cellranger.py +5 -0
- biopipen/ns/cellranger_pipeline.py +2 -2
- biopipen/ns/cnvkit_pipeline.py +4 -1
- biopipen/ns/delim.py +33 -27
- biopipen/ns/protein.py +99 -0
- biopipen/ns/scrna.py +428 -250
- biopipen/ns/snp.py +16 -3
- biopipen/ns/tcr.py +125 -1
- biopipen/ns/vcf.py +34 -0
- biopipen/ns/web.py +5 -1
- biopipen/reports/scrna/SeuratClusterStats.svelte +1 -1
- biopipen/reports/scrna/SeuratMap2Ref.svelte +15 -2
- biopipen/reports/tcr/ClonalStats.svelte +15 -0
- biopipen/reports/utils/misc.liq +20 -7
- biopipen/scripts/bam/BamMerge.py +2 -2
- biopipen/scripts/bam/BamSampling.py +4 -4
- biopipen/scripts/bam/BamSort.py +141 -0
- biopipen/scripts/bam/BamSplitChroms.py +10 -10
- biopipen/scripts/bam/BamSubsetByBed.py +3 -3
- biopipen/scripts/bam/CNVpytor.py +10 -10
- biopipen/scripts/bam/ControlFREEC.py +11 -11
- biopipen/scripts/bed/Bed2Vcf.py +5 -5
- biopipen/scripts/bed/BedConsensus.py +5 -5
- biopipen/scripts/bed/BedLiftOver.sh +6 -4
- biopipen/scripts/bed/BedtoolsIntersect.py +4 -4
- biopipen/scripts/bed/BedtoolsMakeWindows.py +3 -3
- biopipen/scripts/bed/BedtoolsMerge.py +4 -4
- biopipen/scripts/cellranger/CellRangerCount.py +20 -9
- biopipen/scripts/cellranger/CellRangerSummary.R +20 -29
- biopipen/scripts/cellranger/CellRangerVdj.py +8 -8
- biopipen/scripts/cnvkit/CNVkitAccess.py +6 -6
- biopipen/scripts/cnvkit/CNVkitAutobin.py +25 -18
- biopipen/scripts/cnvkit/CNVkitBatch.py +5 -5
- biopipen/scripts/cnvkit/CNVkitCall.py +3 -3
- biopipen/scripts/cnvkit/CNVkitCoverage.py +2 -2
- biopipen/scripts/cnvkit/CNVkitDiagram.py +5 -5
- biopipen/scripts/cnvkit/CNVkitFix.py +3 -3
- biopipen/scripts/cnvkit/CNVkitGuessBaits.py +9 -5
- biopipen/scripts/cnvkit/CNVkitHeatmap.py +4 -4
- biopipen/scripts/cnvkit/CNVkitReference.py +2 -2
- biopipen/scripts/cnvkit/CNVkitScatter.py +5 -5
- biopipen/scripts/cnvkit/CNVkitSegment.py +5 -5
- biopipen/scripts/cnvkit/guess_baits.py +166 -93
- biopipen/scripts/delim/SampleInfo.R +94 -148
- biopipen/scripts/misc/Config2File.py +2 -2
- biopipen/scripts/misc/Str2File.py +2 -2
- biopipen/scripts/protein/MMCIF2PDB.py +33 -0
- biopipen/scripts/protein/PDB2Fasta.py +60 -0
- biopipen/scripts/protein/Prodigy.py +4 -4
- biopipen/scripts/protein/RMSD.py +178 -0
- biopipen/scripts/regulatory/MotifScan.py +8 -8
- biopipen/scripts/scrna/CellCellCommunication.py +59 -22
- biopipen/scripts/scrna/LoomTo10X.R +51 -0
- biopipen/scripts/scrna/MarkersFinder.R +273 -654
- biopipen/scripts/scrna/RadarPlots.R +73 -53
- biopipen/scripts/scrna/SCP-plot.R +15202 -0
- biopipen/scripts/scrna/ScVelo.py +0 -0
- biopipen/scripts/scrna/SeuratClusterStats-clustree.R +23 -31
- biopipen/scripts/scrna/SeuratClusterStats-dimplots.R +26 -54
- biopipen/scripts/scrna/SeuratClusterStats-features.R +85 -403
- biopipen/scripts/scrna/SeuratClusterStats-ngenes.R +32 -17
- biopipen/scripts/scrna/SeuratClusterStats-stats.R +45 -239
- biopipen/scripts/scrna/SeuratClusterStats.R +13 -19
- biopipen/scripts/scrna/SeuratMap2Ref.R +16 -12
- biopipen/scripts/scrna/SeuratPreparing.R +138 -81
- biopipen/scripts/scrna/SlingShot.R +71 -0
- biopipen/scripts/scrna/celltypist-wrapper.py +7 -6
- biopipen/scripts/snp/Plink2GTMat.py +26 -11
- biopipen/scripts/snp/PlinkFilter.py +7 -7
- biopipen/scripts/snp/PlinkFromVcf.py +8 -5
- biopipen/scripts/snp/PlinkSimulation.py +4 -4
- biopipen/scripts/snp/PlinkUpdateName.py +4 -4
- biopipen/scripts/stats/ChowTest.R +48 -22
- biopipen/scripts/tcgamaf/Maf2Vcf.py +2 -2
- biopipen/scripts/tcgamaf/MafAddChr.py +2 -2
- biopipen/scripts/tcr/ClonalStats.R +484 -0
- biopipen/scripts/tcr/ScRepLoading.R +127 -0
- biopipen/scripts/tcr/TCRDock.py +10 -6
- biopipen/scripts/tcr/vdjtools-patch.sh +1 -1
- biopipen/scripts/vcf/BcftoolsAnnotate.py +8 -8
- biopipen/scripts/vcf/BcftoolsFilter.py +3 -3
- biopipen/scripts/vcf/BcftoolsMerge.py +31 -0
- biopipen/scripts/vcf/BcftoolsSort.py +4 -4
- biopipen/scripts/vcf/BcftoolsView.py +5 -5
- biopipen/scripts/vcf/Vcf2Bed.py +2 -2
- biopipen/scripts/vcf/VcfAnno.py +11 -11
- biopipen/scripts/vcf/VcfDownSample.sh +22 -10
- biopipen/scripts/vcf/VcfFilter.py +5 -5
- biopipen/scripts/vcf/VcfFix.py +7 -7
- biopipen/scripts/vcf/VcfFix_utils.py +12 -3
- biopipen/scripts/vcf/VcfIndex.py +3 -3
- biopipen/scripts/vcf/VcfIntersect.py +3 -3
- biopipen/scripts/vcf/VcfLiftOver.sh +5 -0
- biopipen/scripts/vcf/VcfSplitSamples.py +4 -4
- biopipen/scripts/vcf/bcftools_utils.py +3 -3
- biopipen/scripts/web/Download.py +8 -4
- biopipen/scripts/web/DownloadList.py +5 -5
- biopipen/scripts/web/GCloudStorageDownloadBucket.py +5 -5
- biopipen/scripts/web/GCloudStorageDownloadFile.py +3 -3
- biopipen/scripts/web/gcloud_common.py +1 -1
- biopipen/utils/gsea.R +75 -35
- biopipen/utils/misc.R +205 -7
- biopipen/utils/misc.py +17 -8
- biopipen/utils/reference.py +11 -11
- biopipen/utils/repr.R +146 -0
- biopipen/utils/vcf.py +1 -1
- {biopipen-0.32.3.dist-info → biopipen-0.33.1.dist-info}/METADATA +8 -8
- {biopipen-0.32.3.dist-info → biopipen-0.33.1.dist-info}/RECORD +115 -105
- {biopipen-0.32.3.dist-info → biopipen-0.33.1.dist-info}/WHEEL +1 -1
- biopipen/scripts/scrna/SeuratClusterStats-hists.R +0 -144
- biopipen/scripts/scrna/SeuratPreparing-common.R +0 -467
- biopipen/scripts/scrna/SeuratPreparing-doublet_detection.R +0 -204
- {biopipen-0.32.3.dist-info → biopipen-0.33.1.dist-info}/entry_points.txt +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
{{ biopipen_dir | joinpaths: "utils", "misc.R" | source_r }}
|
|
2
|
+
{{ biopipen_dir | joinpaths: "utils", "repr.R" | source_r }}
|
|
2
3
|
|
|
3
4
|
library(Seurat)
|
|
4
5
|
library(rlang)
|
|
@@ -8,6 +9,8 @@ library(tibble)
|
|
|
8
9
|
library(ggplot2)
|
|
9
10
|
library(ggradar)
|
|
10
11
|
library(ggprism)
|
|
12
|
+
library(glue)
|
|
13
|
+
library(gglogger)
|
|
11
14
|
|
|
12
15
|
# input/output
|
|
13
16
|
srtfile = {{in.srtobj | r}}
|
|
@@ -192,40 +195,46 @@ do_radarplot <- function(info, case, counts) {
|
|
|
192
195
|
}
|
|
193
196
|
|
|
194
197
|
# Plot
|
|
195
|
-
plotfile = file.path(info$casedir, "plot.png")
|
|
196
|
-
plotfile_pdf = file.path(info$casedir, "plot.pdf")
|
|
197
198
|
if (!is.null(case$colors) && length(case$colors) == 1 && case$colors == "biopipen") {
|
|
198
199
|
colors = pal_biopipen()(nrow(rdr_data))
|
|
199
200
|
} else if (!is.null(case$colors) && length(case$colors) > 0) {
|
|
200
201
|
colors = trimws(unlist(strsplit(case$colors, ",")))
|
|
201
202
|
}
|
|
203
|
+
|
|
204
|
+
plotdf <- rdr_data %>%
|
|
205
|
+
as.data.frame() %>%
|
|
206
|
+
rownames_to_column("group") %>%
|
|
207
|
+
mutate(group = factor(group, levels = rownames(rdr_data)))
|
|
208
|
+
|
|
202
209
|
p = ggradar(
|
|
203
|
-
|
|
204
|
-
as.data.frame() %>%
|
|
205
|
-
rownames_to_column("group") %>%
|
|
206
|
-
mutate(group = factor(group, levels = rownames(rdr_data))),
|
|
210
|
+
plotdf,
|
|
207
211
|
values.radar = paste0(breaks, "%"),
|
|
208
212
|
grid.min = breaks[1] / 100,
|
|
209
213
|
grid.mid = breaks[2] / 100,
|
|
210
214
|
grid.max = breaks[3] / 100,
|
|
211
215
|
group.colours = colors
|
|
212
216
|
)
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
217
|
+
prefix <- file.path(info$casedir, "plot")
|
|
218
|
+
save_plot(p, prefix, case$devpars)
|
|
219
|
+
|
|
220
|
+
code_file <- paste0(prefix, ".R")
|
|
221
|
+
code = glue(
|
|
222
|
+
"library(ggradar)
|
|
223
|
+
|
|
224
|
+
plotdf <- {repr(plotdf)}
|
|
225
|
+
breaks <- {repr(breaks)}
|
|
226
|
+
colors <- {repr(colors)}
|
|
227
|
+
|
|
228
|
+
ggradar(
|
|
229
|
+
plotdf,
|
|
230
|
+
values.radar = paste0(breaks, '%'),
|
|
231
|
+
grid.min = breaks[1] / 100,
|
|
232
|
+
grid.mid = breaks[2] / 100,
|
|
233
|
+
grid.max = breaks[3] / 100,
|
|
234
|
+
group.colours = colors
|
|
235
|
+
)"
|
|
218
236
|
)
|
|
219
|
-
|
|
220
|
-
dev.off()
|
|
221
|
-
|
|
222
|
-
pdf(
|
|
223
|
-
plotfile_pdf,
|
|
224
|
-
width = case$devpars$width / case$devpars$res,
|
|
225
|
-
height = case$devpars$height / case$devpars$res
|
|
226
|
-
)
|
|
227
|
-
print(p)
|
|
228
|
-
dev.off()
|
|
237
|
+
writeLines(code, code_file)
|
|
229
238
|
}
|
|
230
239
|
|
|
231
240
|
do_barplot_and_tests <- function(info, case, counts) {
|
|
@@ -275,43 +284,42 @@ do_barplot_and_tests <- function(info, case, counts) {
|
|
|
275
284
|
rowwise() %>%
|
|
276
285
|
mutate(mean_sd1 = max(.mean - .sd, 0), mean_sd2 = .mean + .sd)
|
|
277
286
|
|
|
287
|
+
if (!is.null(case$colors) && length(case$colors) == 1 && case$colors == "biopipen") {
|
|
288
|
+
colors <- pal_biopipen(.8)(length(unique(plotdata[[case$by]])))
|
|
289
|
+
} else if (!is.null(case$colors) && length(case$colors) > 0) {
|
|
290
|
+
colors <- trimws(unlist(strsplit(case$colors, ",")))
|
|
291
|
+
}
|
|
292
|
+
|
|
278
293
|
# Plot the barplot
|
|
279
|
-
plotfile = file.path(info$casedir, "barplot.png")
|
|
280
|
-
plotfile_pdf = file.path(info$casedir, "barplot.pdf")
|
|
281
294
|
p = ggplot(plotdata, aes(x = !!sym(case$ident), y = .mean, fill = !!sym(case$by))) +
|
|
282
|
-
geom_bar(stat = "identity", position = "dodge") +
|
|
295
|
+
geom_bar(stat = "identity", position = "dodge", color = "#333333") +
|
|
283
296
|
geom_errorbar(
|
|
284
297
|
aes(ymin = mean_sd1, ymax = mean_sd2),
|
|
285
|
-
width = 0.
|
|
286
|
-
|
|
298
|
+
width = 0.2,
|
|
299
|
+
alpha = 0.5,
|
|
300
|
+
linewidth = 0.6,
|
|
287
301
|
position = position_dodge(0.9),
|
|
288
302
|
color = "#333333"
|
|
289
303
|
) +
|
|
290
|
-
theme_prism(axis_text_angle =
|
|
291
|
-
ylab("Fraction of cells")
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
plotfile_pdf,
|
|
310
|
-
width = case$bar_devpars$width / case$bar_devpars$res,
|
|
311
|
-
height = case$bar_devpars$height / case$bar_devpars$res
|
|
312
|
-
)
|
|
313
|
-
print(p)
|
|
314
|
-
dev.off()
|
|
304
|
+
theme_prism(axis_text_angle = 45) +
|
|
305
|
+
ylab("Fraction of cells") +
|
|
306
|
+
scale_fill_manual(values = colors)
|
|
307
|
+
|
|
308
|
+
prefix = file.path(info$casedir, "barplot")
|
|
309
|
+
save_plot(p, prefix, case$bar_devpars)
|
|
310
|
+
neat_case <- list(by = case$by, ident = case$ident)
|
|
311
|
+
save_plotcode(
|
|
312
|
+
p,
|
|
313
|
+
setup = c(
|
|
314
|
+
'library(rlang)',
|
|
315
|
+
'library(ggplot2)',
|
|
316
|
+
'library(ggprism)',
|
|
317
|
+
'',
|
|
318
|
+
'load("data.RData")',
|
|
319
|
+
'case <- neat_case'
|
|
320
|
+
),
|
|
321
|
+
prefix,
|
|
322
|
+
"plotdata", "neat_case", "colors")
|
|
315
323
|
|
|
316
324
|
# Do the tests in each cluster between groups on .frac
|
|
317
325
|
bys <- bardata %>% pull(!!sym(case$by)) %>% unique()
|
|
@@ -367,7 +375,12 @@ add_case_report = function(info, breakdown, test) {
|
|
|
367
375
|
list(
|
|
368
376
|
kind = "image",
|
|
369
377
|
src = file.path(info$casedir, "plot.png"),
|
|
370
|
-
download =
|
|
378
|
+
download = list(
|
|
379
|
+
file.path(info$casedir, "plot.pdf"),
|
|
380
|
+
list(
|
|
381
|
+
src = file.path(info$casedir, "plot.R"),
|
|
382
|
+
tip = "Download the code used to reproduce the plot",
|
|
383
|
+
icon = "Code"))
|
|
371
384
|
)
|
|
372
385
|
)
|
|
373
386
|
),
|
|
@@ -401,7 +414,14 @@ add_case_report = function(info, breakdown, test) {
|
|
|
401
414
|
list(
|
|
402
415
|
kind = "image",
|
|
403
416
|
src = file.path(info$casedir, "barplot.png"),
|
|
404
|
-
download =
|
|
417
|
+
download = list(
|
|
418
|
+
file.path(info$casedir, "barplot.pdf"),
|
|
419
|
+
list(
|
|
420
|
+
src = file.path(info$casedir, "barplot.code.zip"),
|
|
421
|
+
tip = "Download the code used to reproduce the plot",
|
|
422
|
+
icon = "Code"
|
|
423
|
+
)
|
|
424
|
+
)
|
|
405
425
|
)
|
|
406
426
|
)
|
|
407
427
|
))
|