importPEBamFiles: A function to import paired end bam files as GRanges

Description Usage Arguments Value Examples

View source: R/bamutils.R

Description

This function takes bam file paths and read them into GRanges objects. Note: Can be quite lengthy for .bam files with 5+ millions fragments.

Usage

1
2
3
4
5
6
7
8
9
importPEBamFiles(
  files,
  genome = NULL,
  where = NULL,
  max_insert_size = 1000,
  shift_ATAC_fragments = FALSE,
  cores = 10,
  verbose = TRUE
)

Arguments

files

character vector, each element of the vector is the path of an individual .bam file.

genome

character, genome ID (e.g. sacCer3, ce11, dm6, danRer10, mm10 or hg38).

where

GRanges, only import the fragments mapping to the input GRanges (can fasten the import process a lot).

max_insert_size

Integer, filter out fragments larger than this size.

shift_ATAC_fragments

Boolean, if the fragments come from ATAC-seq, one might want to shift the extremities by +5 / -4 bp.

cores

Integer, number of cores to use when indexing bam files

verbose

Boolean

Value

A GRanges object containing fragments from the input .bam file.

Examples

1
2
3
4
5
6
bamfile <- system.file("extdata", "ex1.bam", package = "Rsamtools")
fragments <- importPEBamFiles(
    bamfile, 
    shift_ATAC_fragments = TRUE
)
fragments

VplotR documentation built on Nov. 8, 2020, 7:50 p.m.