dnanexus-rnd / GLnexus

Scalable gVCF merging and joint variant calling for population sequencing projects
Apache License 2.0
137 stars 36 forks source link

glnexus_cli with Singularity - GLnexus.DB "directory already exists" #294

Closed ama249 closed 7 months ago

ama249 commented 8 months ago

Hi DNAnexus team,

I'm currently trying to use a Singularity image of GLnexus 1.4.1 to merge a few single-called Google deepvariant genome.vcf.gz files, using the following command:

singularity exec --bind /path/to/script/dir:/mnt /separate/path/to/glnexus_1.4.1.sif glnexus_cli --config DeepVariantWGS --bed /mnt/input/regions.bed --mem-gbytes 16 --threads 8 /mnt/input/sample1.genome.vcf.gz /mnt/input/sample2.genome.vcf.gz /mnt/input/sample3.genome.vcf.gz /mnt/input/sample4.genome.vcf.gz > /path/to/script/dir/output/merged.bcf

Note that I've used the bind directory paths for the input gVCFs & the BED file, but used the standard path for the redirected output BCF, though they're technically point to the same thing (I couldn't get the command to work otherwise).

However, I keep getting the follwing error:

[GLnexus] [info] glnexus_cli release v1.4.1-0-g68e25e5 Aug 13 2021
[GLnexus] [info] detected jemalloc 5.2.1-0-<long hash>
[GLnexus] [info] Loading config preset DeepVariantWGS
[GLnexus] [info] config:
<config values key-value pairs>
[GLnexus] [info] config CRC32C = <long number>
[GLnexus] [info] init database, exemplar_vcf=/mnt/input/sample1.genome.vcf.gz
[GLnexus] [error] Failed to initialize database: IOError: Database directory already exists (GLnexus.DB)

The documentation says that the database directory is created at $(pwd)/GLnexus.DB, but using find . -name "*GLnexus.DB" -type d returns nothing. I'm not sure where this directory is actually being created at this point, so that I can delete it & re-run my command.

Could you kindly help me figure this out?

P.S. This is an isolated remote environment so I don't have admin access to anything here.

Regards

mtinti commented 7 months ago

I spent the last two hour trying to figuring this out. I realized that singularity was creating the GLnexus.DB in my home directory, so I came up with this solution:

temp_home=$(mktemp -d)
singularity run --home "$temp_home:/home/$USER" -B ...
rm -r "$temp_home"
ama249 commented 7 months ago

@mtinti This worked perfectly for me, thank you very much!