Function counts the reads mapped to each chromosome and plots a bar graph. It uses the function idxstatsBam() from the Rsamtools R package. Run help("idxstatsBam") for more information.

chromReads(bamfile, bamindex = NULL, chr.filt = "", main = NULL, main.size = 13, subtitle = NULL, sub.size = 11, xlab = "Mapped reads", ylab = "Chromosome", axis.size = 9, percent.label = T, percent.size = 3)

Arguments

bamfile

Character of lenght 1. Path to the BAM file whose reads are to be mapped.

bamindex

Character of length 1 or NULL. Path to the index of the BAM file in 'bamfile'. If null, it will search a file with the same base name as the 'bamfile' and extension '.bam.bai'. Default: NULL

chr.filt

Character. Vector of undefined length with strings to filter chromosomes (i.e. "Un" would filter all chromosomes containing "Un" in their name). Default: c("Un", "random", "GL", "JH", "\*").

main

Character of lenght 1. Title of the plot. Default: NULL.

main.size

Numeric of length 1. Font size of the title. It works only if main is not NULL. Default: 13.

subtitle

Character of lenght 1. Subtitle of the bar plot. It works only if main is not NULL. Default: NULL.

sub.size

Numeric of length 1. Font size of the subtitle. It works only if main is not NULL. Default: 11.

xlab

Character of lenght 1. Title of the X axis. Default: "Mapped reads".

ylab

Character of lenght 1. Title of the Y axis. Default: "Chromosome".

axis.size

Numeric of length 1. Size of the axis labels. Default: 9

percent.label

Logical of lenght 1. If TRUE, it draws the percentage of reads in each chromosome.

percent.size

Character of lenght 1. Size of the percentage drawn in the plot.

Author

amitjavilaventura