-2
$\begingroup$

I have a spreadsheet of CPM values

I want to visualize the top 20 genes expressed across my samples

This is how my data look like

> head(b[1:5,1:5])
                 30566-001 - CPM 30566-002 - CPM 30566-003 - CPM 30566-004 - CPM 30566-005 - CPM
hsa-miR-548ap-3p               0               0               0               0               0
hsa-miR-548t-3p                0               0               0               0               0
hsa-miR-548e-3p                0               0               0               0               0
hsa-miR-548az-3p               0               0               0               0               0
hsa-miR-548f-3p                0               0               0               0               0
> dim(b)
[1] 2632   42
> 

How I can do that?

$\endgroup$
3
  • $\begingroup$ Just make a heatmap? $\endgroup$
    – user438383
    Nov 25 '21 at 15:03
  • $\begingroup$ Then from a data frame with 2632 genes, how I select a list of genes for heatmap? Because a heatmap with 2632 genes is not clear while my main purpose is to shows a list of highly expressed genes across my samples $\endgroup$
    – Exhausted
    Nov 25 '21 at 15:07
  • $\begingroup$ select the N genes with the highest average expression across all samples? $\endgroup$
    – user438383
    Nov 25 '21 at 15:14
2
$\begingroup$

Gene selection is entirely on you and on the question you ask. Most expressed genes would be selected by rowMeans or rowMedians or even rowSums but this is not very informative as digital expression levels (=counts) is influenced by many technical factors and there is (to my knowledge) no direct link to biological relevance.

Alternatively, you can select by genes that vary a lot between experimental groups. Naively that could be the rowwise variance (rowVars) or standard deviation of the logCPMs (use logscale, otherwise variance is a function of the expression level) or the output of a differential analysis. Ideally plug the raw counts into DESeq2 or similar frameworks. If you only have CPMs then you probably want to feed the logCPMs into limma-trend pipeline, see for a discussion on ways to get going with normalized counts for differential expression in this Bioconductor thread.

Visualization is then again on you. Either make a heatmap (see for example ComplexHeatmap package) or aggregate the genes into a PCA (see for example PCAtools package at Bioconductor), all mentioned packages contain extensive example code and background information which is fully sufficient to run such an analysis.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.