JinmiaoChenLab / cytofkit

cytofkit: an integrated flow/mass cytometry data analysis pipeline
http://jinmiaochenlab.github.io/cytofkit/
57 stars 24 forks source link

Markers aren't identified. #63

Closed traumenCapote closed 5 years ago

traumenCapote commented 5 years ago

I am getting this error: Dimension reduction... Error in FUN(X[[i]], ...) : Selected marker(s) is/are not in the input fcs files please check your selected marker(s)!

When I read in my FCS Files with the flowCore package I get the structure below. Should I be using the names (e.g., Parameter49) or desc (e.g., log2_CD107a) as input for the markers argument? Both throw the above error...

      name                       desc range     minRange maxRange

... $P49 Parameter_49 "log2_CD107a" 1 0.04464286 0 $P50 Parameter_50 "log2_CD11b" 1 0.00000000 0 $P51 Parameter_51 "log2_CD11c" 0 0.00000000 -1 $P52 Parameter_52 "log2_CD14" 4 0.07878585 3 $P53 Parameter_53 "log2_CD16" 8 0.00000000 7 $P54 Parameter_54 "log2_CD20" 0 0.00000000 -1 $P55 Parameter_55 "log2_CD3" 2 0.00000000 1 $P56 Parameter_56 "log2_CD31" 2 0.00000000 1 $P57 Parameter_57 "log2_CD38" 2 0.00000000 1 $P58 Parameter_58 "log2_CD4" 4 0.00000000 3

SamGG commented 5 years ago

I think that the best way to learn how cytofkit is coding the channel is to use the GUI. As it builds a script, you could read clearly the encoding. Alternatively, you could read the step-by-step script at http://impact-cyto.inserm.fr/cytofkit-commandes-pas-a-pas/ By the way, I am wondering how you get those log2 transformed parameters. I guess you took care about zero, but the range and the maxima look strange. Best.

traumenCapote commented 5 years ago

I think that the best way to learn how cytofkit is coding the channel is to use the GUI. As it builds a script, you could read clearly the encoding. Alternatively, you could read the step-by-step script at http://impact-cyto.inserm.fr/cytofkit-commandes-pas-a-pas/

Thanks for that link. And the GUI suggestion was a good one. It reveals that it uses a combination of the two fields: e.g., -Parameter_59<"log2_CD45">

By the way, I am wondering how you get those log2 transformed parameters. I guess you took care about zero, but the range and the maxima look strange.

My data is imaging mass cytometry data, so the ranges are different from flow CyTOF. I log transformed before exporting the segmented object intensities into FCS files.

SamGG commented 5 years ago

Imaging Mass Cytometry... What a dream! I think you don't have to transform those log2 intensities. Best.

BridgetPK commented 4 years ago

Hi, I am having a similar issue with marker formatting. However, I checked the GUI and confirmed that I have the same format that the GUI uses to make my .txt file with the marker list. The GUI works just fine for the fsc files and these markers. Other suggestions? See error below. I only included two markers as an example.

* Markers:
   -Yb176Di<176Yb_CD56>
   -Bi209Di<CD16>
* Data merging method: ceil
* Data transformation method: cytofAsinh
* Dimensionality reduction method: tsne
* Data clustering method(s): Rphenograph ClusterX
* Data visualization method(s): tsne pca
* Subset progression analysis method: isomap

Extract expression data...
   108000  x  40  data was extracted!
Dimension reduction...
Error in FUN(X[[i]], ...) :
 Selected marker(s) is/are not in the input fcs files
 please check your selected marker(s)!
Calls: cytofkit -> lapply -> FUN
Execution halted
SamGG commented 4 years ago

Hi, It's better to start a new issue. I am still dubious about the way you formatted the marker list as the GUI is working correctly. Could you attach or copy/paste the text file ?

BridgetPK commented 4 years ago

Hi thanks for replying. Here is copy/pasted the contents of the .txt file I am using. I have also tried this using a version that is the same except with the first line stating "markers" as a header and that also did not work.


La139Di<139La_CD11c>\
Ce140Di<CD15>\
Pr141Di<141Pr_CD3>\
Nd142Di<142Nd_CD19>\
Nd143Di<143Nd_CD117>\
Nd144Di<144Nd_CD11b>\
Nd145Di<145Nd_CD4>\
Nd146Di<146Nd_CD8a>\
Sm147Di<147Sm_BDCA2>\
Nd148Di<148Nd_CD14>\
Sm149Di<149Sm_CD127>\
Nd150Di<150Nd_FCeR1a>\
Eu151Di<151Eu_Beads151_CD123>\
Sm152Di<152Sm_ULBP-2>\
Eu153Di<153Eu_Beads153_CD7>\
Sm154Di<154Sm_pRb>\
Gd155Di<155Gd_BDCA4>\
Gd156Di<156Gd_PD-L1>\
Gd158Di<158Gd_PD-L2>\
Tb159Di<159Tb_CD137>\
Dy160Di<160Dy_CD33>\
Dy161Di<161Dy_CD90>\
Dy162Di<162Dy_Siglec-8>\
Dy163Di<163Dy_CD209>\
Dy164Di<164Dy_Arginase>\
Ho165Di<165Ho_Beads165_MICA/B>\
Er166Di<166Er_BDCA3>\
Er167Di<167Er_CD38>\
Er168Di<168Er_Ki-67>\
Tm169Di<169Tm_CD25>\
Er170Di<170Er_BDCA1>\
Yb171Di<171Yb_CD68>\
Yb172Di<172Yb_CD163>\
Yb173Di<173Yb_ICOS>\
Yb174Di<174Yb_HLA-DR>\
Lu175Di<175Lu_Beads175_PD-1>
BridgetPK commented 4 years ago

If this is helpful, my script is as follows


library(cytofkit)
set.seed(100)
dir <- '/(my path to dir)/'
file <- list.files(dir ,pattern='.fcs$', full=TRUE)
parameters <- list.files(dir, pattern='.txt$', full=TRUE)
res <- cytofkit(fcsFiles = file,
                markers =parameters,
                projectName = 'cytofkit_myeloidC1',
                transformMethod = "cytofAsinh",
                mergeMethod = "ceil",
                fixedNum = 3000,                                    ## set at 500 for faster run
                dimReductionMethod = "tsne",
                clusterMethods = c("Rphenograph", "ClusterX"),    ## accept multiple methods
                visualizationMethods = c("tsne", "pca"),          ## accept multiple methods
                progressionMethod = "isomap",
                clusterSampleSize = 500,
                resultDir = getwd(),
                saveResults = TRUE,
                saveObject = TRUE)
SamGG commented 4 years ago

Hi, Parameter names sounds OK, but I don't understand the backslash character. I think you should remove them. I attach a marker file that should be correct IMHO, except for end of line as I am working on Windows. The text file must have a header because a header is specified in the read.table() call. https://github.com/JinmiaoChenLab/cytofkit/blob/c4f93e5d849cf670c3825e5abacd850822c8eca7/R/cytofkit.R#L170-L171 Best. marker_bridget.txt