LoadTrackFile: Load Track File to Dataframe.

View source: R/LoadTrack.R

LoadTrackFileR Documentation

Load Track File to Dataframe.

Description

Load Track File to Dataframe.

Usage

LoadTrackFile(
  track.file,
  track.folder = NULL,
  format = c("bam", "wig", "bw", "bedgraph"),
  meta.info = NULL,
  meta.file = "",
  bamcoverage.path = NULL,
  norm.method = c("RPKM", "CPM", "BPM", "RPGC", "None"),
  single.nuc = FALSE,
  single.nuc.region = NULL,
  bin.size = 10,
  bc.extra.para = NULL
)

Arguments

track.file

Track file, when track.folder is not NULL, determined by track.folder.

track.folder

Track file folder. Default: NULL.

format

Track file format, chosen from bam, wig, bw(bigwig), bedgraph(bedGraph).

meta.info

Track file metadata. The columns should be: SampleName (track.file without suffix), Type (sample with replicates information), Group (sample group). when meta.file is not NULL, determined by meta.file.Default: NULL.

meta.file

File contains track file metadata. Default: "".

bamcoverage.path

The path to bamCoverage, used when format is bam. Default: NULL (auto-detect).

norm.method

Methods to normalize the number of reads per bin, chosen from "RPKM", "CPM", "BPM", "RPGC", "None". Default: RPKM.

single.nuc

Logical value, whether to visualize at single nucleotide level. Default: FALSE.

single.nuc.region

Region for single.nuc. Default: NULL

bin.size

Size of the bins, in bases. Default: 50.

bc.extra.para

Extra parameters for bamCoverage, eg: "–effectiveGenomeSize 2700000000 –ignoreForNormalization chrX"

Value

A dataframe.

Examples

library(ggcoverage)
sample.meta <- data.frame(
  SampleName = c("Chr18_MCF7_ER_1", "Chr18_MCF7_ER_2", "Chr18_MCF7_ER_3", "Chr18_MCF7_input"),
  Type = c("MCF7_ER_1", "MCF7_ER_2", "MCF7_ER_3", "MCF7_input"),
  Group = c("IP", "IP", "IP", "Input")
)
# track folder
track.folder <- system.file("extdata", "ChIP-seq", package = "ggcoverage")
# load bigwig file
track.df <- LoadTrackFile(
  track.folder = track.folder, format = "bw",
  meta.info = sample.meta
)

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