bamToBed: Convert BAM files to bed format

Description Usage Arguments Details Author(s) Examples

View source: R/bamToBed.R

Description

Take a list of BAM files and write a bed file for each one.

Usage

1
2
bamToBed(filenames, bedtoolsPath = "/opt/bedtools2/bin/", outDest = "./",
  outSuffix = "")

Arguments

filenames

Character - List of BAM files

bedtoolsPath

String - Path to bedtools directory

outDest

String - Directory where bed files should be written

outSuffix

String - will be appended to original filename (and ".bam" is replaced by ".bed")

Details

Use bedtools function bamToBed convert BAM files to bed format. Requires bedtools to be installed. Mitochondrial, unknown, and "random" reads should have been removed already (see sam_filter.R). If you give the output file a suffix with "outSuffix", you need to start it with a "_" or "." or whatever if you don't want it just smooshed onto the end of the input file name. TIME: For NucSeq data, ranged from ~2.5m for cb_p036_1 to ~14.5m for L4_RORb_1. Example at the command line: /opt/bedtools2/bin/bamToBed -i samplename.bam > samplename.bed

Author(s)

Emma Myers

Examples

1
2
3
samplenames = read.csv('samplenames.txt', comment.char='#')
filenames = paste(samplenames[,1], '_mapped_Aligned.out.bam', sep='')
bamToBed(filenames, bedtoolsPath = '/opt/bedtools2/bin/')

e-myers/rnaseq documentation built on May 20, 2019, 9:14 p.m.