iqbal-lab / Mykrobe-predictor

Antibiotic resistance predictions in minutes on a laptop
Other
50 stars 19 forks source link

Update documentation and error handling for default skeleton writing #109

Closed rrwick closed 5 years ago

rrwick commented 8 years ago

When I ran mykrobe predict on a TB sample, it quickly failed with this error:

[27 Jun 2016 22:52:08-PaP][file_util.c:169] Fatal Error: Cannot write to file: /usr/local/easybuild/software/mykrobe/0.3.6-Python-2.7.10-bundle/lib/python2.7/site-packages/mykatlas-0.3.8-py2.7.egg/mykatlas/atlas/data/skeletons/tb-species-160330-tb-amr-bradley_2015_21.ctx [Read-only file system]

The issue seems to somehow relate to mykatlas, which has the --skeleton_dir argument that has a default value of atlas/data/skeletons/. Somewhere along the way, this is becoming a path in the installation directory of Mykrobe predictor (see error above), where it doesn't have write permissions.

I can avoid the issue by using a non-default value for --skeleton_dir, but it still feel like something is going wrong... should atlas/data/skeletons/ end up in the directory where I'm running Mykrobe predictor, not the directory where it's installed?

iqbal-lab commented 8 years ago

Hm - I'll ping @Phelimb as this code has changed since I was expert on it, but I would expect the skeleton to be in the install dir - why does it not have write access in the dir it is installed in? I think the skeleton is generated once, and is written to file. All future runs then use that skeleton.

Phelimb commented 8 years ago

I think the skeleton is generated once, and is written to file. All future runs then use that skeleton.

Yes, this is correct. I try to write in the install directory by default, however it looks like you don't have write permissions in there so unfortunately you'll need to use the --skeleton_dir argument for every run.

@iqbal-lab I'm not sure if there's anything that needs to be changed here. Perhaps we should use a tempfile for skeletons rather than writing to instal directory?

iqbal-lab commented 8 years ago

I don't think anything needs changing except maybe documentation.