Load Track File to Dataframe.

LoadTrackFile(
  track.file,
  track.folder = NULL,
  format = c("bam", "wig", "bw", "bedgraph", "txt"),
  region = "chr14:21,677,306-21,737,601",
  extend = 2000,
  gtf.gr = NULL,
  gene.name = "HNRNPC",
  gene.name.type = c("gene_name", "gene_id"),
  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,
  n.cores = 1
)

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) and txt.

region

Region used to create coverage plot, eg: chr14:21,677,306-21,737,601 or chr14:21,677,306. Default: "chr14:21,677,306-21,737,601"

extend

Extend length of region. Default: 2000.

gtf.gr

Granges object of GTF, created with import.gff. Default: NULL.

gene.name

The name of gene. Default: HNRNPC.

gene.name.type

Gene name type (filed of gtf.gr), chosen from gene_name and gene_id. Default: gene_name.

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"

n.cores

The number of cores to be used for this job. Default:1.

Value

A dataframe.

Examples

library(ggcoverage) library(utils) meta.file <- system.file("extdata", "RNA-seq", "meta_info.csv", package = "ggcoverage") sample.meta <- utils::read.csv(meta.file) # track folder track.folder <- system.file("extdata", "RNA-seq", package = "ggcoverage") # load bigwig file track.df <- LoadTrackFile( track.folder = track.folder, format = "bw", region = "chr14:21,677,306-21,737,601", extend = 2000, meta.info = sample.meta )