addGenomes {FindMyFriends} | R Documentation

## Add new organisms to an existing pangenome

### Description

This method allows new genomes to be added to an already processed pangenome, preserving existing grouping and adding new genes to their relevant groups. This makes it possible to gradually grow the pangenome as new sequences becomes available without redoing the grouping at each time, loosing the gene group metadata.

### Usage

    addGenomes(object, newSet, ...)

    ## S4 method for signature 'pgVirtual,pgVirtual'
    addGenomes(object, newSet, kmerSize,
      lowerLimit, pParam, nsParam = list(), klParam = list())

### Arguments

`object` | A pgVirtual subclass to merge the new genomes into
`newSet` | An object of the same class as object containing the new organisms to add. Grouping of the genes contained in this object can already exist, if not it will be done automatically.
`...` | parameters passed on.
`kmerSize` | The size of the kmers to use for comparing new genes to existing
`lowerLimit` | The lower threshold for sequence similarity, below which it is set to 0
`pParam` | A BiocParallelParam object
`nsParam` | A list of parameters to pass to `neighborhoodSplit` or FALSE to skip neighborhood splitting altogether. If object has had neighborhood splitting performed and nsParam is set to FALSE it is bound to cause problems, so don't do that.
`klParam` | A list of parameters to pass to `kmerLink` or FALSE to skip paralogue linking altogether. Independent of the value of klParam kmerLink will only be run if paralogue links have been defined on object beforehand.

### Value

An object of the same class as object containing the new organisms from newSet and possible new gene groups from genes with no orthologues in the original pangenome.

### Methods (by class)

- `object = pgVirtual,newSet = pgVirtual`: Genome addition for all pgVirtual subclasses

### Examples

    # Get base pangenome
    pg <- .loadPgExample(geneLoc = TRUE, withGroups = TRUE,
                         withNeighborhoodSplit = TRUE)
    # Get some additional genomes
    location <- tempdir()
    unzip(system.file('extdata', 'Mycoplasma.zip', package = 'FindMyFriends'),
          exdir = location)
    genomeFiles <- list.files(location, full.names = TRUE, pattern = '*.fasta')[6:10]
    pg2 <- pangenome(genomeFiles, translated = TRUE, geneLocation = 'prodigal')

    # Combine the two (too computational heavy to include)
    ## Not run:
    pg3 <- addGenomes(pg, pg2, nsParam = list(lowerLimit = 0.8))

    ## End(Not run)

[Package FindMyFriends version 1.19.0 Index]