hemberg-lab / scRNA.seq.course

Analysis of single cell RNA-seq data course
https://www.singlecellcourse.org
GNU General Public License v3.0
670 stars 360 forks source link

Question about Exercise 2 in section 5.2.3 (Matrix Statistics) #184

Open BAREJAA opened 2 years ago

BAREJAA commented 2 years ago

For this question -

"Create a new assay called “cpm” (Counts-Per-Million), which contains the result of dividing the counts matrix by the total counts in millions."

The course's answer is - assay(tung, "cpm") <- counts(tung)/tung$total_counts/1e6

Shouldn't it be - assay(tung, "cpm") <- sweep(counts(tung), 2, tung$total_counts, "/")/1e6

?

p.s. This is a wonderful course/book!!