use my own annotation file
lzhangUT opened this issue · 7 comments
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.
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.
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.
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
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.
Thank you in advance. really appreciated.
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".
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.