makeChrTable {contiBAIT} | R Documentation

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

### Description

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

### Usage

    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

    #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)

[Package contiBAIT version 1.14.0 Index]