dcjones / quip

Compressing next-generation sequencing data with extreme prejudice.
http://www.cs.washington.edu/homes/dcjones/quip/
BSD 3-Clause "New" or "Revised" License
78 stars 10 forks source link

quip test quiped BAM file fails. #5

Closed ghuls closed 12 years ago

ghuls commented 12 years ago

When testing a quip compressed BAM file, I get an error message:

$ /software/quip-git/src/quip -t -r ./Homo_sapiens_assembly19_sorted.fa ALLSIL-rg.bam.qp 
quip: ALLSIL-rg.bam: File already exists.
Would you like to overwrite it (y or n)? n

quip: ALLSIL-rg.bam.qp: Null format given.

Doesn't quip store the kind of file it compresses, so it knows the default output format?

Also the quip: ALLSIL-rg.bam: File already exists. line contains an additional character after .bam. Execute the following command in a terminal to see it:

printf 'quip: ALLSIL-rg.bam\177: File  already exists.\n'

strace ouput:

mmap(NULL, 276828160, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb938222000
mmap(NULL, 274432, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb98f183000
mmap(NULL, 1314816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb98e7ff000
mmap(NULL, 1314816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb98e6be000
mmap(NULL, 1314816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb98e57d000
mmap(NULL, 1314816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb98e43c000
mmap(NULL, 1314816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb98e2fb000
mmap(NULL, 1314816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb98e1ba000
mmap(NULL, 1314816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb98e079000
mmap(NULL, 1314816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb98df38000
mmap(NULL, 1314816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb98ddf7000
mmap(NULL, 1314816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb98dcb6000
mmap(NULL, 1314816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb98db75000
mmap(NULL, 1314816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb94e8e4000
mmap(NULL, 1314816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb94e7a3000
mmap(NULL, 88772608, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb932d79000
open("ALLSIL-rg.bam\177", O_WRONLY|O_CREAT|O_EXCL, 0600) = -1 EEXIST (File exists)
write(2, "quip: ALLSIL-rg.bam\177: File alrea"..., 43quip: ALLSIL-rg.bam: File already exists.
) = 43
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
write(2, "Would you like to overwrite it ("..., 41Would you like to overwrite it (y or n)? ) = 41
fstat(0, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 30), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb98f31f000
read(0,

  --> press n

"n\n", 1024)                    = 2
write(2, "\nquip: ALLSIL-rg.bam.qp: Null fo"..., 44
quip: ALLSIL-rg.bam.qp: Null format given.
) = 44
exit_group(1)                           = ?

When specifying the output file format, I get a segfault:

$ /software/quip-git/src/quip -t -o bam -r ./Homo_sapiens_assembly19_sorted.fa ALLSIL-rg.bam.qp 
quip: ALLSIL-rg.bam: File already exists.
Would you like to overwrite it (y or n)? n
Segmentation fault

Part of strace output:

mmap(NULL, 276828160, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9e86add000
mmap(NULL, 274432, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9edda3e000
mmap(NULL, 1314816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9edd0ba000
mmap(NULL, 1314816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9edcf79000
mmap(NULL, 1314816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9edce38000
mmap(NULL, 1314816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9edccf7000
mmap(NULL, 1314816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9edcbb6000
mmap(NULL, 1314816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9edca75000
mmap(NULL, 1314816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9edc934000
mmap(NULL, 1314816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9edc7f3000
mmap(NULL, 1314816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9edc6b2000
mmap(NULL, 1314816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9edc571000
mmap(NULL, 1314816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9edc430000
mmap(NULL, 1314816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9e9d19f000
mmap(NULL, 1314816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9e9d05e000
mmap(NULL, 88772608, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9e81634000
open("ALLSIL-rg.bam\177", O_WRONLY|O_CREAT|O_EXCL, 0600) = -1 EEXIST (File exists)
write(2, "quip: ALLSIL-rg.bam\177: File alrea"..., 43quip: ALLSIL-rg.bam: File already exists.
) = 43
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
write(2, "Would you like to overwrite it ("..., 41Would you like to overwrite it (y or n)? ) = 41
fstat(0, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 30), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9eddbda000
read(0,

    -->  type "n"

"n\n", 1024)                    = 2
brk(0xf23000)                           = 0xf23000
brk(0xf44000)                           = 0xf44000
brk(0xf74000)                           = 0xf74000
brk(0xf64000)                           = 0xf64000
brk(0xf54000)                           = 0xf54000
brk(0xf44000)                           = 0xf44000
brk(0xf34000)                           = 0xf34000
brk(0xf33000)                           = 0xf33000
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Segmentation fault
dcjones commented 12 years ago

Thanks for spotting this. I have bit of a logic error in handling output formats. I'll get a fix out this evening when I have a chance.