RGLab / cytoUtils

Helper tools for cytometry
2 stars 1 forks source link

automatic /semi-automatic amendment on channel names or individual compensation. #2

Closed joe-jhou2 closed 6 years ago

joe-jhou2 commented 6 years ago

Hi guys, I've experienced to process my longitudinal messy data on FlowJo. That's nightmare. I'm switching to openCyto. I'd like to input some suggestion on the potential features, which will be very beneficial for people if it can be implemented in Opencyto. For longitudinal data, when we generated the data at each time point, the setting of machine maybe slightly different.

  1. The compensation definitely won't be identical in the first sample and the last one, if the study will last several years. So, the feature that individually compensated each sample based on it own compensation matrix will help data accuracy.
  2. Actually, for some fluorochromes, they may have pretty similar/identical spectrum. In the flowjo, if one sample comes with AF488, the others is FITC, and we create the template based on AF488 and apply the template to all sample, then the samples with FITC channel cannot be plotted. Because flowjo considers they're two colors. But reality is, in practice, sometimes, when we setup machine, maybe we put AF488 in the channel instead of FITC (maybe for convenience or negligence et al, in our mind, the AF488 and FITC are almost the same). That brings the trouble when we look at the data. If Opencyto has this feature like automatically or semi-automatically check all samples' channel prior to heading to subsequent analysis, and make the consistency of the channels cross over all sample, that will be great helpful for handing "messy" data.

Thanks, Joe

mikejiang commented 6 years ago

sample-wise compensation is already supported see https://github.com/RGLab/flowWorkspace/issues/207

mikejiang commented 6 years ago

The discrepancy of channel names you described seems to be arbitrary and not sure if there is automated way to handle it. To manually modify channels, use colnames<- replacement method

chnls <- colnames(fr)
idx <- match("AF488", chnls)
chnls[idx] <- "FITC"
colnames(fr) <- chnls

here fr could be the individual flowFrame generated by read.FCS or the flowSet/ncdfFlowSet read by read.flowSet/read.ncdfFlowSet

joe-jhou2 commented 6 years ago

I mean, that's not arbitrary. Please refer to spreadsheet I sent you via email. In flow cytometery, one channel may accommodate several fluorochromes with similar/identical spectrum. In an initial machine setting, may not all fluorochrome options are in the list. For example, APC and AF647 in the same channel, some machines may only have APC, some have AF647, if pool all fcs data from different machines, those channel need to be consistent. Otherwise, the automatic gating won't work at all.

joe-jhou2 commented 6 years ago

See the table.

On 20 March 2018 at 14:23, Mike Jiang notifications@github.com wrote:

The discrepancy of channel names you described seems to be arbitrary and not sure if there is automated way to handle it. To manually modify channels, use colnames<- replacement method

chnls <- colnames(fr)idx <- match("AF488", chnls)chnls[idx] <- "FITC" colnames(fr) <- chnls

here fr could be the individual flowFrame generated by read.FCS or the flowSet/ncdfFlowSet read by read.flowSet/read.ncdfFlowSet

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/RGLab/cytoUtils/issues/2#issuecomment-374761526, or mute the thread https://github.com/notifications/unsubscribe-auth/AEp8A4XH5dx9-R_cBZJ8x86TGJobX5-pks5tgXM1gaJpZM4SyhVf .

gfinak commented 6 years ago

@mimisikai The immediate solution to this is to batch your data for compensation, gating, and rename your channels consistently for merging. @mikejiang We could think about introducing channel "aliases", perhaps as a separate input file, that maps multiple channels to one "alias" which is used in the template. It's not a trivial change, but we know messy data is just the name of the game here, and if it arises sufficiently frequently, indeed as part of the experimental design when people use different instruments, then it would be a useful feature.

mikejiang commented 6 years ago

close by RGLab/flowCore/issues/103