SKILL.md
Version Compatibility
Reference examples tested with: flowCore 2.14+, scanpy 1.10+
Before using code patterns, verify installed versions match. If versions differ:
- R:
packageVersion('<pkg>')then?function_nameto verify parameters
If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
FCS File Handling
"Load my FCS files into R or Python" → Read Flow Cytometry Standard (FCS) files, access channel parameters and metadata, and explore event data for downstream analysis.
- R:
flowCore::read.FCS()orflowCore::read.flowSet()for multiple files - Python:
fcsparser.parse()orFlowCal.io.FCSData()
Load FCS Files
Goal: Read a single FCS file and inspect its parameters and metadata.
Approach: Use flowCore's read.FCS with transformation disabled to load raw data, then examine parameter names and descriptions.
library(flowCore)
# Read single FCS file
fcs <- read.FCS('sample.fcs', transformation = FALSE, truncate_max_range = FALSE)
# File info
print(fcs)
# Parameter names
colnames(fcs) # Short names
pData(parameters(fcs)) # Full metadata including descriptions
Load Multiple Files
Goal: Read a batch of FCS files into a single flowSet container for uniform processing.
Approach: List FCS files from a directory and load them into a flowSet with read.flowSet.
# Read multiple files into flowSet
files <- list.files('data', pattern = '\\.fcs$', full.names = TRUE)
fs <- read.flowSet(files, transformation = FALSE, truncate_max_range = FALSE)
# Sample names
sampleNames(fs)
# Access individual samples
fcs1 <- fs[[1]]
