seurat v5 objects are converted to v4; seurat v4 and v5 are converted to each other

Hello everyone , someone asked in the Shengxin Skill Tree Group: How to use seurat v5 to read files created by v4

My gut tells me not to regenerate, there must be an easy way.

What is included in the Seurat official website?

Let’s go to the official website documentation to find an easy way: https://satijalab.org/seurat/

It doesn’t seem to say that seurat v5 and v4 objects can be directly converted. Don’t worry, let’s continue reading.

2. What is the difference between Seuratv5 and v4?

It’s all mentioned on the official website: https://satijalab.org/seurat/articles/announcements.html

There are mainly these 5 differences:

  • 1 The Seurat object and Assay class have changed:

  • Supports a wider variety of detections and data types, including on-disk matrices.

  • A hierarchical structure was introduced to store data such as raw counts, normalized data, and z-score/variance stable data.

  • Data can be accessed using  $ accessors or  LayerData functions.

  • Existing Seurat v4 functions and workflows will still work in v5.

  • 2 The integration workflow has changed:

  • Simplified integration process, improved speed and memory efficiency.

  • The integration results are slightly different from the v4 workflow, but users can still run the v4 integration workflow in v5.

  • All data can be saved as a single object and layers can be split before integration.

  • 3 Differential expression analysis has changed:

  • Use the presto package (if available) for differential expression analysis to speed up the process.

  • When calculating log-FC, pseudo-counts are implemented at the group level instead of the cell level, which may result in higher logFC estimates, but may also be more unstable.

  • 4 SCTransform v2 has changed:

  • Updated version 2 of SCTransform is used by default.

  • Users can set  vst.flavor = "v1" parameters to run previous workflows.

  • 5 Pseudobulk analysis has changed (pseudo-batch analysis):

  • The use of functions for pseudo-batch analysis is encouraged  AggregateExpression to reduce noise, improve quantification of lowly expressed genes, and reduce the size of the data matrix.

But I still haven’t seen that seurat v5 and v4 objects can be directly converted. Don’t worry, let’s continue reading.


The three omnipotent google and github gave the answer

#https://github.com/satijalab/seurat/issues/7409# convert a v5 assay to a v3 assaypbmc3k[["RNA3"]] <- as(object = pbmc3k[["RNA"]], Class = "Assay")# convert a v3 assay to a v5 assaypbmc3k[["RNA5"]] <- as(object = pbmc3k[["RNA3"]], Class = "Assay5")

You can see the size change before and after conversion

Both v3 and v5 can be converted to each other. I shouldn’t need to write v4 and v5 to convert each other.

If you really want to read it, just read today’s second tweet.

postscript

The technique of this article is not difficult, it is more of a way of thinking to help everyone develop their own ideas.

To communicate more, add me on WeChat and note your name and school.

Remember to click "Watching" after watching this!

Guess you like

Origin blog.csdn.net/qq_52813185/article/details/135257615