saeyslab / CytoNorm

R library to normalize cytometry data
33 stars 6 forks source link

CytoNorm for fluorescent flowdata #3

Closed DomenicoSkyWalker89 closed 4 years ago

DomenicoSkyWalker89 commented 4 years ago

Hi, thanks for this great tool. I'm trying to use CytoNorm with my fluorescent flowdata as you explain in you paper (using CYTOF data) but after the normalizzation of my control (to validate the training model) i saw that all the events for each channel are on the chart edges. I changed the cofactor to understand if the problem was related with this step but the result was the same. Below there are the code that i used to change the cofactor and the CV of my analysis.

if you had any suggestions for solving problems I would be grateful?

best regards, Domenico

transformList <- flowCore::transformList(channels,list(arcsinhTransform(a = 0, b = 1/300, c = 0), arcsinhTransform(a = 0, b = 1/600, c = 0))

transformList.reverse <- flowCore::transformList(channels,list(function(x){ return(sinh(x)/(1/300)) },function(x){ return(sinh(x)/(1/600)) })) Rplot04

SofieVG commented 4 years ago

Dear Domenico,

Your code looks good to me, so I'm not sure if the issue is caused by the transformation. To make sure, would you be able to test the following? Transform the data, save them to some temporary folder, and take the already transformed data as input for CytoNorm (setting transformList and transformList.reversed to NULL). The data that comes out afterwards will be still transformed, so either look at it in R, or when opening it in another tool, make sure the axis is linear and the appropriate range. If this still has the data on a chart edge, I guess the issue comes from somewhere else. In that case, could you give some more details (e.g. how you call the CytoNorm algorithm) to figure out what could be the problem?

Kind regards, Sofie

On Wed, 27 Nov 2019 at 20:02, DomenicoSkyWalker89 notifications@github.com wrote:

Hi, thanks for this great tool. I'm trying to use CytoNorm with my fluorescent flowdata as you explain in you paper (using CYTOF data) but after the normalizzation of my control (to validate the training model) i saw that all the events for each channel are on the chart edges. I changed the cofactor to understand if the problem was related with this step but the result was the same. Below there are the code that i used to change the cofactor and the CV of my analysis.

if you had any suggestions for solving problems I would be grateful?

best regards, Domenico

transformList <- flowCore::transformList(channels,list(arcsinhTransform(a = 0, b = 1/300, c = 0), arcsinhTransform(a = 0, b = 1/600, c = 0))

transformList.reverse <- flowCore::transformList(channels,list(function(x){ return(sinh(x)/(1/300)) },function(x){ return(sinh(x)/(1/600)) })) [image: Rplot04] https://user-images.githubusercontent.com/53559811/69752017-9ac6d800-1150-11ea-88a8-b0143dfb64f6.jpeg

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/saeyslab/CytoNorm/issues/3?email_source=notifications&email_token=AAOS724AEUKSLUQBLDGAFXLQV275FA5CNFSM4JSLBNQ2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H4P5A4Q, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOS725YC5PY7LB7PBBSGPLQV275FANCNFSM4JSLBNQQ .

DomenicoSkyWalker89 commented 4 years ago

Hi Sofie, thanks for your fast support. i have done what you suggest and the output files looks good. The events weren't on the chart edge (setting transformList and transformList.reversed to NULL). image

But if i ran CytoNORM using transformList and transformList.reversed like in the script this was the result. image

kind regards, Domenico

SofieVG commented 4 years ago

Huh, strange... I still think your transformation lists look correct.

I have two questions to investigate further:

On Mon, 2 Dec 2019 at 19:37, DomenicoSkyWalker89 notifications@github.com wrote:

Hi Sofie, thanks for your fast support. i have done what you suggest and the output files looks good. The events weren't on the chart edge (setting transformList and transformList.reversed to NULL). [image: image] https://user-images.githubusercontent.com/53559811/69984476-7d6f8080-1539-11ea-96e0-e69fa3372252.png

But if i ran CytoNORM using transformList and transformList.reversed like in the script this was the result. [image: image] https://user-images.githubusercontent.com/53559811/69985055-cc69e580-153a-11ea-837d-c20e096a2a97.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/saeyslab/CytoNorm/issues/3?email_source=notifications&email_token=AAOS724EEZHAZGHYZG2V5EDQWVIWXA5CNFSM4JSLBNQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFUOXTI#issuecomment-560524237, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOS726VGICMZLDS4LHLI3DQWVIWXANCNFSM4JSLBNQQ .

DomenicoSkyWalker89 commented 4 years ago

Hi Sofie, thanks a lot. I tried again what you suggested (transformed upfront, wrote those files to your hard drive, run CytoNorm on them setting transformList and transformList.reversed to NULL, and then took those output files to visualize in flowjo) changing the cofactor (according to what i saw in cytobank) and now the results are good. Probably i've missed somethings before.

After that i have done the normalizzation using the script, setting correctly the transformList and transformList.reversed, and the result this time seems to be perfect as i expected (plot below). Now i would try this on all my sample, hoping that all is well. Do you think the difference in scale BEFORE and AFTER (both arcsin) is fine?

image

kind regards, Domenico

SofieVG commented 4 years ago

Dear Domenico,

I'm a bit surprised the scale is so different. This is both with the axis labels showing the original values, correct? Can you check the range of the values after transformation, before and after CytoNorm, to see if those are so different as well?

Kind regards, Sofie

On Fri, 6 Dec 2019 at 15:35, DomenicoSkyWalker89 notifications@github.com wrote:

Hi Sofie, thanks a lot. I tried again what you suggested (transformed upfront, wrote those files to your hard drive, run CytoNorm on them setting transformList and transformList.reversed to NULL, and then took those output files to visualize in flowjo) changing the cofactor (according to what i saw in cytobank) and now the results are good. Probably i've missed somethings before.

After that i have done the normalizzation using the script, setting correctly the transformList and transformList.reversed, and the result this time seems to be perfect as i expected (plot below). Now i would try this on all my sample, hoping that all is well. Do you think the difference in scale BEFORE and AFTER (both arcsin) is fine?

[image: image] https://user-images.githubusercontent.com/53559811/70330362-b5c6d580-183d-11ea-821f-5f2f653dad74.png

kind regards, Domenico

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/saeyslab/CytoNorm/issues/3?email_source=notifications&email_token=AAOS7224GSWQ2UIBCOY2IZLQXJPKZA5CNFSM4JSLBNQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGEIG4A#issuecomment-562594672, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOS727K4XXKHZTXUCZU7X3QXJPKZANCNFSM4JSLBNQQ .