genes {FindMyFriends} | R Documentation

## Extract gene sequences from a pangenome

### Description

This method is used to extract the genomic sequences that is the basis for the pangenome. Genes can be split and subsetted upfront based on other information in the pangenome, such as gene groups and organisms. For some pgVirtual subclasses the subset parameter is mandatory in order to avoid reading all genes into memory at once.

### Usage

    genes(object, split, subset)

    ## S4 method for signature 'pgLM,missing'
    genes(object, split, subset)

    ## S4 method for signature 'pgLM,character'
    genes(object, split, subset)

    ## S4 method for signature 'pgFull,missing'
    genes(object, split, subset)

    ## S4 method for signature 'pgFull,character'
    genes(object, split, subset)

    ## S4 method for signature 'pgSlim,missing'
    genes(object, split, subset)

    ## S4 method for signature 'pgSlim,character'
    genes(object, split, subset)

### Arguments

`object` | A pgVirtual subclass
`split` | A string giving the optional splitting type. Either 'organism', 'group' or 'paralogue'.
`subset` | A subsetting of the result equal to using '[]' on the result. It is generally recommended to use this instead of subsetting the result, as it avoids unneeded memory allocation.

### Value

An XStringSet if split is missing or an XStringSetList if it is present

### Methods (by class)

- `object = pgLM,split = missing`: Gene access for pgLM and subclasses

- `object = pgLM,split = character`: Gene access for pgLM and subclasses with group splitting

- `object = pgFull,split = missing`: Gene access for pgFull and subclasses

- `object = pgFull,split = character`: Gene access for pgFull and subclasses with group splitting

- `object = pgSlim,split = missing`: Throws error for pgSlim

- `object = pgSlim,split = character`: Throws error for pgSlim

### Note

Required for subclasses of pgVirtual in order to extend the class system of FindMyFriends

### Examples

    testPG <- .loadPgExample(withGroups=TRUE, withParalogues=TRUE)
    # Direct gene access
    genes(testPG)

    # Early subsetting
    genes(testPG, subset=1:10)

    # Split by membership
    genes(testPG, split='organism')
    genes(testPG, split='group')
    genes(testPG, split='paralogue')

    # Split and subset - get genes from the first organism
    genes(testPG, split='organism', subset=1)

[Package FindMyFriends version 1.19.0 Index]