test_tallyBAM <- function(){
  contigs <- c("ins3", "insx2", "indel", "delonly")
  tallies <- lapply( contigs, function(chrom){tallyBAM(system.file("unitTests/insert.bam", package = "h5vc"), chrom, 1, 7)})
  names(tallies) <- contigs
  counts <- sapply(contigs, function(chrom) rowSums(tallies[[chrom]][,,'+',]))
  expected <- read.table(system.file( "unitTests/expected.counts.txt", package = "h5vc"))
  checkEquals(counts, as.matrix(expected))
}