removeGene {FindMyFriends} | R Documentation

## Remove genes from a pangenome

### Description

This method makes it possible to safely remove genes from a pangenome using a variaty of selection mechanisms depending on the supplied parameters. The name parameter refers to the gene name, organism refers to either organism name or index, group refers to either gene group name or index and ind refers to the gene index. See examples for details of the different possibilities.

### Usage

    removeGene(object, name, organism, group, ind, ...)

    ## S4 method for signature 'pgInMem,missing,missing,missing,numeric'
    removeGene(object,
      name, organism, group, ind)

    ## S4 method for signature 'pgVirtual,character,missing,missing,missing'
    removeGene(object,
      name, organism, group, ind)

      ## S4 method for signature 'pgVirtual,character,character,missing,missing'
    removeGene(object,
      name, organism, group, ind)

    ## S4 method for signature 'pgVirtual,character,numeric,missing,missing'
    removeGene(object,
      name, organism, group, ind)

    ## S4 method for signature 'pgVirtual,missing,character,missing,missing'
    removeGene(object,
      name, organism, group, ind)

    ## S4 method for signature 'pgVirtual,missing,numeric,missing,missing'
    removeGene(object,
      name, organism, group, ind)

    ## S4 method for signature 'pgVirtual,missing,character,missing,numeric'
    removeGene(object,
      name, organism, group, ind)

    ## S4 method for signature 'pgVirtual,missing,numeric,missing,numeric'
    removeGene(object,
      name, organism, group, ind)

    ## S4 method for signature 'pgVirtual,missing,missing,character,missing'
    removeGene(object,
      name, organism, group, ind)

    ## S4 method for signature 'pgVirtual,missing,missing,numeric,missing'
    removeGene(object,
      name, organism, group, ind)

    ## S4 method for signature 'pgVirtual,missing,missing,character,numeric'
    removeGene(object,
      name, organism, group, ind)

    ## S4 method for signature 'pgVirtual,missing,missing,numeric,numeric'
    removeGene(object,
      name, organism, group, ind)

### Arguments

`object` | A pgVirtual subclass
`name` | A character vector of names of genes to remove
`organism` | Either an integer or character vector of orgnanisms to remove genes from. If neither name nor ind is given all genes in the organisms are removed.
`group` | Either an integer or character vector of gene groups to remove genes from. If ind is not given all genes in the groups are removed.
`ind` | Indexes of the selections to remove. If both name, organism and group is not given, it indexes into the raw gene index, otherwise it indexes into the element defined by organism or group.
`...` | parameters passed on (currently ignored).

### Value

An object of the same class as object without the genes that should be removed.

### Methods (by class)

- `object = pgInMem,name = missing,organism = missing,group = missing,ind = numeric`: Gene removal base function for pgInMem subclasses

- `object = pgVirtual,name = character,organism = missing,group = missing,ind = missing`: Remove gene based on gene name

- `object = pgVirtual,name = character,organism = character,group = missing,ind = missing`: Remove gene based on gene and organism name

- `object = pgVirtual,name = character,organism = numeric,group = missing,ind = missing`: Remove gene based on gene name and organism index

- `object = pgVirtual,name = missing,organism = character,group = missing,ind = missing`: Remove gene based on organism name

- `object = pgVirtual,name = missing,organism = numeric,group = missing,ind = missing`: Remove gene based on organism index

- `object = pgVirtual,name = missing,organism = character,group = missing,ind = numeric`: Remove gene based on organism name and gene index

- `object = pgVirtual,name = missing,organism = numeric,group = missing,ind = numeric`: Remove gene based on organism and gene index

- `object = pgVirtual,name = missing,organism = missing,group = character,ind = missing`: Remove gene based on gene group name

- `object = pgVirtual,name = missing,organism = missing,group = numeric,ind = missing`: Remove gene based on gene group index

- `object = pgVirtual,name = missing,organism = missing,group = character,ind = numeric`: Remove gene based on gene group name and gene index

- `object = pgVirtual,name = missing,organism = missing,group = numeric,ind = numeric`: Remove gene based on gene group and gene index

### Note

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

### Examples

    testPG <- .loadPgExample(withGroups=TRUE)
    nGenes(testPG)

    # Remove gene number 6
    removeGene(testPG, ind=5)

    # Remove all genes from organism 'AE017244'
    removeGene(testPG, organism='AE017244')

    # Remove first gene in gene group 10
    removeGene(testPG, group=10, ind=1)

[Package FindMyFriends version 1.14.0 Index]