makeChrTable: makeChrTable - Pulls out chromosome and length data from the...

Description Usage Arguments Details Value Examples

View source: R/makeChrTable.R

Description

makeChrTable – Pulls out chromosome and length data from the header of a bam file

Usage

1
makeChrTable(bamFile, splitFile = NULL, splitBy = NULL, verbose = TRUE)

Arguments

bamFile

string of location of a bam file to extract header data from

splitFile

GRanges object (of type chr, start and end: no strand or meta columns) of locations in which to split the assembly, such as previously determined locations of contig chimerism

splitBy

integer determining the average size contigs should be split by

verbose

if FALSE, no messages appear on terminal

Details

makeChrTable creates a table with chromosome name and chromosome length by extracting header data from the supplied bam file.

Value

a GRanges object of class ChrTable, containing information on the organism's chromosomes as extracted from the BAM file header.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#Get an example BAM file and generate a chromosome table featuring fragment names and lengths

example.bam <- list.files(file.path(system.file(package='contiBAIT'), 'extdata'), full.names=TRUE)[1]

chrTable <- makeChrTable(example.bam) 

show(chrTable)

dividedChr <- makeChrTable(example.bam, splitBy=1000000)

show(dividedChr)

oneillkza/ContiBAIT documentation built on June 1, 2020, 5:49 a.m.