plot_coverage {brainflowprobes} | R Documentation

## Plot coverage in nuclear and cytoplasmic RNA for candidate probe sequences.

### Description

`plot_coverage` plots the coverage of nuclear and cytoplasmic RNA from adult and prenatal human prefrontal cortex across a candidate or series of candidate probe sequences for BrainFlow. If the sequence spans splice junctions, the plot will include the introns. A good candidate sequence will be highly and evenly expressed in nuclear RNA.

### Usage

    plot_coverage(
      REGION,
      PDF = "regionCoverage_fractionedData.pdf",
      OUTDIR = tempdir(),
      COVERAGE = NULL,
      CODING_ONLY = FALSE,
      VERBOSE = TRUE
    )

### Arguments

`REGION` | Either a single hg19 genomic sequence including the chromosome, start, end, and optionally strand separated by colons (e.g., 'chr20:10199446-10288068:+'), or a string of sequences. Must be character. Chromosome must be proceeded by 'chr'.
`PDF` | The name of the PDF file. Defaults to `regionCoverage_fractionedData.pdf`.
`OUTDIR` | The default directory where `PDF` will be saved to.
`COVERAGE` | The output of brainflowprobes_cov for the input `REGION`. Defaults to `NULL` but it can be pre-computed and saved separately since this is the step that takes the longest to run. Also, this is the only step that depends on rtracklayer's functionality for reading BigWig files which does not run on Windows OS. So it could be run on a non-Windows machine, saved, and then shared with Windows users.
`CODING_ONLY` | A logical vector of length 1 specifying whether to subset the Annotated Genes to only the coding genes. That is, whether to subset the genes by whether they have a non-NA `CSS` value. The Annotated Genes are downloaded with `GenomicState::GenomicStateHub()`.
`VERBOSE` | A logical value indicating whether to print updates from the process of loading the data from the BigWig files.

### Value

`plot_coverage` plots all input sequences using `derfinderPlot::plotRegionCoverage()`. It returns a plot for each input candidate sequence listed in REGION. Each plot includes coverage of the sequence(s) in nuclear (N) and cytoplasmic (C) RNA isolated from adult (A) and fetal (F) prefrontal cortex, sequenced using two different library preparation methods. PolyA+ libraries (P) were generated using selection for polyadenylated transcripts, and RiboZero (R) libraries were generated using a ribosomal RNA depletion protocol.

Each plot also shows the overlapping genes beneath the coverage, and the genomic location. The title lists the nearest gene, the position of the sequence relative to the gene's canonical transcriptional start site (TSS), and further annotation information as described in the 'region' column from `bumphunter::matchGenes()`.

`plot_coverage` saves the results as regionCoverage_fractionedData.pdf in a temporary directory unless otherwise specified with `OUTDIR`.

### Author(s)

Amanda J Price

### Examples

    ## Here we use the pre-saved example coverage data such that this example
    ## will run fast!
    plot_coverage("chr20:10286777-10288069:+",
        COVERAGE = four_panels_example_cov
    )

    ## Without using COVERAGE, this function reads BigWig files from the web
    ## using rtracklayer and this functionality is not supported on Windows
    ## machines.
    if (.Platform$OS.type != "windows") {
        plot_coverage("chr20:10286777-10288069:+",
            PDF = "regionCoverage_fractionedData_fromScratch.pdf"
        )
    }
    ## Not run:

    ## These examples will take a few minutes to run!
    plot_coverage(c(
        "chr20:10286777-10288069:+",
        "chr18:74690788-74692427:-",
        "chr19:49932861-49933829:-"
    ))

    candidates <- c(
        "chr20:10286777-10288069:+",
        "chr18:74690788-74692427:-",
        "chr19:49932861-49933829:-"
    )

    ## General syntax:
    plot_coverage(candidates,
        PDF = "PDF_file.pdf",
        OUTDIR = "/path/to/directory/"
    )

    plot_coverage("chr20:10286777-10288069:+",
        PDF = "PDF_file.pdf", OUTDIR = "/path/to/directory/"
    )

    ## Explore the effect of changing CODING_ONLY
    ## Check how gene name and distance to TSS changes in the title of the plot
    ## (everything else stays the same)
    cov <- brainflowprobes_cov("chr10:135379301-135379311:+")
    plot_coverage("chr10:135379301-135379311:+", COVERAGE = cov)
    plot_coverage("chr10:135379301-135379311:+",
        COVERAGE = cov,
        PDF = "coding_only_plot_coverage", CODING_ONLY = TRUE
    )

    ## End(Not run)

[Package brainflowprobes version 1.6.0 Index]