-
Notifications
You must be signed in to change notification settings - Fork 0
/
04c-refGMM-labeling.Rmd
41 lines (36 loc) · 1.06 KB
/
04c-refGMM-labeling.Rmd
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
---
title: "Creating annotated FCS files"
author:
- name: T.R. Mocking
output:
BiocStyle::html_document
vignette: |
%\VignetteIndexEntry{Vignette Title}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r}
RBM18_path <- "<ENTER PATH>"
RBM18_FCS_path <- "<ENTER PATH>"
RBM18_GMMref_label_path <- "<ENTER PATH>"
RBM18_annotated_path <- "<ENTER PATH>"
```
# RBM18
```{r}
df <- read.csv(paste0(RBM18_path, "sample_info.csv"))
for (sample_id in df$RBM18_ID){
print(sample_id)
ff <- flowCore::read.FCS(paste0(RBM18_FCS_path, sample_id, ".fcs"), truncate_max_range = FALSE)
labels <- read.csv(paste0(RBM18_GMMref_label_path, sample_id, ".csv"))
ff@exprs <- ff@exprs[ff@exprs[, "event_ID"] %in% labels$event_ID, ]
for (colname in c("Blast", "GMMclf", "GMMref_manual_component", "GMMref_GMMclf_component")){
col <- as.matrix(labels[, colname])
colnames(col) <- colname
ff <- flowCore::fr_append_cols(ff, col)
}
flowCore::write.FCS(ff, paste0(RBM18_annotated_path, sample_id, ".fcs"))
}
```
```{r sessionInfo, echo=FALSE}
sessionInfo()
```