Illumina / hap.py

Haplotype VCF comparison tools
Other
402 stars 122 forks source link

Can't find reference #188

Open ktruve opened 1 month ago

ktruve commented 1 month ago

Hi,

I installed hap.py with apptainer. When trying to run with the following command: apptainer run hap.py_latest.sif /opt/hap.py/bin/hap.py truth.vcf comp.vcf -f HG002_GRCh38_1_22_v4.2.1_benchmark_noinconsistent.bed -o HG002_hg38_comp -r full_path_to.fasta

I get the following error: 2024-05-30 12:23:05,656 WARNING No reference file found at default locations. You can set the environment variable 'HGREF' or 'HG19' to point to a suitable Fasta file. 2024-05-30 12:23:05,664 WARNING No reference file found at default locations. You can set the environment variable 'HGREF' or 'HG19' to point to a suitable Fasta file. 2024-05-30 12:23:05,895 ERROR Please specify a valid reference path using -r. 2024-05-30 12:23:05,896 ERROR Traceback (most recent call last): 2024-05-30 12:23:05,896 ERROR File "/opt/hap.py/bin/hap.py", line 508, in 2024-05-30 12:23:05,896 ERROR main() 2024-05-30 12:23:05,896 ERROR File "/opt/hap.py/bin/hap.py", line 208, in main 2024-05-30 12:23:05,896 ERROR raise Exception("Please specify a valid reference path using -r.") 2024-05-30 12:23:05,896 ERROR Exception: Please specify a valid reference path using -r.

Please help me how to solve this problem. I have tried to write export HGREF=$ref_genome_path which doesn't help

Best, Katarina

pgonzale60 commented 1 week ago

Hi Katarina,

I had the same issue and didn't manage to overcome in apptainer/singularity nor in docker. In both cases it failed with Please specify a valid reference path using -r. I ensured that the environmental variable was set by explicitly calling sh and doing echo $HGREF, which showed me the environmental variable was set inside the container but the script was unable to detect it. I suspect it might have to do with which paths are available from the container, but even after attaching the relevant directories with presumed correct inside container paths, not working.

Have you seen this other issue? Axel shares his recommendations on singularity command.

Best, Pablo

P.S. What worked for me was to use the installation script in a conda environment with the requirements.