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
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.