CleanBAMtoBG: CleanBAMtoBG

Description Usage Arguments Value Examples

View source: R/CleanBAMtoBG.R

Description

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

Usage

1
CleanBAMtoBG(in_bam, out_bedGraph = NA, unwanted_chromosomes = NULL)

Arguments

in_bam

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

out_bedGraph

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

unwanted_chromosomes

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

Value

deposits bedGraph from BAM in same directory

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
bam <- system.file("extdata/chr4and5.bam", package="nearBynding")
#sort BAM first
sorted_bam<-Rsamtools::sortBam(bam, "chr4and5_sorted")
CleanBAMtoBG(in_bam = sorted_bam)

## Not run: 
    ## If BAM has unwanted chromosome "EBV"
    ## this file is from ENCODE database
    CleanBAMtoBG(in_bam = "ENCFF288LEG.bam",
                    unwanted_chromosomes = "EBV")

## End(Not run)

nearBynding documentation built on Nov. 8, 2020, 8:15 p.m.