geom_gc: Add GC Content Annotation to Coverage Plot.

View source: R/geom_gc.R

geom_gcR Documentation

Add GC Content Annotation to Coverage Plot.

Description

Add GC Content Annotation to Coverage Plot.

Usage

geom_gc(
  fa.file = NULL,
  bs.fa.seq = NULL,
  chr.split = "[[:space:]]",
  guide.line = NULL,
  line.color = "black",
  guide.line.color = "red",
  guide.line.type = "dashed",
  plot.space = 0.1,
  plot.height = 0.2
)

Arguments

fa.file

Genome fasta file. Default: NULL.

bs.fa.seq

BSgenome for species. Default: NULL.

chr.split

Split between chromosome name and description in fa.file. Default: "[[:space:]]".

guide.line

GC content guide line. Default: NULL (use mean GC content).

line.color

GC line color. Default: "black".

guide.line.color

The color of guide line. Default: "red".

guide.line.type

The line type of guide line. Default: "dashed".

plot.space

Top and bottom margin. Default: 0.1.

plot.height

The relative height of GC content annotation to coverage plot. Default: 0.2.

Value

Plot.

Examples

library(ggcoverage)
library(utils)
library(rtracklayer)
library("BSgenome.Hsapiens.UCSC.hg19")
# track folder
track.file <- system.file("extdata", "DNA-seq", "CNV_example.txt", package = "ggcoverage")
track.df <- utils::read.table(track.file, header = TRUE)
gtf.file <- system.file("extdata", "used_hg19.gtf", package = "ggcoverage")
gtf.gr <- rtracklayer::import.gff(con = gtf.file, format = "gtf")
basic.coverage <- ggcoverage(
  data = track.df, color = NULL, mark.region = NULL,
  region = "chr4:61750000-62,700,000", range.position = "out"
)
basic.coverage + geom_gc(bs.fa.seq = BSgenome.Hsapiens.UCSC.hg19)

ggcoverage documentation built on Sept. 6, 2022, 9:06 a.m.