Spectre icon indicating copy to clipboard operation
Spectre copied to clipboard

Error in train.cytnorm

Open ReubenMcG opened this issue 4 years ago • 14 comments

Hi all,

I am following the method in th "Discovery workflow with batch alignment using CytoNorm"

All works well until I try the "cytnrm <- train.cytonorm(model = cytnrm, align.cols = cellular.cols)" part.

It starts off smoothly then I am repeatedly getting the error:

Training alignment - setup
Working directory is '/Volumes/mmp-1/Moreland lab Auckland/Cytek/START runs/Spectre/Output_Spectre/Output 2 - alignment/tmp-train'
Training alignment - file (batch) preparation
Training alignment - file (batch) and metacluster splitting
 -- running File '1'
 -- running File '2'
 -- running File '3'
Training alignment - learning conversions
Processing cluster 1
Computing Quantiles
  A (FileID 1)

Error in flowCore::exprs(ff)[, channels, drop = FALSE] : 
  subscript out of bounds
In addition: Warning messages:
1: In FlowSOM::NewData(model$fsom, file.ff) :
  3243 cells (0.66%) seem far from their cluster centers.
2: In FlowSOM::NewData(model$fsom, file.ff) :
  3048 cells (0.73%) seem far from their cluster centers.
3: In FlowSOM::NewData(model$fsom, file.ff) :
  4214 cells (1.07%) seem far from their cluster centers.

Thank you again, Spectre is proving invaluable, both the package and the resources and papers!

ReubenMcG avatar Aug 24 '21 06:08 ReubenMcG

@ReubenMcG hmmm what are your 'cellular.cols'?

tomashhurst avatar Aug 26 '21 12:08 tomashhurst

Hi @tomashhurst,

Given the error I went back and changed the {cytnrm <-prep.cytonorm...} to include {cluster.cols = cellular.cols} as well as {cellular.cols = cellular.cols}

This rectified the error but seems like it's not the optimal solution as the exploratory clustering etc would the be using all cellular.cols to cluster?

Sorry if I am just confusing things...

ReubenMcG avatar Aug 26 '21 21:08 ReubenMcG

@ReubenMcG ah yes, I thought it might be this issue. There is a bit of an idiosyncratic use of that function. You need to define the cellular.cols argument to include all the cellular columns, and then the align.cols and cluster.cols can be a subset of those. The idea is that the function will pull in and record the data that is cellular in preparation for running CytoNorm. Only the columns in cluster.cols will be used for the actual clustering, and only the columns in 'align.cols' will actually be aligned.

tomashhurst avatar Aug 29 '21 04:08 tomashhurst

thanks @tomashhurst, yes this was my understanding, but it seems if I do not include all the cellular.cols in the cluster.cols argument within the prep.cytonorm I get the error message above.

This should not be the case right?

ReubenMcG avatar Aug 30 '21 00:08 ReubenMcG

Hmm that shouldn't be the case, but I will have a look and see what's up!

tomashhurst avatar Aug 31 '21 03:08 tomashhurst

@ReubenMcG I went and tested it and there is definitely an unintentional issue there -- I'm going to push our next release shortly which won't include a fix for this (we've got some folks waiting on new spatial analysis functions). Once that's done I'll go and make a patch for the cytonorm issues, which hopefully we can put out next week!

tomashhurst avatar Sep 03 '21 04:09 tomashhurst

Thanks, just glad it wasn't me doing something crazy which was my first assessment.

ReubenMcG avatar Sep 06 '21 01:09 ReubenMcG

Hi @tomashhurst, I'm having the same issue (if my cluster.cols do not include all cellular.cols, the train.cytonorm function fails when align.cols = cellular.cols.) Was there a patch or update made for this that I'm unaware of?

Hort-J avatar Oct 07 '22 00:10 Hort-J

Hi @tomashhurst , I too am having the same issue, are there any updates available?

gaya2510 avatar Jul 18 '23 03:07 gaya2510

Having the same issue here.

josephangelolopez avatar Jul 21 '23 06:07 josephangelolopez

I second that, I am having the same problem.

phuongtran807 avatar Sep 12 '23 15:09 phuongtran807

It may have been fixed in development branch. Can you try re-installing from development branch and try?

ghar1821 avatar Sep 12 '23 17:09 ghar1821

@ghar1821 I have installed the package from the development branch using devtools::install_github("immunedynamics/spectre", ref = 'development')

Running it with all cellular.cols for clustering worked fine but I would prefer clustering it with only the clustering.cols if possible. Could there be a link to this issue https://github.com/ImmuneDynamics/Spectre/issues/70 ?

phuongtran807 avatar Sep 13 '23 11:09 phuongtran807

Any updates for this issue?

mortadelo93 avatar Nov 27 '23 09:11 mortadelo93

Fixed in v1.2.0

tomashhurst avatar Jul 19 '24 23:07 tomashhurst