CleanBAMtoBG {nearBynding} | R Documentation |
Writes a script to convert a BAM file to a clean bedGraph file.
CleanBAMtoBG(in_bam, out_bedGraph = NA, unwanted_chromosomes = NULL)
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. |
deposits bedGraph from BAM in same directory
bam <- system.file("extdata/chr4and5.bam", package="nearBynding") #sort BAM first sorted_bam<-Rsamtools::sortBam(bam, "chr4and5_sorted") CleanBAMtoBG(in_bam = sorted_bam) ## If BAM has unwanted chromosome "EBV" ## this file is from ENCODE database CleanBAMtoBG(in_bam = "ENCFF288LEG.bam", unwanted_chromosomes = "EBV")