FAQ  •  Register  •  Login

Cytofkit Cell counts

Forum rules
Please be as geeky as possible. Reference, reference, reference.
Also, please note that this is a mixed bag of math-gurus and mathematically challenged, so choose your words wisely :-)
<<

TomCyToF

Participant

Posts: 4

Joined: Mon Jul 23, 2018 2:58 pm

Post Mon Jul 23, 2018 8:36 pm

Cytofkit Cell counts

Hey,

I have been analysing data using cytofkit giving a tsne plot as output, I would like to be able to perform cell counts on the clusters.

From looking at the R website this appears to be an option in the sample panel. However the sample panel when I use cytofkit only has the options:
cell percentage heatmap, cell percentage line chart and regroup samples

I am using R version 3.5.1 and have recently installed the cytofkit package.

Does anyone know how I can get the cluster cell counts?

Thanks

Tom
<<

ErinSimonds

Master

Posts: 50

Joined: Tue May 13, 2014 8:04 pm

Post Tue Jul 24, 2018 11:24 pm

Re: Cytofkit Cell counts

Hey Tom,

I agree, it seems that cytofkit doesn't reveal raw cell counts (rather than percentages) through the GUI or in the pre-calculated .csv files. The good news is, you can do it yourself quite easily in R with one line of code.

Try this:

1. Quit the R GUI or Rstudio, if you it's already running. This is only to make sure we're starting from a clean slate.

2. Double-click the .RData file that cytofkit saved on your hard drive. Usually this action will cause Rstudio to open up and load the data directly. If not, start Rstudio manually, and use File --> Open to load the .Rdata file.

3. Click "Yes" when Rstudio asks about loading the data into the global environment.

4. In the R console, paste in the line of code below, and hit enter. This should write a new CSV file in the working directory:

  Code:
write.csv(x=table(cbind.data.frame(sample_name=gsub(x=names(analysis_results$clusterRes$Rphenograph), pattern="\\_(?:.(?!\\_))+$", replacement="", perl=T), cluster=analysis_results$clusterRes$Rphenograph)), file="Cell counts per PhenoGraph cluster by sample.csv")


(if you're not sure where the file was saved, use the command getwd() to find your current working directory)

Good luck!

ES
<<

TomCyToF

Participant

Posts: 4

Joined: Mon Jul 23, 2018 2:58 pm

Post Wed Jul 25, 2018 8:32 pm

Re: Cytofkit Cell counts

Thanks for your reply Erin.

I have tried to use that code and it doesn't work for me, the error message is for the first line

Error: unexpected symbol in:
"write.csv(x=table(cbind.data.frame(sample_name=gsub(x=names(analysis_results$clusterRes$Rphenograph)
pattern"

Presumably the symbol is $ sign as no other symbols in the code, any suggestion for altering that?

Thanks

TOm
<<

ErinSimonds

Master

Posts: 50

Joined: Tue May 13, 2014 8:04 pm

Post Wed Jul 25, 2018 9:35 pm

Re: Cytofkit Cell counts

Hey Tom,

That error is most likely because something happened when you copy/pasted from the browser. Make sure it's all on one line when you paste it into R. Here's a screenshot of how it should look before you press [enter].

ES
Attachments
Screen Shot 2018-07-25 at 2.34.25 PM.png
R console
<<

TomCyToF

Participant

Posts: 4

Joined: Mon Jul 23, 2018 2:58 pm

Post Mon Jul 30, 2018 11:30 am

Re: Cytofkit Cell counts

Managed to get a csv file with the cluster cell counts now.

Thank you for your help,

Tom
<<

ErinSimonds

Master

Posts: 50

Joined: Tue May 13, 2014 8:04 pm

Post Mon Jul 30, 2018 3:09 pm

Re: Cytofkit Cell counts

Great! Good luck with the rest of your analaysis.

Return to CyTOF data analysis

Who is online

Users browsing this forum: Google [Bot] and 12 guests