流式细胞术数据的稳态分析.docx
本小插图将指导你分析来自实验的流式细胞术数据集示例,该实验检查芽殖酵母液体培养 物中合成生物回路的荧光报告基因水平。在这里,我们分析了一个电路,其中荧光报告基 因与蛋白质融合,在添加诱导分子后,该蛋白质会随着时间的推移而降解。在诱导后的某 个时间(由实验者优化),通过流式细胞术分析这些培养物的荧光。在这里,我们演示如 何将生成的.fcs文件导入到R中,使用实验元数据(例如每个样本的strain和 treatment)注释该数据,并编译相关事件和测量结果。#导入和注释数据使用 导入流式细胞术数据read.flowset。在这里,我们将导入一个示例 flowSetoplatel <- read.flowSet(path = system.file("extdata""ss_example"4package = "flowTime"),alter.names = TRUE)# add pLate numbers to the sampLeNamessampleNames(platel) <- paste("1_"sampleNames(platelsep ="") dat <- platel如果你有多个板,则可以重复此代码,并且可以组合每个板以组装完整的数据集。plate2 <- read.flowSet(path = paste(experimentsep = alter.names = TRUE)sampleNames(plate2) <- paste("2_"sampleNames(plate2)sep ="")dat <- rbind2(platelJplate2)对于本不例,我们将导入兀数据表。sampleNames组装的(flowSet在dat本不例中)的 必 须与 的唯一标识符列的 相匹配annotation。annotation <- read.csv(system.file("extdata"., "ss_example.csv", package = "flowTime") head(annotation)#>X name AFB IAA treatment repL#> 1 l_A01.fcs l_A01.fcs TIR1 IAA10.001#> 2 l_A02.fcs l_A02.fcs TIR1 IAA170.001#> 3 l_A03.fcs l_A03.fcs AFB2 IAA10.001#> 4 l_A04.fcs l_A04.fcs AFB2 IAA170.001#> 5 l_B01.fcs l_B01.fcs TIR1 IAA10.051#> 6 l_B02.fcs l_B02.fcs TIR1 IAA170.051sampleNames(dat)#>#>#>#>#>#>1 13 19 25 31"l_A01.fcs""l_B03.fcs""l_D01.fcs""l_E03.fcsn"l_G01.fcs""l_H03.fcsn,'l_A02.fcsn "l_B04.fcs " "l_D02.fcs " "l_E04.fcsn "l_G02.fcs" "l_H04.fcsn,l_A03.fcs""l_C01.fcs""l_D03.fcs ",l_F01.fcsnul_G03.fcs11nl_A04.fcs" "l_C02.fcs " "l_D04.fcs" nl_F02.fcsn nl_G04.fcs"nl_B01.fcsn"l_C03.fcs""l_E01.fcs",l_F03.fcsu"l_H01.fcs""l_B02.fcs' ul_C04.fcs' "l_E02.fcs nl_F04.fcs "l_H02.fcssampleNames(dat)=annotation$nameTRUE TRUE TRUE# > 1 TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE# > 16 TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE# > 31 TRUE TRUE我们还可以从我们的数据集创建此列并附加注释列。或者,可以使用该createAnnotation 函数创建一个具有适当列的数据框,name然后可以通过R代码填充该数据框,或另存为 CSV文件并通过电子表格编辑器填充。中的条目顺序annotation并不重要,只要能够 sampleNames(dat)表不 中的每个条目即可。该annotateFlowSet函数将按mergeBy列匹配条 目annotation <- cbind(annotationname = sampleNames(dat)# orannotation <- createAnnotation(yourFlowSet = dat)write.csv(annotationfile = "path/to/yourAnnotation.csv")最后,我们可以使用该函数将此元数据附加到flowset annotateFlowSetoadat <- annotateFlowSet(yourFlowSet = dat, annotation_df = annotation, mergeBy = name )head(rownames(pData(adat)# > 1 "l_A01.fcs" "l_A02.fcs" nl_A03.fcs" "l_A04.fcs" nl_B01.fcs" ,l_B02.fcs" head(pData(adat)#>nameX AFBIAA treatment repL#> l_A01.fcsl_A01.fcsl_A01.fcs TIR1IAA10.001#> l_A02.fcsl_A02.fcsl_A02.fcs TIR1IAA170.001#> l_A03.fcsl_A03.fcsl_A03.fcs AFB2IAA10.001#> l_A04.fcsl_A04.fcsl_A04.fcs AFB2IAA170.001#> l_B01.fcsl_B01.fcsl_B01.fcs TIR1IAA10.051#> l_B02.fcsl_B02.fcsl_B02.fcs TIR1IAA170.051现在我们可以保存这个flowSet,任何人都可以轻松力口载和分析这个带注释的flowSet!write.flowSet(adat?outdir = "your/favorite/directory")# Read the fLowSet with the saved experimentaL meta dataread.flowSet("flowSet folder”,path = "your/flow/directory", phenoData = "annotation.txt",alter.names = TRUE)#编译和绘制数据现在我们准备分析此中的原始数据flowSet。首先,我们加载将用于对数 据进行子集化的门集。为了分析这个稳态或单时间点实验,我们将使用该steadyState函 数。该函数将对每个事件进行门控,并编译并返回flowFrame每个事件的相关数据和元数 据。然后可以使用它来可视化完整的数据集。flowSetdataframedataframeloadGates() # use the defauLt incLuded gateSetdat.SS <- steadyState(flowset = adat, ploidy = "diploid”,only = "singlets")# > 1 "Gating with dipLoid singLet gates."# > 1 "Converting events."p <- ggplot(dat.SS aes(x = as.factor(treatment)y = FL2A, fill = AFB) + geom_boxplot(outlier.shape = NA) +facet_grid(IAA AFB) + theme_classic(base_family = "Arial"base_size = 16) + ylim(c(-1000, 10000) + xlab(expression(paste("Auxin (二 mu,sep = "") +ylab("Fluorescence (AU)") + theme(legend.position = "none")P#> Earning: Removed 85 rois containing non-finite vaLues ('stat_boxpLot()').