plotly / dash-bio

Open-source bioinformatics components for Dash
https://dash-gallery.plotly.host/Portal/?search=Bioinformatics
MIT License
531 stars 192 forks source link

Oncoprint error: Cannot read properties of undefined (reading 'displayName') #737

Closed Donnyvdm closed 1 year ago

Donnyvdm commented 1 year ago

Hi Plotly / Dash,

I'm facing the error message Cannot read properties of undefined (reading 'displayName') for some alteration types in the oncoprint plot. I'm quite convinced my code has worked before, but I can't tell you which version it worked/broke.

I've tried to create a minimal example below:

from dash import dash, html
from dash_bio import OncoPrint

app = dash.Dash(__name__)

app.layout = html.Div(
    OncoPrint(
        id="oncoprint-plot",
        data=[{
        'alteration': None, 
        # When changing below type to 'INFRAME', 'MISSENSE' or 'TRUNC' the oncoprint plot works, but
                # any of 'AMP', 'GAIN', 'HETLOSS' or 'HMODEL' breaks the oncoprint plot with the error
            'type': 'HMODEL',   
            'gene': 'TEST', 
            'sample': 'TEST-sample'
        }],
        showlegend=False,
        showoverview=False,
    ),
)   

if __name__ == '__main__':
    app.run_server(debug=True)

I'm using: Python 3.9.5 Dash version 2.9.3 Plotly version 5.9.0

Donnyvdm commented 1 year ago

Apologies, I see now that my input data was incorrectly formatted. I do think the error message can be improved, but the code itself works if the alteration and type are set correctly in the source data