-
Notifications
You must be signed in to change notification settings - Fork 0
/
flowcal_html_output.qmd
63 lines (46 loc) · 1.92 KB
/
flowcal_html_output.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
title: title_name
author: "Prashant Kalvapalle's script"
date: today
format:
html:
theme: default # there's not point doing flatly. Only 1 section
embed-resources: true
output-file: 'FACS_analysis/html_outputs/title_name.html' # call-override
echo: false
editor: visual
# knitr: # not knitting directly ; using quarto_render() now
# opts_knit:
# root.dir: 'C:/Users/new/Box Sync/Stadler lab/Data/Flow cytometry (FACS)'
---
<!--# TODO : make title a variable from R, set flatly theme with table of content ; figure out how to call the render with an output name set -->
```{r setup, include = FALSE}
# knitr::opts_knit$set(root.dir = normalizePath('..')) # set path to the project head (if this qmd lies within a subfolder)
# reticulate options
# Using the python from the conda env so flowcal functions are loaded!
Sys.setenv(RETICULATE_PYTHON = 'C:/Users/new/.conda/envs/flowcal/python.exe')
library(reticulate) # needed to connect python to Rstudio
```
```{r get-directory-name}
config <- import('scripts_general_fns.g10_user_config')
# reload user config
importlib <- import("importlib")
importlib$reload(config)
title_name <- config$fcs_experiment_folder
```
# `r title_name` : data folder
## flowcytometry cleanup steps
Clean \`.fcs\` data by excluding saturated events, retaining singlets and events among densest region to exclude debris
```{python check-working-dir}
# import os
# # os.chdir("..") ; os.getcwd() # changing working dir;try global defaults
# os.getcwd()
```
```{python}
#| echo: false
from analyze_fcs_flowcal import process_fcs_dir # function for complete processing
from scripts_general_fns.g10_user_config import make_processing_plots # Import plotting key
process_fcs_dir(make_processing_plots) # Run the pipeline
# reading .fcs data, beads processing, cleanup and calibration, saving summary statistics and cleaned files
# TODO : test output file destination, css formatting. title_name as var
```