R: S4/List Conversion

s4list {SeuratObject} | R Documentation

## S4/List Conversion

### Description

Convert S4 objects to lists and vice versa. Useful for declassing an S4 object while keeping track of it's class using attributes (see section S4 Class Definition Attributes below for more details). Both `ListToS4` and `S4ToList` are recursive functions, affecting all lists/S4 objects contained as sub-lists/sub-objects.

### Usage

    S4ToList(object)

    IsS4List(x)

    ListToS4(x)

    ## Default S3 method:
    S4ToList(object)

    ## S3 method for class 'list'
    S4ToList(object)

### Arguments

`object` | An S4 object
`x` | A list with an S4 class definition attribute

### Value

`S4ToList`: A list with an S4 class definition attribute

`IsS4List`: `TRUE` if `x` is a list with an S4 class definition attribute

`ListToS4`: An S4 object as defined by the S4 class definition attribute

### S4 Class Definition Attributes

S4 classes are scoped to the package and class name. In order to properly track which class a list is generated from in order to build a new one, these function use an `attribute` to denote the class name and package of origin. This attribute is stored as “classDef” and takes the form of “`package:class`”.

[Package SeuratObject version 4.0.3 Index]