peptideLibraries {PhIPData} | R Documentation

## Peptide libraries

### Description

PhIP-Seq experiments often use identical peptide libraries different cohorts. These functions enable the user to conveniently reuse tidied libraries.

### Usage

    getLibraryPath()

    setLibraryPath(path)

    getLibrary(name)

    makeLibrary(library, name)

### Arguments

`path` | path to a folder containing a .rds files for each library
`name` | name of the library
`library` | a `matrix`, `data.frame`, or DataFrame with the peptide information for the specified library.

### Details

Each library is stored as a DataFrame in .rds file. By default the libraries are stored in the `libraries` package folder. `setLibraryPath` allows the user to change the location of this library, if desired.

While libraries can be directly saved in the specified format by the user, it is highly recommended to use the `makeLibrary` function to save a new library.

### Value

`getLibraryPath` returns the path to the directory containing .rds files for each library. `getLibrary` returns a DataFrame corresponding to the peptide information for the specified library.

### Functions

- `getLibraryPath`: return the path to a folder containing the libraries.

- `setLibraryPath`: set the path to a folder containing the libraries.

- `getLibrary`: return a DataFrame with the peptide information corresponding to the library.

- `makeLibrary`: create and store a DataFrame with the specified peptide information.

### Examples

    ## Get and set path to libraries folder
    getLibraryPath()
    ## Not run: setLibraryPath("examplepath/")

    ## Create a new library
    pep_meta <- data.frame(species = c(rep("human immunodeficiency virus", 3),
         rep("Epstein-Barr virus", 2)))
    makeLibrary(pep_meta, "new_library")

    ## Use new library
    counts_dat <- matrix(1:10, nrow = 5)
    phip_obj <- PhIPData(counts = counts_dat,
         peptideInfo = getLibrary("new_library"))

    ## Delete created library
    file.remove(paste0(getLibraryPath(), "/new_library.rds"))

[Package PhIPData version 1.0.0 Index]