A QC tool for openCyto

cytoqc – qc for keywords

library(flowCore)
library(flowWorkspace)
# library(cytoqc)
devtools::load_all("../")

Load the FCS

## cytoqc data: 
## 35  samples

Group by keywords

group_id nFCS keyword
6 14 Acquisition Doc., Analysis Doc., CalibFile, CASE NUMBER, CYTNUM, Data File Prefix Part #1, Data File Prefix Part #2, Data File Prefix Part #3, Day, FILENAME, GUID, Instr. Sett. File, Mixing Vol, Number of Mixes, Number of Washes, NUMBER WELL INFO KEYWORDS, Patient ID, Sample ID, SAMPLE ID, Sample Vol, TIMETICKS, transformation
2 11 Acquisition Doc., Analysis Doc., CalibFile, CASE NUMBER, CYTNUM, Data File Prefix Part #1, Data File Prefix Part #2, Data File Prefix Part #3, Day, END BATCH, FILENAME, GUID, Instr. Sett. File, Mixing Vol, Number of Mixes, Number of Washes, NUMBER WELL INFO KEYWORDS, PANEL NAME, Patient ID, Sample ID, SAMPLE ID, Sample Vol, START BATCH, TIMETICKS, transformation
4 7 Acquisition Doc., Analysis Doc., CalibFile, CASE NUMBER, CYTNUM, Data File Prefix Part #1, Data File Prefix Part #2, Data File Prefix Part #3, Day, END BATCH, FILENAME, GUID, Instr. Sett. File, Mixing Vol, Number of Mixes, Number of Washes, NUMBER WELL INFO KEYWORDS, PANEL NAME, pt name, Sample ID, SAMPLE ID, Sample Vol, START BATCH, TIMETICKS, transformation
1 1 Acquisition Doc., Analysis Doc., CalibFile, CASE NUMBER, CYTNUM, Data File Prefix Part #1, Data File Prefix Part #2, Data File Prefix Part #3, Day, END BATCH, FILENAME, GUID, Instr. Sett. File, Mixing Vol, new_kw, Number of Mixes, Number of Washes, NUMBER WELL INFO KEYWORDS, PANEL NAME, patient id, Sample ID, SAMPLE ID, Sample Vol, START BATCH, TIMETICKS, transformation
3 1 Acquisition Doc., Analysis Doc., CalibFile, CASE NUMBER, CYTNUM, Data File Prefix Part #1, Data File Prefix Part #2, Data File Prefix Part #3, Day, END BATCH, FILENAME, GUID, Instr. Sett. File, Mixing Vol, Number of Mixes, Number of Washes, NUMBER WELL INFO KEYWORDS, PANEL NAME, PatientId, Sample ID, SAMPLE ID, Sample Vol, START BATCH, TIMETICKS, transformation
5 1 Acquisition Doc., Analysis Doc., CalibFile, CASE NUMBER, CYTNUM, Data File Prefix Part #1, Data File Prefix Part #2, Data File Prefix Part #3, Day, END BATCH, FILENAME, GUID, Instr. Sett. File, Mixing Vol, Number of Mixes, Number of Washes, NUMBER WELL INFO KEYWORDS, PANEL NAME, Sample ID, SAMPLE ID, Sample Vol, START BATCH, TIMETICKS, transformation

Match against reference and report the discrepancy

group_id Not in reference Missing channels
1 new_kw,patient id Patient ID
3 PatientId Patient ID
4 pt name Patient ID
5 Patient ID

Recommend the fix for the selected groups

Proposed change
patient id –> Patient ID
new_kw
PatientId –> Patient ID

Apply the fix

Drop the group that has missing keyword

Inspect the content of the two keywords that are likely to be semantically the same

## [[1]]
## [1] "#10 MS 240816"
## 
## [[2]]
## [1] "#9 FP 242399"
## [[1]]
## [1] "BJ#230500"

Consolidate the two keywords if they are considered to be the same

Refresh QC report

group_id nFCS keyword
1 20 Acquisition Doc., Analysis Doc., CalibFile, CASE NUMBER, CYTNUM, Data File Prefix Part #1, Data File Prefix Part #2, Data File Prefix Part #3, Day, END BATCH, FILENAME, GUID, Instr. Sett. File, Mixing Vol, Number of Mixes, Number of Washes, NUMBER WELL INFO KEYWORDS, PANEL NAME, Patient ID, Sample ID, SAMPLE ID, Sample Vol, START BATCH, TIMETICKS, transformation
2 14 Acquisition Doc., Analysis Doc., CalibFile, CASE NUMBER, CYTNUM, Data File Prefix Part #1, Data File Prefix Part #2, Data File Prefix Part #3, Day, FILENAME, GUID, Instr. Sett. File, Mixing Vol, Number of Mixes, Number of Washes, NUMBER WELL INFO KEYWORDS, Patient ID, Sample ID, SAMPLE ID, Sample Vol, TIMETICKS, transformation

Check the difference

group_id Not in reference Missing channels
1 END BATCH,PANEL NAME,START BATCH

split into two groups if they can’t be merged

## $`1`
## cytoqc data: 
## 20  samples 
## 
## $`2`
## cytoqc data: 
## 14  samples

or drop these keywords if they are not critical

Proposed change
END BATCH
PANEL NAME
START BATCH
group_id nFCS keyword
1 34 Acquisition Doc., Analysis Doc., CalibFile, CASE NUMBER, CYTNUM, Data File Prefix Part #1, Data File Prefix Part #2, Data File Prefix Part #3, Day, FILENAME, GUID, Instr. Sett. File, Mixing Vol, Number of Mixes, Number of Washes, NUMBER WELL INFO KEYWORDS, Patient ID, Sample ID, SAMPLE ID, Sample Vol, TIMETICKS, transformation