Page 2 of 2

Re: Problems with Cytof workflow (Nowicka et al)

PostPosted: Wed Oct 07, 2020 10:25 am
by PaulineM
Hello cytof community !



I am a non-bioinformatician cytof user and I’ve just started to use workflow (Nowicka et al) which is extremely helpful. Thanks a lot for this nice work !!

I use this thread because I’d like to go further what is discribed in this workflow but I did not actualy experience a problem with it.



I would like to export fcs files having the UMAP and tsne chanels after running this workflow. 
First I’ve tried to create a flowFrame using the CATALYST fonction sce2fcs, but I was unsuccessful.
newfs<- sce2fcs(sce, split_by = NULL, keep_cd = FALSE, keep_dr = FALSE, assay = " exprs")
I’ve tried different “assay” terms because I am not sure about what it represents.

Does anyone know how to use this sce2fcs function in the context of the workflow (Nowicka et al) ?

I
I thank you in advance
Pauline

Re: Problems with Cytof workflow (Nowicka et al)

PostPosted: Wed Oct 07, 2020 11:10 am
by jimbomahoney
Which version of the workflow are you using?

I was caught out a few times because the version changes, hence the code changes too.

e.g. an old workflow may no longer work because packages have changed.

I believe this is the latest:

https://f1000research.com/articles/6-748

I can't see any reference to
  Code:
sce2fcs
in it.

Re: Problems with Cytof workflow (Nowicka et al)

PostPosted: Wed Oct 07, 2020 11:15 am
by jimbomahoney
Ah, OK I see what you are trying to do.

https://rdrr.io/bioc/CATALYST/man/sce2fcs.html suggests the following should work:

  Code:
sce2fcs(x, split_by = NULL, keep_cd = TRUE, keep_dr = TRUE, assay = "counts")


i.e. you especially want to keep the UMAP and tSNE, which are dimension reductions (DR), so that needs to be TRUE.

Re: Problems with Cytof workflow (Nowicka et al)

PostPosted: Mon Oct 12, 2020 10:19 am
by PaulineM
Thank you so much for your reply !!
It is indeed the function I'm trying to use. I tried keep_cd = TRUE, keep_dr = TRUE, but unfortunately, I have an error that I do not know how to manage.
Any suggestion ?


> My_FlowFrameKeep <- sce2fcs(sce, split_by = NULL, keep_cd = TRUE, keep_dr = TRUE, assay = "counts")
Error in readFCSdata(con, offsets, txt, transformation, which.lines, scale, :
$PnRNAis larger than R's numeric limit:1.79769313486232e+308
In addition: Warning message:
In readFCSdata(con, offsets, txt, transformation, which.lines, scale, :
NAs introduced by coercion

Re: Problems with Cytof workflow (Nowicka et al)

PostPosted: Mon Nov 02, 2020 5:18 pm
by juliam
Hi ALL,
I am running into the problems when I am cleaning up FCS files to have only channels which I am using with the following code

template_file <- read.FCS(filename = "Ep_s1.fcs", column.pattern = c('Y89Di|Pr141Di|Nd142Di|Nd143Di|Nd144Di|Nd146Di|Sm147Di|Nd148Di|Sm149Di|Nd150Di|Eu151Di|Sm152Di|Eu153Di|Sm154Di|Gd155Di|Gd156Di|Tb159Di|Gd160Di|Dy162Di|Dy163Di|Dy164Di|Ho165Di|Er166Di|Er168Di|Tm169Di|Yb171Di|Yb172Di|Yb173Di|Yb176Di|Bi209Di'), header=T, transformation = FALSE, truncate_max_range = FALSE)

write.FCS(template_file, "template_file.fcs")
bar <- read.FCS("template_file.fcs", transform=FALSE, truncate_max_range = FALSE)
all(exprs(template_file) == exprs(bar))

cytofCore.updatePanel(templateFile="template_file.fcs", fcsFolder="to change/")

The problem is that these relabelled files are overwritten, as values in particular channels (after relabelling) are exactly the same ...
> read.FCS(filename = "Ep_s2.fcs")
flowFrame object 'file997451472840'
with 317283 cells and 30 observables:
name desc range minRange maxRange
$P1 Y89Di 89Y_CD45 4096 0 4096
$P2 Pr141Di 141Pr_SPB 32768 0 32768
$P3 Nd142Di 142Nd_CleavedCaspase3 8192 0 8192
$P4 Nd143Di 143Nd_p53_Human 32768 0 32768
$P5 Nd144Di 144Nd_MHC_ClassI 16384 0 16384
$P6 Nd146Di 146Nd_SPC 16384 0 16384
$P7 Sm147Di 147Sm_gH2A.x 8192 0 8192
$P8 Nd148Di 148Nd_CD140ab90.2 32768 0 32768
$P9 Sm149Di 149Sm_p-p65 32768 0 32768

> read.FCS(filename = "Ep_s3.fcs")
flowFrame object 'file997476b9ba7a'
with 294568 cells and 30 observables:
name desc range minRange maxRange
$P1 Y89Di 89Y_CD45 4096 0 4096
$P2 Pr141Di 141Pr_SPB 32768 0 32768
$P3 Nd142Di 142Nd_CleavedCaspase3 8192 0 8192
$P4 Nd143Di 143Nd_p53_Human 32768 0 32768
$P5 Nd144Di 144Nd_MHC_ClassI 16384 0 16384
$P6 Nd146Di 146Nd_SPC 16384 0 16384
$P7 Sm147Di 147Sm_gH2A.x 8192 0 8192
$P8 Nd148Di 148Nd_CD140ab90.2 32768 0 32768

Why is it overwriting?