mmcguffi / pLannotate

Webserver and command line tool for annotating engineered plasmids
GNU General Public License v3.0
97 stars 20 forks source link

use my own annotation file #24

Open lzhangUT opened 1 year ago

lzhangUT commented 1 year ago

Hi, I am interested in using PLannotate on my own annotated file (e.g., in genebank format), how can I add this into the database? what formats are accepted in the database folder? Thanks, appreciate it.

jeffreybarrick commented 1 year ago

Can you clarify? My understanding is that you'd like to be able to use a Genbank file to add features to the database, that will then be used to annotate features in other input sequences.

We're still working on making clear directions and workflows for using user-defined databases of features with the locally installed version of pLannotate. It's a good idea to make it easy to create one of these databases from one or more input GenBank files of features.

lzhangUT commented 1 year ago

Hi Dr. Barrick, Thank you very much for your quick reply. Basically yes. But more specifically, I have an annotated file (in gene bank format), which is a designed plasmid sequence (or you could say, template sequence). Then we experimentally designed some similar sequences (mutations) based on the template plasmid sequence. Now we want to see if the experimentally designed plasmid sequence capture the features in the template plasmid and how much they are similar to the annotated features in the template plasmid (%match, %identity etc).So basically I don’t want to use the public database as my feature database, I want to use my own annotated file as a database. Does this make sense or is it doable? Hope I am making it clear. Thanks. really appreciated.-LiOn May 25, 2023, at 21:45, Jeffrey Barrick @.***> wrote: Can you clarify? My understanding is that you'd like to be able to use a Genbank file to add features to the database, that will then be used to annotate features in other input sequences. We're still working on making clear directions and workflows for using user-defined databases of features with the locally installed version of pLannotate. It's a good idea to make it easy to create one of these databases from one or more input GenBank files of features.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

jeffreybarrick commented 1 year ago

Yes, that makes sense. I'm not sure how quickly we will be able to add this type of functionality, but it's on the list.

lzhangUT commented 1 year ago

Hi Dr. Barrick, Thanks for your information. Now by creating my own consensus sequence file and aligning it with my template plasmid sequence (which has annotation), I can get a annotation table vary similar to the format by using your program. Now I wonder what function(s) (if any) in your PLannotate can be simply or directly used for visualization if I have the annotation table ? Thanks

lzhangUT commented 1 year ago

Dr. Barrick, I actually found the functions in bokeh_plot for visualization. When I was running the code in notebook (line by line, or by function), it seems like everything works fine. after I installed the package, and just import the functions, I got this: from plannotate.bokeh_plot import get_bokeh plot = get_bokeh(df, linear=False)

plot = get_bokeh(df, linear=False) Traceback (most recent call last): File "", line 1, in File "/datadrive/yssong/miniconda3/envs/py38_medaka/lib/python3.8/site-packages/plannotate/bokeh_plot.py", line 212, in get_bokeh hover = HoverTool(names=["features"]) File "/datadrive/yssong/miniconda3/envs/py38_medaka/lib/python3.8/site-packages/bokeh/models/tools.py", line 1197, in init super().init(*args, kwargs) File "/datadrive/yssong/miniconda3/envs/py38_medaka/lib/python3.8/site-packages/bokeh/models/tools.py", line 329, in init super().init(*args, *kwargs) File "/datadrive/yssong/miniconda3/envs/py38_medaka/lib/python3.8/site-packages/bokeh/models/tools.py", line 245, in init super().init(args, kwargs) File "/datadrive/yssong/miniconda3/envs/py38_medaka/lib/python3.8/site-packages/bokeh/models/tools.py", line 171, in init super().init(*args, kwargs) File "/datadrive/yssong/miniconda3/envs/py38_medaka/lib/python3.8/site-packages/bokeh/model/model.py", line 110, in init super().init(kwargs) File "/datadrive/yssong/miniconda3/envs/py38_medaka/lib/python3.8/site-packages/bokeh/core/has_props.py", line 298, in init setattr(self, name, value) File "/datadrive/yssong/miniconda3/envs/py38_medaka/lib/python3.8/site-packages/bokeh/core/has_props.py", line 333, in setattr self._raise_attribute_error_with_matches(name, properties) File "/datadrive/yssong/miniconda3/envs/py38_medaka/lib/python3.8/site-packages/bokeh/core/has_props.py", line 368, in _raise_attribute_error_with_matches raise AttributeError(f"unexpected attribute {name!r} to {self.class.name}, {text} attributes are {nice_join(matches)}") AttributeError: unexpected attribute 'names' to HoverTool, similar attributes are name

Where did it go wrong?

I created a data frame which looks like annotated from public databases (as in your program), and I think it contains all the columns needed to create the plot. image

Thank you in advance. really appreciated.

jeffreybarrick commented 1 year ago

This may be a question only @mmcguffi can answer.

I know that some of the Python packages used by pLannotate change their interfaces in ways that break things quite often, so you may want to be sure you have the version of bokeh specifically referred to in the environment.yml file.

Either that or maybe change the "names" column to "name".

mmcguffi commented 1 year ago

Hi @lzhangUT -- sorry for the slow reply. Currently, pLannotate is not designed to be run in this manner. That is to say, it can be run like you are trying, but it's not explicitly supported. Overall, that generally looks correct? I would just try to replicate the internal dataframe as closely as possible.

I have had thoughts of possibly separating the visualization from the annotation, and more robustly supporting just the visualization aspect, but I would not anticipate that feature to come anytime soon.