pangenome / pggb

the pangenome graph builder
https://doi.org/10.1038/s41592-024-02430-3
MIT License
365 stars 40 forks source link

Running pggb with singularity fails #291

Closed RobinVanSchendel closed 1 year ago

RobinVanSchendel commented 1 year ago

I am trying to start pggb user the user manual:

https://github.com/pangenome/pggb#singularity

with the command

singularity run -B ${PWD}/data:/data ../pggb_latest.sif "pggb -i /data/HLA/DRB1-3123.fa.gz -p 70 -s 3000 -G 2000 -n 10 -t 16 -v -V 'gi|568815561:#' -o /data/out -M -m"

However that command seems to be incorrect:

FATAL: stat /home/rvanschendel/pggb -i /data/HLA/DRB1-3123.fa.gz -p 70 -s 3000 -G 2000 -n 10 -t 16 -v -V 'gi|568815561:#' -o /data/out -M -m: no such file or directory

Fair enough, I guess the double quote are not required:

singularity run -B ${PWD}/data:/data ../pggb_latest.sif pggb -i /data/HLA/DRB1-3123.fa.gz -p 70 -s 3000 -G 2000 -n 10 -t 16 -v -V 'gi|568815561:#' -o /data/out -M -m

this results in:

Illegal option --

The singularity command runs fine as:

singularity run -B ${PWD}/data:/data ../pggb_latest.sif pggb

shows me the help. The most simple example:

run -B ${PWD}/data:/data ../pggb_latest.sif pggb -i /data/HLA/DRB1-3123.fa.gz -n 10

also results in

Illegal option --

I also tried the previous Docker image, but that gives the same result. Am I doing something wrong here? Any idea on how to get this working?

subwaystation commented 1 year ago

For me

docker run -it -v ${PWD}/data/:/data ${USER}/pggb /bin/bash -c "pggb -i /data/HLA/DRB1-3123.fa.gz -p 70 -s 3000 -G 2000 -n 10 -t 16 -v -V 'gi|568815561:#' -o /data/i4 -M -m"

works using Docker. I suspect you have to change your command line to

singularity run -B ${PWD}/data:/data ../pggb_latest.sif /bin/bash -c "pggb -i /data/HLA/DRB1-3123.fa.gz -p 70 -s 3000 -G 2000 -n 10 -t 16 -v -V 'gi|568815561:#' -o /data/out -M -m"

Also make sure that you actually are in the directory where you cloned the pggb repository from. Because that's where your input data is coming from.

RobinVanSchendel commented 1 year ago

I tried your last command:

rvanschendel@res-hpc-lo02:/exports/humgen/rvanschendel/pggb$ singularity run -B ${PWD}/data:/data ../pggb_latest.sif /bin/bash -c "pggb -i /data/HLA/DRB1-3123.fa.gz -p 70 -s 3000 -G 2000 -n 10 -t 16 -v -V 'gi|568815561:#' -o /data/out -M -m"

but the result is the same:

Illegal option --

any more ideas? I am running on a HPC so I have no access to Docker unfortunately.

subwaystation commented 1 year ago

The only thing that comes to my mind is to replace run with exec. Else I suspect that there is an issue with how you bring in the data from the outside. But I would not know how to fix it, sorry. I am not a Singularity expert.

Anyhow, what I am doing on our cluster is just use https://github.com/nf-core/pangenome. It works flawlessly with Singularity. It's a Nextflow implementation of PGGB. The current dev branch has been tested a lot, so you should be fine.

RobinVanSchendel commented 1 year ago

the Nextflow approach indeed does the trick!