tx_load_bam: Read paired end bam file by yield size

View source: R/tx_core.R

tx_load_bamR Documentation

Read paired end bam file by yield size

Description

Reads a file in BAM format by blocks of lines equal to a yield size, either automatically calculated or specified by the user, and loads it as a GenomicAlignments object.

Usage

tx_load_bam(
  file,
  pairedEnd,
  yieldSize = 1e+05,
  scanFlag = "default",
  loadSeq = FALSE,
  strandMode = 1,
  loadSecondaryAligns = NA,
  verbose = TRUE
)

Arguments

file

character. Path to the file to read

pairedEnd

logical. Set to FALSE if reads in BAM file are single-end, set to TRUE if reads are paired-end.

yieldSize

numeric. Number of reads to be processed at a time

scanFlag

integer. Flag used to filter reads. Built with the scanBamFlag function.

loadSeq

logical. Set to TRUE for loading the sequences contained in the BAM file

strandMode

numeric.

  • 1 (default): Strand of the pair is that of its first alignment: Directional Illumina (Ligation), Standard SOLiD. (Single-end No change in strand)

  • 2: strand of the pair is strand of its last alignment: dUTP, NSR, NNSR, Illumina stranded TruSeq PE protocol. (Single-end: Change to inverse strand)

  • 0: strand of the pair is set to '*' (unspecified). This mode is no longer supported by tx_reads() .

More info: GAlignmentPairs-class.

loadSecondaryAligns

logical. Set to FALSE to discard alignments labeled in the BAM file as secondary and load only primary alignments, set to TRUE to load only secondary alignments, leave as NA to load both primary and secondary alignments.

verbose

logical. Set to FALSE to show less information.

Value

GRanges

Examples

# Loading in-package BAM file
bamFile <- system.file("extdata", "example_hg19.bam", package = "txtools")
hg19_bam <- tx_load_bam(bamFile, pairedEnd = TRUE, loadSeq = TRUE, verbose = TRUE)
summary(hg19_bam)

AngelCampos/txtools documentation built on Sept. 16, 2024, 10:25 p.m.