Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

single_easy_bin failing [Errno 22] Invalid argument #97

Closed
jserrana opened this issue May 13, 2022 · 4 comments
Closed

single_easy_bin failing [Errno 22] Invalid argument #97

jserrana opened this issue May 13, 2022 · 4 comments

Comments

@jserrana
Copy link

Hi SemiBin support team,

Thanks for your work on developing this tool. I am working on an ultra-deep metagenomics dataset, but I was getting an Errno 22 when running the single_easy_bin option. I tried to run it with the test data but still get the same error. I'm wondering if its my installation that causes this error, but upon checking with SemiBin check_install, all dependencies are okay.

Any suggestions or possible workaround would be very much appreciated. I've tried -t 1, and -t 6, and added a pre-trained dataset (--environment global) to no avail too.

I installed the package via bioconda (SemiBin v1.0.1), and run with this command: $ SemiBin single_easy_bin -i input.fasta -b input.sorted.bam -o output

2022-05-13 13:21:04,678 - Generate training data.
2022-05-13 13:21:05,086 - Calculating coverage for every sample.
2022-05-13 13:21:05,088 - Processing input.sorted.bam
Traceback (most recent call last):
File "/home/miniconda3/envs/SemiBin/lib/python3.9/site-packages/SemiBin/error.py", line 18, in call
result = self.__callable(*args, **kwargs)
File "/home/miniconda3/envs/SemiBin/lib/python3.9/site-packages/SemiBin/generate_coverage.py", line 129, in generate_cov
contig_cov.to_csv(ofile)
File "/home/miniconda3/envs/SemiBin/lib/python3.9/contextlib.py", line 126, in exit
next(self.gen)
File "/home/miniconda3/envs/SemiBin/lib/python3.9/site-packages/atomicwrites/init.py", line 169, in _open
self.commit(f)
File "/home/miniconda3/envs/SemiBin/lib/python3.9/site-packages/atomicwrites/init.py", line 202, in commit
replace_atomic(f.name, self._path)
File "/home/miniconda3/envs/SemiBin/lib/python3.9/site-packages/atomicwrites/init.py", line 99, in replace_atomic
return _replace_atomic(src, dst)
File "/home/miniconda3/envs/SemiBin/lib/python3.9/site-packages/atomicwrites/init.py", line 56, in _replace_atomic
_sync_directory(os.path.normpath(os.path.dirname(dst)))
File "/home/miniconda3/envs/SemiBin/lib/python3.9/site-packages/atomicwrites/init.py", line 50, in _sync_directory
_proper_fsync(fd)
OSError: [Errno 22] Invalid argument

Thanks in advance!

@luispedro
Copy link
Member

I think this is an instance of untitaker/python-atomicwrites#28

@jserrana : are you running on a network filesystem?

@psj1997: my suggestion is changing how we do atomic writing to pick a backend that does not fail for network filesystems. This may involve adding trh code directly on SemiBin or using a different library

@jserrana
Copy link
Author

Hi @luispedro, apologies for the late response. Yes, I am working on a network filesystem. If this is the cause of the error, I will find other ways to run SemiBin, but would appreciate it if the dev team can resolve this in the future! Thanks in advance!

@luispedro
Copy link
Member

It does work on at least some network filesystems, but not all.

I am going to re-open, though, because we should be more robust and fallback to non-atomic versions if the atomic version fails

@luispedro luispedro reopened this May 16, 2022
@luispedro
Copy link
Member

Closing as fixed (#112)

luispedro added a commit to luispedro/SemiBin that referenced this issue Sep 20, 2022
USER-VISIBLE IMPROVEMENTS

- Support CRAM input ([BigDataBiology#104](BigDataBiology#104))
- Accept depth files generated by metabat2 (only possible for single-sample binning)
- More flexible specification of prebuilt models (case insensitive, normalize `-` and `_`)
- Better output message when no bins are produced
- Remove torch version restriction (and test on Python 3.10)

BUGFIXES

- Support filesystems that do allow you to call fsync on directories ([BigDataBiology#97](BigDataBiology#97))
luispedro added a commit to luispedro/SemiBin that referenced this issue Sep 21, 2022
USER-VISIBLE IMPROVEMENTS

- Support CRAM input ([BigDataBiology#104](BigDataBiology#104))
- Accept depth files generated by metabat2 (only possible for single-sample binning)
- More flexible specification of prebuilt models (case insensitive, normalize `-` and `_`)
- Better output message when no bins are produced
- Remove torch version restriction (and test on Python 3.10)

BUGFIXES

- Support filesystems that do allow you to call fsync on directories ([BigDataBiology#97](BigDataBiology#97))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants