kordastilab / ImmunoCluster

MIT License
27 stars 7 forks source link

Creating sce #3

Closed scualo1 closed 2 years ago

scualo1 commented 2 years ago

Hi,

I was trying to run your script. While trying to create the sce object with the following code

require(SingleCellExperiment) sce_PMN = processFCS( files = filelist, metadata = metadata, filter = FALSE, transformation = TRUE, transFun = function (x) asinh(x), downsampleVar = NULL, downsample = NULL, downsample_grouping = NULL, newColnames = col_names, colsDiscard = colsDiscard)

I got the following error:

Error in dimnames(x) <- dn : length of 'dimnames' [2] not equal to array extent

I am analyzing only two .fcs file, each one in a different condition. The metadata looks correct.

I also got the following warning: Warning in readFCSdata(con, offsets, txt, transformation, which.lines, scale, : Some data values of 'Sm147Di' channel exceed its $PnR value 12000 and will be truncated! To avoid truncation, either fix $PnR before generating FCS or set 'truncate_max_range = FALSE'

but there is no option to set truncate_max_range = FALSE on the function.

Thank you in advance for your help!

JamesOpz commented 2 years ago

Hi,

Thanks for getting in touch! Something similar to this error often occurs because the newColnames vector to rename your FCS channel parameters is not the same length as the resulting parameters that remain after the colsDiscard vector (of parameters to remove) is first applied to the origninal FCS parameters. I think the best approach to fix this is to check your original FCS parameter names against the newColnames and colsDiscard to see if they line up.

If you post the those three vectors I can try and replicate the error and see if that is the problem.

Best, James

scualo1 commented 2 years ago

Thank you, it was an issue with the names of the parameter as you suggested!

I manage to fix it.

Thank you again for your support

scualo1 commented 2 years ago

Hi James,

Thank you very much for your help, I should have checked the parameters name before.

I have another question related to Immunocluster:

How can I split the density UMAP (or any other UMAP) by condition? In CyTOF Workflow you can specify split_by = “condition”

Thank you in advance!

Tommaso

From: James Opzoomer @.> Date: Wednesday, 22 September 2021 at 19:32 To: kordastilab/ImmunoCluster @.> Cc: Tommaso Croese @.>, Author @.> Subject: Re: [kordastilab/ImmunoCluster] Creating sce (#3)

Hi,

Thanks for getting in touch! Something similar to this error often occurs because the newColnames vector to rename your FCS channel parameters is not the same length as the resulting parameters that remain after the colsDiscard vector (of parameters to remove) is first applied to the origninal FCS parameters. I think the best approach is fix this is to check your original FCS parameter names, against the newColnames and colsDiscard to see if they line up.

If you post the those three vectors I can try and replicate the error and see if that is the problem.

Best, James

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/kordastilab/ImmunoCluster/issues/3#issuecomment-925092386, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AVKCDF7CCOTTBPXA36JCNR3UDIAHBANCNFSM5EKIPKDQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

JamesOpz commented 2 years ago

Hi Tommaso,

There are two ways to split the UMAP, one way is to subset the SCE object based on the metadata values with the function subset_sce_metadata() (the usage is outlined at the very bottom of the README) and then visualize with the density_plot() function or another visualization function.

Otherwise, UMAPs visualized with the function metadataPlot(sce, colby = 'condition') can be split by adding the ggplot syntax "my_plot + facet_wrap(~condition)".

I am going to close this issue as the original problem has been resolved. If you have anymore questions, feel free to open another thread!

Best, James