Merck / Merck/deepbgc

DeepBGC failed with ValueError: missing molecule_type in annotations

Open
#67 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
161
Forks
29
PR merge metrics
No merged PRs in 30d

Description

Hi,

When I tried to use DeepBGC to analyze a genbank file downloaded from NCBI, I encountered an errror like this:

Using TensorFlow backend.
WARNING 11/02 15:54:49 From /opt/anaconda3/envs/deepbgc/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:74: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.

WARNING 11/02 15:54:49 From /opt/anaconda3/envs/deepbgc/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:517: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

WARNING 11/02 15:54:49 From /opt/anaconda3/envs/deepbgc/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:4138: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.

WARNING 11/02 15:54:49 From /opt/anaconda3/envs/deepbgc/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:133: The name tf.placeholder_with_default is deprecated. Please use tf.compat.v1.placeholder_with_default instead.

WARNING 11/02 15:54:49 From /opt/anaconda3/envs/deepbgc/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:3445: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.
Instructions for updating:
Please use rate instead of keep_prob. Rate should be set to rate = 1 - keep_prob.
WARNING 11/02 15:54:50 From /opt/anaconda3/envs/deepbgc/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:174: The name tf.get_default_session is deprecated. Please use tf.compat.v1.get_default_session instead.

INFO 11/02 15:54:50 Loading model from: /Users/cynthiayo/Library/Application Support/deepbgc/data/0.1.0/classifier/product_class.pkl
/opt/anaconda3/envs/deepbgc/lib/python3.7/site-packages/sklearn/base.py:306: UserWarning: Trying to unpickle estimator DecisionTreeClassifier from version 0.18.2 when using version 0.21.3. This might lead to breaking code or invalid results. Use at your own risk.
UserWarning)
/opt/anaconda3/envs/deepbgc/lib/python3.7/site-packages/sklearn/base.py:306: UserWarning: Trying to unpickle estimator RandomForestClassifier from version 0.18.2 when using version 0.21.3. This might lead to breaking code or invalid results. Use at your own risk.
UserWarning)
INFO 11/02 15:54:52 Loading model from: /Users/cynthiayo/Library/Application Support/deepbgc/data/0.1.0/classifier/product_activity.pkl
INFO 11/02 15:54:52 Processing input file 1/1: sequence.gb
INFO 11/02 15:54:52 ================================================================================
INFO 11/02 15:54:52 Processing record #1: KB946332.1
INFO 11/02 15:54:52 Sequence already contains 802 CDS features, skipping CDS detection
INFO 11/02 15:54:52 Detecting Pfam domains in "KB946332.1" using HMMER hmmscan, this might take a while...
INFO 11/02 15:59:29 HMMER hmmscan Pfam detection done in 0h4m37s
INFO 11/02 16:00:07 Added 1795 Pfam domains (947 unique PFAM_IDs)
INFO 11/02 16:00:07 Detecting BGCs using deepbgc model in KB946332.1
INFO 11/02 16:00:10 Detected 3 BGCs using deepbgc model in KB946332.1
INFO 11/02 16:00:10 Classifying 3 BGCs using product_class model in KB946332.1
INFO 11/02 16:00:10 Classifying 3 BGCs using product_activity model in KB946332.1
INFO 11/02 16:00:10 Saving processed record KB946332.1
ERROR 11/02 16:00:10 missing molecule_type in annotations
Traceback (most recent call last):
File "/opt/anaconda3/envs/deepbgc/lib/python3.7/site-packages/deepbgc/main.py", line 113, in main
run(argv)
File "/opt/anaconda3/envs/deepbgc/lib/python3.7/site-packages/deepbgc/main.py", line 102, in run
args.func.run(**args_dict)
File "/opt/anaconda3/envs/deepbgc/lib/python3.7/site-packages/deepbgc/command/pipeline.py", line 181, in run
writer.write(record)
File "/opt/anaconda3/envs/deepbgc/lib/python3.7/site-packages/deepbgc/output/bgc_genbank.py", line 26, in write
SeqIO.write(cluster_record, self.fd, 'genbank')
File "/opt/anaconda3/envs/deepbgc/lib/python3.7/site-packages/Bio/SeqIO/init.py", line 530, in write
count = writer_class(handle).write_file(sequences)
File "/opt/anaconda3/envs/deepbgc/lib/python3.7/site-packages/Bio/SeqIO/Interfaces.py", line 244, in write_file
count = self.write_records(records, maxcount)
File "/opt/anaconda3/envs/deepbgc/lib/python3.7/site-packages/Bio/SeqIO/Interfaces.py", line 218, in write_records
self.write_record(record)
File "/opt/anaconda3/envs/deepbgc/lib/python3.7/site-packages/Bio/SeqIO/InsdcIO.py", line 981, in write_record
self._write_the_first_line(record)
File "/opt/anaconda3/envs/deepbgc/lib/python3.7/site-packages/Bio/SeqIO/InsdcIO.py", line 744, in _write_the_first_line
raise ValueError("missing molecule_type in annotations")
ValueError: missing molecule_type in annotations
ERROR 11/02 16:00:10 ================================================================================
ERROR 11/02 16:00:10 DeepBGC failed with ValueError: missing molecule_type in annotations
ERROR 11/02 16:00:10 ================================================================================

Could you help me with the problem mentioned here?

Thank you!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in deepbgc/output/bgc_genbank.py at the SeqIO.write call shown in the traceback, then trace how the record is created in deepbgc/command/pipeline.py. Reproduce the failure with the reported GenBank input and inspect the record annotations before writing; done means processed GenBank output is written without the missing molecule_type error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
bioinformatics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.