ebecht / infinityFlow

25 stars 8 forks source link

Do I need to transform the output FCS files before clustering downstream of infinity_flow()? #17

Closed denvercal1234GitHub closed 1 year ago

denvercal1234GitHub commented 1 year ago

Hi there,

Thank you again for the package.

I inputed the FCS files exported from FlowJo after gating on live single CD4+CD19-CD3+ T cells.

QUESTION 1. I then specified "backbone" markers and "discard" markers in which I specified CD4, CD19, CD3 as "backbone". Should I do this if I already gated on CD4, CD19, and CD3?

QUESTION 2. The infinity_flow() function return FCS files with imputed expressions. Would you mind letting me know whether these output FCS files are already transformed? Or, will I need to transform them again (e.g., with arcsinh transformation etc) before doing downstream clustering?

Thank you.

ebecht commented 1 year ago

Hi.

1) I think it does not hurt to leave them in although pregating was performed on these channels, there may contain some residual information

2) These files are re-transformed before output so they are on the same scale as the raw data. Note that this is not true for backbone-corrected files. Since backbone correction use linear models, it is not straightforward to transform these expression values back to a native scale.

denvercal1234GitHub commented 1 year ago

Thanks @ebecht for your response.

My goal is to know whether I need to perform transformation, e.g., archsinh transformation to these imputed FCS files (either to the raw or to the background-corrected ones) before clustering.

Q2a. Just so I understand it correctly, the imputed output FCS files are transformed back to linear scale. So, I will need to still perform transformation, e.g., arsinh transformation, in the downstream clustering analysis using these FCS files if such a transformation is part of the downstream clustering pipeline?

Q2b. When you said "raw" and "backbone-corrected", did you meant the "raw" output FCS and the "background-corrected" output FCS files?

ebecht commented 1 year ago

Q2a yes you will need to transform the data if you are using the non-corrected (raw) data

Q2b Sorry for the confusion. I meant the raw output is on the same scale as the input.

denvercal1234GitHub commented 1 year ago

Thank you @ebecht! Would you mind confirming what I say below are correct then? Thanks again so much.

Q2a. In the output folders, ...InfinityFlow/TRIAL_21FCS/output/FCS/split contains the non-corrected (raw) data and so I will need to transform these output FCS.

Q2b. In the ...InfinityFlow/TRIAL_21FCS/output/FCS_background_corrected/split contains the backbone-corrected files right? These files do not need to get transformed.

ebecht commented 1 year ago

Yes that is correct

denvercal1234GitHub commented 1 year ago

Hi @ebecht - my apologies but I have a follow up question regarding the output FCS files.

We mentioned the output FCS files in output/FCS/split are not transformed and therefore to do clustering downstream with these FCS files, I will need to transform them, e.g., with arsinh transformation.

But, when I open the output FCS files both in output/FCS/split and in output/FCS_background_corrected/split using FlowJo, I saw they are already log-transformed? (below) Is this simply because when we import the output FCS into FlowJo, FlowJo automatically transform them?

Thank you for your help!

Screenshot 2023-03-23 at 10 54 10
ebecht commented 1 year ago

It's not that the data is transformed, it's because FlowJo uses a log-transformation for plotting.