bam_to_reads: Convert BAM files into BED files containing the reads...

Description Usage Arguments Value Examples

View source: R/initiation_points_methods.R

Description

Convert BAM files into BED files containing the reads overlaping the specified annotations.

Usage

1
2
bam_to_reads(bamfile, annotations, paired_end = TRUE, as_fragments = TRUE,
  outfile = NULL, flanking_region = 0)

Arguments

bamfile

a character vector indicating the BAM file name. Note: The bamfile must be sorted by coordinates.

annotations

an object of type annotationsSet containing information on one genes.

paired_end

logical indicating whether the bamfile contains paired-end data.

as_fragments

logical indicating if paired-end data must be paired and merged to form fragments.

outfile

a character vector indicating the output file name. If not provided, the result will be internalized in R.

flanking_region

Number of bases before and after the gene ORF should be included.

Value

An object of type data.table with 9 columns.

chromosome Read chromosome.
start Read starting position.
end Read ending position.
name Query template name .
score Mapping quality.
ChromosomeNext Gene strand.
startNext Position of the mate/next read.
tlen observed read length.
flag bitwise flag.

Examples

1
2
3
bamfile <- system.file("extdata", "wt_rep1.bam", package = "yCrypticRNAs")
data(annotations)
bam_to_reads(bamfile, annotations)

yCrypticRNAs documentation built on May 29, 2017, 5:49 p.m.