question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IOError: [Errno 2] could not open alignment file

See original GitHub issue

Hi there, I know this particular error has come up a few times now on different issues (e.g. https://github.com/FRED-2/OptiType/issues/66), but I believe I have taken all the steps mentioned in the solution and am still receiving an error message (I am using the same folder I mounted as my output folder).

I am trying to run OptiType via docker using Docker Desktop for windows, and using fished fastq files that were successfully generated by razerS3. The command I am trying is:

docker run -v D:\Test:/data/ -t fred2/optitype -i D:\sample_fished.fastq -r -o /data/ Which returns: IOError: [Errno 2] could not open alignment file /data/2020_09_03_18_16_20/2020_09_03_18_16_20_1.bam: No such file or directory

D:\Test is an empty folder. I have similarly tried using an empty folder on my C: drive, and get the same message. Since this runs off of a linux subsystem, I have also tried replacing the windows filepaths with the corresponding linux subsystem filepaths, which returns an entirely new error:

docker run -v /mnt/d/Test:/data/ -t fred2/optitype -i /mnt/d/sample_fished.fastq -r -o /data/ OSError: [Errno 13] Permission denied: ‘/data/2020_09_03_18_19_00’

I have ensured that these folders have full permissions for user and group. Attempting to write to ~ (/home/username/) gives the same result. Any advice would be greatly appreciated!

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

1reaction
CiCistarcommented, Nov 24, 2021

I fixed this problem, it is beacause when we run the images, its default user is “bioxxx”(I forget the name), but the “root” is required to execute the command of OptiTypePipeline.py. So we must use the command with --user root . For example, sudo docker run -v $(pwd)/test:/data/ --user root -t fred2/optitype -i NA11995_SRR766010_1_fished.fastq -d -o /data/. Meanwhile, the test dir is my data dir which include NA11995_SRR766010_1_fished.fastq file.

0reactions
CiCistarcommented, Nov 24, 2021

Another thing important, if you are using Windows, you should also pay attention to using the shell with administrator privileges.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IOError: [Errno 93] could not open alignment file `https://...`
I'm running 0.15.2 built locally on OSX so I may need to build pysam locally anyway. It works on OSX because libcurl is...
Read more >
Python FileNotFoundError: [Errno 2] No such file or directory ...
This error tells you that you are trying to access a file or folder that does not exist. To fix this error, check...
Read more >
BioPython: IOError: [Errno 2] No such file or directory
I'm trying to convert a FASTQ (generated from a Illumina Miseq mate paired genome sequence) file to FASTA and eventually convert that to ......
Read more >
9. Input/Output — Python course 1.5 documentation
If the file cannot be opened because of inadequate permissions on the file system, ... line 1, in <module> FileNotFoundError: [Errno 2] No...
Read more >
pysam documentation - Read the Docs
AlignmentFile ). 2. If header is given, the header is built from a multi-level dictionary. ... Raises IOError – if file could not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found