Closed kiramt closed 2 years ago
Thank you very much for bringing attention to this, and providing a solution. It is now part of the dev
branch and will be included in the next release.
Reproducible example (for Jupyter):
import dna_features_viewer
from dna_features_viewer import GraphicFeature, GraphicRecord
features=[
GraphicFeature(start=20, end=500, strand=0, color="#ffcccc",
label="Gene 1: start < end"),
GraphicFeature(start=750, end=600, strand=0, color="orange",
label="Gene 4: start > end"),
GraphicFeature(start=400, end=700, strand=-1, color="#cffccc",
label="Gene 2"),
GraphicFeature(start=600, end=900, strand=+1, color="#ccccff",
label="Gene 3")
]
record = GraphicRecord(sequence_length=1000, features=features)
record.plot(figure_width=5)
import bokeh
bokeh.io.output_notebook()
bokeh_figure = record.plot_with_bokeh()
bokeh.plotting.show(bokeh_figure)
Using the GraphicRecord::plot with strand=0 plots a feature without an arrowhead but GraphicRecord::plot_with_bokeh treats strand=0 as the same as strand=+1.
Looks like an easy fix in BokehPlottableMixin::bokeh_feature_patch?