The test example works fine, but when I run it on some small test bams of my own I get a segfault:
> library(deepSNV)
> regions <- GRanges("chr6", IRanges(start = 45422511, end=45422911))
> files <- c("/home/nicholas_calicolabs_com/test_ref.bam", "/home/nicholas_calicolabs_com/test_test.bam")
> loadAllData(files, regions, q=30)
*** caught segfault ***
address (nil), cause 'memory not mapped'
Traceback:
1: bam2R(f, regions$chr[j], regions$start[j], regions$stop[j], ...)
2: FUN(X[[i]], ...)
3: lapply(X = X, FUN = FUN, ...)
4: mclapply(files, function(f) { test.matrix <- matrix(0, ncol = length(nucleotides), nrow = rows) for (j in 1:nrow(regions)) { test.matrix[beg[j]:end[j], ] = bam2R(f, regions$chr[j], regions$start[j], regions$stop[j], ...)[, nucleotides] } mode(test.matrix) <- "integer" test.matrix}, mc.cores = mc.cores)
5: loadAllData(files, regions, q = 30)