How to bin groups of 20 cells based amount of a metadata value
1
0
Entering edit mode
2.6 years ago
cook.675 ▴ 230

I have a scRNAseq Seurat object that is virus infected cells. I have a metadata label that is a sum of the total viral transcripts in each cell.

Object$total.virus.count

I want to make groups of 20 cells based on the highest expression of viral transcripts. For example, if I were to sort based on total.virus.count, group 1 would be the first 20 cells. Group 2 would be the second 20 cells, etc... I would like to label these groups of 20 as another metadata column ("VirusGroup" = 1,2,3,4,5) so they can be subsetted and analyzed.

I have no idea how to do this but I tried order function and some dplyr calls but I have no been successful.

Any help would be greatly appreciated!

Thanks

data seurat scRNA-seq R • 569 views
ADD COMMENT
0
Entering edit mode
2.6 years ago
cook.675 ▴ 230

I solved it thanks!

ADD COMMENT
0
Entering edit mode

It would be useful to post the actual solution since it can help a future visitor to this thread. Please consider editing above comment and post the solution.

ADD REPLY

Login before adding your answer.

Traffic: 1605 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6