GithubHelp home page GithubHelp logo

Comments (8)

davismcc avatar davismcc commented on July 28, 2024 1

Yes, in scater the exprs values will be cpm'd as well as log-transformed. For every setting, as far as I can see, apart from paedagogical discussions, the exprs values should be log2(cpm) - it would never make sense in an actual analyses to use log2(counts) or similar, since you will have differences between cells driven by completely technical factors like sequencing depth.

For the sake of the course, if you want to demonstrate what PCA on log2-counts looks like, then we could do:

set_exprs(sce, "log2_counts") <- log2(counts(sce) + 1)
plotPCA(sce, exprs_values = "log2_counts")

We should make the point in the course that this is not something that you would ever want to do in practice, but can show it to demonstrate what's going on.

That said, if we're doing PCA on log2-counts to make a point, then we could just as well do PCA on counts, with the caveat that this is "not something you should try at home".

For actual visualizations in analysis, the expression values used need to account for differences in sequencing depth to make cells at all comparable, so cpm/tpm/fpkm are required, and log-transforming them makes most sense.

from scrna.seq.course.

davismcc avatar davismcc commented on July 28, 2024 1

OK, that sounds good to me. I agree that in the context of the course, makes sense to build up counts --> cpm --> further normalisation. We can say in discussion that in a real analysis it makes most sense to go straight to log2(cpm) for visualization, and from there assess further downstream normalization approaches.

from scrna.seq.course.

wikiselev avatar wikiselev commented on July 28, 2024

Looks like there is no log-transform parameter in the plotPCA() function, so we won't be able to easily create a PCA plot of a given scater object slot...

Davis, is there any way of implementing this functionality?

from scrna.seq.course.

davismcc avatar davismcc commented on July 28, 2024

Shouldn't we just make sure we log-transform the data before doing PCA? PCA on count data is not a great idea.

from scrna.seq.course.

wikiselev avatar wikiselev commented on July 28, 2024

Ok, but how do we do that in a simple way? If we use expression values, they will be not just log-transformed but also cpm-ed?

from scrna.seq.course.

wikiselev avatar wikiselev commented on July 28, 2024

Great, thanks for that Davis! I've implemented your suggested scenario:

set_exprs(sce, "log2_counts") <- log2(counts(sce) + 1)
plotPCA(sce, exprs_values = "log2_counts")

Building it now, hopefully the build will not FAIL :-) But at least we will be doing something reasonable, what we've had so far (raw counts everywhere) was really not ideal!

from scrna.seq.course.

wikiselev avatar wikiselev commented on July 28, 2024

My logic is - we shouldn't use cpm before the normalisation step, that is why I decided to go for log2_counts.

from scrna.seq.course.

wikiselev avatar wikiselev commented on July 28, 2024

Yes, I've added a comment just after we introduce log2_counts (it's not live yet). BTW, the builds was ok, so the new PCAs are already online. Thanks again for your help, Davis!

from scrna.seq.course.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.