CleanBEDtoBG: CleanBEDtoBG

Description Usage Arguments Value Examples

View source: R/CleanBEDtoBG.R

Description

Writes a script to convert a BED file to a clean bedGraph file.

Usage

1
2
3
4
5
6
CleanBEDtoBG(
  in_bed,
  out_bedGraph = NA,
  unwanted_chromosomes = NULL,
  alignment = "hg19"
)

Arguments

in_bed

Name of sorted BAM file to be converted to a bedGraph file. Required.

out_bedGraph

Name of bedGraph output file, including full directory path; a string. Default in_bam prefix.

unwanted_chromosomes

A vector of unwanted chromosomes that are present in the BAM file.

alignment

The human genome alignment used, either "hg19" or "hg38". Default "hg19"

Value

deposits bedGraph from BED in same directory

Examples

1
2
3
4
5
6
7
8
9
bam <- system.file("extdata/chr4and5.bam", package="nearBynding")
out_bed <- "bamto.bed"
## convert BAM to BED
if(suppressWarnings(system2("bedtools", "--version",
stdout = NULL, stderr = NULL)) == 0){
    system2("bedtools", paste0("bamtobed -i ", bam, " > ", out_bed))
}
CleanBEDtoBG(in_bed = out_bed,
    alignment = "hg38")

vbusa1/nearBynding documentation built on Aug. 4, 2021, 4:08 p.m.