blasern / R-cytometry

1 stars 2 forks source link

Missing new channels for FlowSOM #3

Open miriamsand opened 6 years ago

miriamsand commented 6 years ago

Hi, I'm having troubles changing the file after running FlowSOM. This has previously worked, but when uploading to cytobank, I am now missing the new cluster and metacluster channel. I'm following the script posted, so I doubt that is the problem.

Miriam

blasern commented 6 years ago

Can you give some more details (ideally your code)? Are you sure that you are uploading the new files to cytobank and not the old ones?

miriamsand commented 6 years ago

After I've created MST, this is what I get when running the script:

fset_new <- fset clusters <- fsom$FlowSOM$map$mapping[, 1] meta_clusters <- as.numeric(fsom$metaclustering[clusters]) filenames <- rep(sampleNames(fset),

  • fsApply(fset, nrow, use.exprs = TRUE)) res_data <- data.frame(clusters = clusters,
  • meta_clusters = meta_clusters,
  • filenames = filenames) head(res_data) clusters meta_clusters filenames 1 49 3 c01_Leddveske test_3 unstim.fcs 2 34 3 c01_Leddveske test_3 unstim.fcs 3 6 3 c01_Leddveske test_3 unstim.fcs 4 48 3 c01_Leddveske test_3 unstim.fcs 5 41 3 c01_Leddveske test_3 unstim.fcs 6 42 3 c01_Leddveske test_3 unstim.fcs update_ff <- function(ff, res_data){
  • rd <- res_data[res_data$filenames == identifier(ff),
  • c("clusters", "meta_clusters")]
  • ff@exprs <- cbind(ff@exprs, as.matrix(rd))
  • ff@parameters@data <- rbind(
  • ff@parameters@data,
  • data.frame(
  • name = c("cluster", "meta_cluster"),
  • desc = "som_clustering",
  • range = c(max(res_data$clusters),
  • max(res_data$meta_clusters)),
  • minRange = 1,
  • maxRange = c(max(res_data$clusters),
  • max(res_data$meta_clusters)),
  • row.names =
  • paste0("$P", nrow(ff@parameters@data) + 1:2)))
  • ff
  • } fset_new <- fsApply(fset, update_ff,
  • res_data = res_data) fset_new A flowSet with 4 experiments.

column names: Time Event_length Y89Di Pd102Di Rh103Di Pd104Di Pd105Di Pd106Di Pd108Di Pd110Di In113Di Cd114Di In115Di Cd116Di Sn120Di I127Di Xe131Di Cs133Di Ba138Di Ce140Di Pr141Di Nd142Di Nd143Di Nd144Di Nd145Di Nd146Di Sm147Di Nd148Di Sm149Di Nd150Di Eu151Di Sm152Di Eu153Di Sm154Di Gd155Di Gd156Di Gd158Di Tb159Di Gd160Di Dy161Di Dy162Di Dy163Di Dy164Di Ho165Di Er166Di Er167Di Er168Di Tm169Di Er170Di Yb171Di Yb172Di Yb173Di Yb174Di Lu175Di Yb176Di BCKG190Di Ir191Di Ir193Di Pt194Di Pt195Di Pt198Di Pb208Di Bi209Di Center Offset Width Residual cluster meta_cluster

new_files <- gsub(".fcs", "_som.fcs", files) flowCore::write.flowSet(fset_new,

  • outdir = ".",
  • filename = new_files) [1] "." zip_filename <- paste0(data_dir, "clustered_som.zip") zip(zip_filename, new_files) adding: test SF/c01_Leddveske test_3 unstim_som.fcs (deflated 43%) adding: test SF/c02_Leddveske test_3 stim_som.fcs (deflated 42%) adding: test SF/c03_Leddveske test_5 unstim_som.fcs (deflated 42%) adding: test SF/c04_Leddveske test_5 stim_som.fcs (deflated 42%) new_experiment_name <- "test_som" new_experiment <- experiments.new(
  • cyto_session,
  • experiment_name = new_experiment_name,
  • purpose = "testing som") fcs_files.upload_zip(cyto_session,
  • experiment_id = new_experiment$id,
  • file_path = zip_filename,
  • timeout = 720) id filename cytometer mode md5sum clustered 1 395256 c01_Leddveske test_3 unstim_som.fcs DVSSCIENCES-CYTOF-1.6.0 L 65b0165d73065e4635d313aaa0de3f7b FALSE 2 395257 c02_Leddveske test_3 stim_som.fcs DVSSCIENCES-CYTOF-1.6.0 L 9e35bdd353b035580c95afd70b9bf5ba FALSE 3 395258 c03_Leddveske test_5 unstim_som.fcs DVSSCIENCES-CYTOF-1.6.0 L 8c5b8e864664abe9192ef37fef180b75 FALSE 4 395259 c04_Leddveske test_5 stim_som.fcs DVSSCIENCES-CYTOF-1.6.0 L 8db41db375dff5651d69ff442c9e9fef FALSE guid threshold severity experimentId sampleName fcsFileVersion dataType tubeName 1 c01_Leddveske test_3 unstim.fcs NA 0 7572 c01_Leddveske test_3 unstim.fcs FCS3.0 F NA 2 c02_Leddveske test_3 stim.fcs NA 0 7572 c02_Leddveske test_3 stim.fcs FCS3.0 F NA 3 c03_Leddveske test_5 unstim.fcs NA 0 7572 c03_Leddveske test_5 unstim.fcs FCS3.0 F NA 4 c04_Leddveske test_5 stim.fcs NA 0 7572 c04_Leddveske test_5 stim.fcs FCS3.0 F NA applyCompensation fileSize detectedCytometer wellId plateId plateName category channelCount createdAt updatedAt 1 FALSE 13528785 DVSSCIENCES-CYTOF-1.6.0 NA 1 Plate 1 1 67 2018-06-22T07:33:29Z 2018-06-22T07:33:31Z 2 FALSE 16315791 DVSSCIENCES-CYTOF-1.6.0 NA 1 Plate 1 1 67 2018-06-22T07:33:30Z 2018-06-22T07:33:31Z 3 FALSE 15651999 DVSSCIENCES-CYTOF-1.6.0 NA 1 Plate 1 1 67 2018-06-22T07:33:30Z 2018-06-22T07:33:31Z 4 FALSE 11749071 DVSSCIENCES-CYTOF-1.6.0 NA 1 Plate 1 1 67 2018-06-22T07:33:30Z 2018-06-22T07:33:31Z dataStart dataEnd acquisitionStart acquisitionEnd expFile operatorName operatingSystem creatorSoftware experimentDate 1 7537 13528776 12:40:51 12:40:51 c01_Leddveske test_3 unstim.fcs NA NA NA 19-May-2017 2 7495 16315782 12:40:54 12:40:54 c02_Leddveske test_3 stim.fcs NA NA NA 19-May-2017 3 7483 15651990 12:40:59 12:40:59 c03_Leddveske test_5 unstim.fcs NA NA NA 19-May-2017 4 7471 11749062 12:41:04 12:41:04 c04_Leddveske test_5 stim.fcs NA NA NA 19-May-2017 experimentName exportTime exportUser windowExtension totalEvents timeStep analysisStart analysisEnd supplementalStart supplementalEnd 1 test_som NA NA NA 48990 NA 0 0 0 0 2 test_som NA NA NA 59088 NA 0 0 0 0 3 test_som NA NA NA 56683 NA 0 0 0 0 4 test_som NA NA NA 42542 NA 0 0 0 0 instrument 1 NA 2 NA 3 NA 4 NA

It's the "_som.fcs" files that are uploaded to cytobank, so I know it's the new files that are being uploaded - but I still don't have the new channels.... Could it be due to updates in cytobank?

Miriam

blasern commented 6 years ago

I just tested your code and I got the new cluster and meta_cluster channels in cytobank. So I don't know why it doesn't work for you. Feel free to drop by my office sometime this week so that we can look at it together.