Open Zero-Sun opened 1 year ago
The only thing I can see on first glance is that you are missing a space between the -B
and the argument.
singularity run -B$TMPDIR:$TMPDIR,"${WORK_DIR}":/mnt \
Could that be the cause of your troubles?
Sorry, the missing space was a paste error. In fact, I have used the correct command many times, but this error is still reported.
I situations like this where the error makes no sense I find that it is often useful to try to do the same thing in multiple different ways. Sometimes that provides insight. So here, I would suggest 3 things to try.
First change the command /opt/deepvariant/bin/run_deepvariant
to ls -l /mnt
and see what that turns up.
Second, try removing the -B
option argument pair from the script and instead export the APPTAINER_BINDPATH
env var to set up the bind mounts.
Third, change your run
command to an exec
command (since it seems like you really want to be using exec anyway here.)
If you can provide the def file you used to create the container and also tell us what version of singularity/apptainer you are running, that might be useful to us as we try to figure out how to debug. Thanks!
Thanks again for your guidance, but it didn't work, looking forward to your further help. I installed deepvariant like this.
singularity pull docker://google/deepvariant:"1.4.0"
My environment configuration is as follows.
singularity --version
singularity version 3.5.3-1.1.el7
export TMPDIR="$PWD/tmp_dir"
export SINGULARITY_BIND="/path1/4_Test/qingjiang/dpv:/mnt"
Shows the correct directory.
singularity exec /path2/1_Software/dpv/deepvariant_1.4.0.sif ls -l /mnt
QJref.fa input.bam QJref.fa.fai input.bam.bai tmp_dir
When I run the command, I still get the same error as last time.
singularity exec /path2/1_Software/dpv/deepvariant_1.4.0.sif /opt/deepvariant/bin/run_deepvariant \
--model_type=PACBIO \
--ref=/mnt/QJref.fa \
--reads=/mnt/input.bam \
--output_vcf=/mnt/output.vcf.gz \
--intermediate_results_dir $TMPDIR/intermediate_results_dir
[E::hts_open_format] Failed to open file "/mnt/input.bam" : No such file or directory
Perhaps there is a bug with deepvariant that prevents it from parsing paths properly? Or perhaps the error message is misleading and the issue is actually that the file type is incorrect or corrupted or something? You could try cd-ing to the /mnt directory and calling all commands from there. You could do so like this:
singularity exec /path2/1_Software/dpv/deepvariant_1.4.0.sif sh -c "cd /mnt ; /opt/deepvariant/bin/run_deepvariant \
--model_type=PACBIO \
--ref=QJref.fa \
--reads=input.bam \
--output_vcf=output.vcf.gz \
--intermediate_results_dir $TMPDIR/intermediate_results_dir"
I will also note that you are running a version of singularity that is 3 years old (and contains known security flaws). You should really (really) update. I would suggest updating to the latest version of Apptainer and then trying your command again. Maybe it will correct the issue.
It doesn't work. Unfortunately, I also cannot ask the cluster manager to update singularity. I still thank you so much for all your help!
Hi, I have such a problem when I run deepvariant with singularity. When I use the absolute path of the host, the following error is reported, and then I try to mount the path and it still doesn't work. please help me!
ValueError: NOT_FOUND: Could not open Absolute_path/input.bam [E::hts_open_format] Failed to open file "Absolute_path/input.bam" : No such file or directory
First I verify that my host directory is successfully mounted to the container directory/mnt/QJref.fa /mnt/input.bam
Then I ran the following script.
The core error is
ValueError: NOT_FOUND: Could not open /mnt/input.bam [E::hts_open_format] Failed to open file "/mnt/input.bam" : No such file or directory
However, I have verified the existence of /mnt/input.bam. The complete error information is as follows. Sincerely look forward to your help! thank you!