exportPrimers {TAPseq} | R Documentation

## Export TAP-seq primers

### Description

A set of functions for TAP-seq primer export. Convert primers stored in `TsIO` or `TsIOList` objects to a simple `data.frame` for easier export. Or create BED format tracks for primers and write them to files for viewing in a genome browser (e.g. IGV).

### Usage

    createPrimerTrack(object, color = 1)

    ## S4 method for signature 'TsIO'
    createPrimerTrack(object, color = 1)

    ## S4 method for signature 'TsIOList'
    createPrimerTrack(object, color = 1)

    exportPrimerTrack(..., con)

    primerDataFrame(object)

    ## S4 method for signature 'TsIO'
    primerDataFrame(object)

    ## S4 method for signature 'TsIOList'
    primerDataFrame(object)

### Arguments

`object` | A `TsIO` or `TsIOList` object containing designed primers.
`color` | Color used for the track (Default: black). Can be any of the three kinds of R color specifications.
`...` | One or more primer BED tracks created by `createPrimerTrack`.
`con` | Connection to which tracks are written. Typically a .bed file.

### Value

For `createPrimerTrack` a `data.frame` with the primer track in BED format.

### Functions

- `createPrimerTrack,TsIO-method`: Create primer BED track from `TsIO` objects

- `createPrimerTrack,TsIOList-method`: Create primer BED track from `TsIOList` objects

- `exportPrimerTrack`: Export primer BED tracks files

- `primerDataFrame,TsIO-method`: Create a `data.frame` with primer data from `TsIO`

- `primerDataFrame,TsIOList-method`: Create a `data.frame` with primer data from `TsIOList`

### Examples

    # chr11 primers example data
    data("chr11_primers")

    # pick best primers based on predicted off-targets
    best_primers <- pickPrimers(chr11_primers, n = 1, by = "off_targets")

    # primers data can be exported to a simple data.frame to e.g. write them to a .csv file
    primers_df <- primerDataFrame(best_primers)
    head(primers_df)

    # primer binding sites in transcript sequences can be converted to genomic coordinates to create
    # a BED track to visualize primers in a genome browser (e.g. IGV)

    # create primer BED track with a fancy color
    track <- createPrimerTrack(best_primers[1:5], color = "steelblue3")

    # tracks can be written to .bed files using a little helper function (replace con = "" by a file)
    exportPrimerTrack(track, con = "")

    ## Not run:
    # one can easily export primer tracks for multiple TsIO or TsIOList objects (e.g. inner and
    # outer nested primers) to one .bed file using different colors for each object. see vignette for
    # a practical example:
    vignette("tapseq_primer_design", package = "TAPseq")

    obj1 <- best_primers[1:5]
    obj2 <- best_primers[6:10]
    exportPrimerTrack(createPrimerTrack(obj1, color = "steelblue3"),
                      createPrimerTrack(obj2, color = "goldenrod1"),
                      con = "path/to/file.bed")

    ## End(Not run)

[Package TAPseq version 1.6.0 Index]