PriceLab / probannopy

A python package for Probanno!
9 stars 3 forks source link

Static database file missing #1

Open lucaz88 opened 6 years ago

lucaz88 commented 6 years ago

Dear probannopy team, I am super exited to try out this workflow however I am encountering a problem related to the database files. When I am running the test run I get the following error:

Config File: /home/lucaz/probannopy/probanno/deploy.cfg Config Items: ['ProbAnno-Standalone'] Traceback (most recent call last): File "/home/lucaz/probannopy/probanno/lib/ProbAnnotationParser.py", line 725, in getDatabaseFiles self.checkIfDatabaseFilesExist() File "/home/lucaz/probannopy/probanno/lib/ProbAnnotationParser.py", line 576, in checkIfDatabaseFilesExist raise NotReadyError('Static database file "%s" does not exist' %(path)) NotReadyError: Static database file "/media/lucaz/DATA/DBs_repository/probanno/PROTEIN_FASTA" does not exist Out[5]: <probanno.ReactionProbabilities at 0x7f20336f6b90>

I have the filing that I am missing some of the db files the script is looking for however I've downloaded but the PROTEIN.udb and OTU_FID_ROLE. I am using a different folder for them but I've configured the deploy.cfg file accordingly. Any idea on how can I solve this issue? many thanks!

kingb12 commented 6 years ago

Hi Luca!

I just did some verification on my end and this actually looks like a bug on my end which I've just now pushed a fix for. The missing DB files this error is for are for when a different search program is configured other than USEARCH (NCBI blastx), so they shouldn't be occurring if any longer if you're configured to use USEARCH.

If you cloned the repository, you can fetch the latest changes with git fetch; git pull. Then from the repository directory, you can re-install the package with pip:

pip uninstall probanno

pip install -e ./probanno

Sorry for the inconvenience, let me know if this doesn't fix the issue or if you have any other questions/concerns! I'm also adding a gitter channel for the project if you want to ask quick questions via chat: https://gitter.im/probanno/

Thanks for trying out the project, let me if there's anything I can do to help! Brendan

lucaz88 commented 6 years ago

Great! It solves the database problem! Thanks However now I am getting a problem when I am tring to export the ouput of 'generate_reaction_probabilities' with 'export_json' :

probanno.export_json(rxn_probs, 'myprobabilities.json') Traceback (most recent call last):

File "", line 1, in probanno.export_json(rxn_probs, 'myprobabilities.json')

File "/home/lucaz/probannopy/probanno/probanno.py", line 202, in export_json f.write(json.dumps(rxn_probs))

File "/usr/lib/python2.7/json/init.py", line 244, in dumps return _default_encoder.encode(obj)

File "/usr/lib/python2.7/json/encoder.py", line 207, in encode chunks = self.iterencode(o, _one_shot=True)

File "/usr/lib/python2.7/json/encoder.py", line 270, in iterencode return _iterencode(o, 0)

File "/usr/lib/python2.7/json/encoder.py", line 184, in default raise TypeError(repr(o) + " is not JSON serializable")

TypeError: <probanno.ReactionProbabilities object at 0x7f35bd9c7610> is not JSON serializable