prokka icon indicating copy to clipboard operation
prokka copied to clipboard

Suggestion: improve the readme with better instructions for running docker to resolve error message "XXXX is not a readable non-empty FASTA file"

Open dr-joe-wirth opened this issue 1 year ago • 1 comments

I was working with the docker image, and kept getting the error contig.fa is not a readable non-empty FASTA file. I was using the following command as it is described in the readme:

docker run staphb/prokka:latest prokka contigs.fa

but this always failed to read the file. I checked, and sure enough ./contigs.fa existed and was 3.2MB in size. I ran chmod a+r contigs.fa but this did not resolve the issue.

After a little sleuthing, I realized this bug was occurring because I was not mounting a drive when invoking docker. I suggest adding the following details to the readme so that others do not repeat the same mistake:

docker run -v <absolute path to folder containing contigs.fa>:/mydata staphb/prokka:latest prokka --outdir /mydata/annotation /mydata/contigs.fa

Mounting the folder as a volume (-v) and then specifying the path from the mounted volume within the docker container resolves the issue of prokka not finding the file. The flag --outdir is absolutely necessary or the results will not be written to the user's local machine.

dr-joe-wirth avatar Oct 21 '22 16:10 dr-joe-wirth

Thank you for the comment! I also encountered similar issues while using singularity. Your comment saved me! For other people who might be interested in using singularity: you also need to "bind" the path for singularity prokka to recognize your local files. Here is the adjusted code I used for singularity:

singularity exec --bind /local/path/fasta:/mydata prokka.sif prokka --outdir /mydata/filename.fasta  /mydata/filename.fasta

The /local/path/fasta would be where your filename.fasta file is stored on your local environment, so change accordingly, and it has to be absolute path. The /mydata is the path within singularity and can be arbitrary, as long as it's consistent throughout the code above. Hope this helps for singularity users.

huoww07 avatar Oct 27 '22 02:10 huoww07