brentp / smoove

structural variant calling and genotyping with existing tools, but, smoothly.
Apache License 2.0
222 stars 21 forks source link

cannot rm quantized.bed.gz.csi #186

Closed jkreinz closed 2 years ago

jkreinz commented 2 years ago

Hi there,

Thanks so much for this software. Truly impressive!

I'm repeatedly running into the following error even when starting with a clean results folder. I've exported a tmp for which I have read and write error, but it seems like the issue might be with mosdepth which seems to get called without options.

The call is: ohta1/apps/smoove call --outdir female_smoove --name 342 --fasta $reference_fasta -p 1 --genotype ../female_bams/342.dd.bam

Out to screen:

[smoove] 2022/02/06 17:56:40 starting with version 0.2.8
[smoove] 2022/02/06 17:56:40 calculating bam stats for 1 bams
[smoove] 2022/02/06 17:56:57 done calculating bam stats
[smoove]: ([E]lumpy-filter) 2022/02/06 17:59:36 [lumpy_filter] extracted splits and discordants from 126866930 total aligned reads
[smoove]:2022/02/06 17:59:37 finished process: lumpy-filter (set -eu; lumpy_filter -f ~/waterhemp/data/fixed_assembly/reveal_psuedoassembly/toshare/AMATA_finishe) in user-time:6m10.864391s system-time:29.195357s
Usage: mosdepth [options] <prefix> <BAM-or-CRAM>
rm: cannot remove ‘/ohta2/julia.kreiner/commongarden_results/female_bams/secondhalf/lumpy_sv/female_smoove/tmp/smoove-mosdepth-493136642.quantized.bed.gz.csi’: No such file or directory
panic: exit status 1

goroutine 28006 [running]:
github.com/brentp/smoove/lumpy.check(...)
        /home/brentp/src/smoove/lumpy/lumpy.go:54
github.com/brentp/smoove/lumpy.remove_sketchy(0xc00002c240, 0x1a, 0x3e8, 0x7ffc2f284596, 0x65, 0x0, 0x0, 0xc000288480, 0x4, 0x4, ...)
        /home/brentp/src/smoove/lumpy/depthfilter.go:232 +0x1825
github.com/brentp/smoove/lumpy.remove_sketchy_all.func1(0xc0001b6120, 0x3e8, 0x7ffc2f284596, 0x65, 0x0, 0x0, 0xc000288480, 0x4, 0x4, 0x1, ...)
        /home/brentp/src/smoove/lumpy/depthfilter.go:399 +0x231
created by github.com/brentp/smoove/lumpy.remove_sketchy_all
        /home/brentp/src/smoove/lumpy/depthfilter.go:397 +0x194

Thanks, Julia

brentp commented 2 years ago

Hi Julia, thanks for reporting. I'm guessing something is happening because your bam file is small or has very few split/discordant reads. Can you show the output of ls -lh $outdir after the smoove run fails? where $outdir is the full path to female_smoove ?

jkreinz commented 2 years ago

Thanks Brent. My original bams have 30x coverage so I wouldn't have thought bam file size would be an issue. The error also occurred for most if not all samples when I did a parallelized run across 200 bams.

> ls -lh /ohta2/julia.kreiner/commongarden_results/female_bams/secondhalf/lumpy_sv/female_smoove
total 3.0G
-rw-rw-r--. 1 julia.kreiner julia.kreiner 774M Feb  6 17:59 342.disc.bam
-rw-rw-r--. 1 julia.kreiner julia.kreiner  96K Feb  6 18:00 342.disc.bam.csi
-rw-rw-r--. 1 julia.kreiner julia.kreiner 774M Feb  6 17:59 342.disc.bam.orig.bam
-rw-rw-r--. 1 julia.kreiner julia.kreiner 7.3K Feb  6 17:56 342.histo
-rw-rw-r--. 1 julia.kreiner julia.kreiner 727M Feb  6 17:59 342.split.bam
-rw-rw-r--. 1 julia.kreiner julia.kreiner 727M Feb  6 17:59 342.split.bam.orig.bam
drwxrwxr-x. 3 julia.kreiner julia.kreiner    3 Feb  7 12:40 tmp
brentp commented 2 years ago

Thanks, I think you are right that it's not that. here's other things I can think of:

  1. How is your $TMPDIR specified? Is it a full path?
  2. Can you try running with --outdir as a full path?
  3. Does /ohta2/julia.kreiner/commongarden_results/female_bams/secondhalf/lumpy_sv/female_smoove/tmp/smoove-mosdepth-493136642.quantized.bed.gz.csi exist after the run?
  4. Were these aligned with bwa-mem?
brentp commented 2 years ago

Oh, actually, I think the most promising is to make sure you have a recent version of mosdepth and that's the version that smoove finds. Maybe an old version is getting called and it doesn't understand some of the options.

As a backup, there's also something similar in #30 related to NFS, so maybe you can try TMPDIR as a directory that's local to the instance and not networked.

jkreinz commented 2 years ago

updating mosdepth did the trick! thanks for the quick fix.

brentp commented 2 years ago

glad you got it sorted.