<jupyter_start><jupyter_text>Example: CanvasXpress oncoprint Chart No. 3This example page demonstrates how to, using the Python package, create a chart that matches the CanvasXpress online example located at:https://www.canvasxpress.org/examples/oncoprint-3.htmlThis example is generated using the reproducible JSON obtained from the above page and the `canvasxpress.util.generator.generate_canvasxpress_code_from_json_file()` function.Everything required for the chart to render is included in the code below.  Simply run the code block.<jupyter_code>from canvasxpress.canvas import CanvasXpress 
from canvasxpress.js.collection import CXEvents 
from canvasxpress.render.jupyter import CXNoteBook 

cx = CanvasXpress(
    render_to="oncoprint3",
    data={
        "y": {
            "smps": [
                "V1",
                "V2",
                "V3"
            ],
            "vars": [
                "S1",
                "S2",
                "S3",
                "S4",
                "S5",
                "S6",
                "S7",
                "S8",
                "S9"
            ],
            "data": [
                [
                    3.1,
                    3.5,
                    4
                ],
                [
                    3,
                    7.4,
                    4.1
                ],
                [
                    2.8,
                    3.1,
                    3.3
                ],
                [
                    2.3,
                    2.4,
                    2.1
                ],
                [
                    4.9,
                    6.1,
                    6.1
                ],
                [
                    1.9,
                    2.1,
                    0.1
                ],
                [
                    2.2,
                    1.9,
                    2.1
                ],
                [
                    1.7,
                    2.1,
                    0.2
                ],
                [
                    0.2,
                    4.9,
                    3.9
                ]
            ],
            "data2": [
                [
                    "",
                    "",
                    "Amplification"
                ],
                [
                    "",
                    "Amplification",
                    ""
                ],
                [
                    "",
                    "",
                    ""
                ],
                [
                    "",
                    "",
                    ""
                ],
                [
                    "",
                    "Amplification",
                    "Amplification"
                ],
                [
                    "",
                    "",
                    ""
                ],
                [
                    "",
                    "",
                    ""
                ],
                [
                    "",
                    "",
                    "Deletion"
                ],
                [
                    "Deletion",
                    "Amplification",
                    ""
                ]
            ],
            "data3": [
                [
                    "",
                    "",
                    "Missence"
                ],
                [
                    "",
                    "",
                    "Truncating"
                ],
                [
                    "Nonsense",
                    "",
                    ""
                ],
                [
                    "",
                    "Missence",
                    ""
                ],
                [
                    "",
                    "Truncating",
                    ""
                ],
                [
                    "",
                    "Nonsense",
                    ""
                ],
                [
                    "",
                    "",
                    ""
                ],
                [
                    "Missence",
                    "",
                    ""
                ],
                [
                    "",
                    "",
                    ""
                ]
            ],
            "data4": [
                [
                    "",
                    "A",
                    ""
                ],
                [
                    "",
                    "A",
                    ""
                ],
                [
                    "",
                    "A",
                    ""
                ],
                [
                    "",
                    "A",
                    ""
                ],
                [
                    "",
                    "B",
                    ""
                ],
                [
                    "",
                    "B",
                    ""
                ],
                [
                    "",
                    "",
                    "B"
                ],
                [
                    "",
                    "",
                    "B"
                ],
                [
                    "B",
                    "",
                    ""
                ]
            ]
        },
        "z": {
            "Factor": [
                "Lev:1",
                "Lev:2",
                "Lev:1",
                "Lev:2",
                "Lev:1",
                "Lev:2",
                "Lev:1",
                "Lev:2",
                "Lev:1"
            ]
        },
        "x": {
            "Annt1": [
                "Desc:1",
                "Desc:2",
                "Desc:1"
            ],
            "Annt2": [
                23,
                34,
                52
            ],
            "Annt3": [
                12,
                14,
                34
            ],
            "Annt4": [
                8,
                14,
                14
            ],
            "Annt5": [
                17,
                9,
                18
            ]
        }
    },
    config={
        "graphType": "Heatmap",
        "oncoprintCNA": "data2",
        "oncoprintMUT": "data3",
        "patternBy": "Pattern",
        "patternByData": "data4",
        "smpOverlayProperties": {
            "Annt5": {
                "type": "Stacked",
                "color": "rgb(105,150,150)",
                "spectrum": [
                    "rgb(69,117,180)",
                    "rgb(145,191,219)",
                    "rgb(224,243,248)",
                    "rgb(255,255,191)",
                    "rgb(254,224,144)",
                    "rgb(252,141,89)",
                    "rgb(215,48,39)"
                ],
                "scheme": "User",
                "showLegend": True,
                "showName": True,
                "showBox": True,
                "rotate": False,
                "position": "left"
            },
            "Annt3": {
                "type": "Stacked",
                "color": "rgb(248,204,3)",
                "spectrum": [
                    "rgb(69,117,180)",
                    "rgb(145,191,219)",
                    "rgb(224,243,248)",
                    "rgb(255,255,191)",
                    "rgb(254,224,144)",
                    "rgb(252,141,89)",
                    "rgb(215,48,39)"
                ],
                "scheme": "User",
                "showLegend": True,
                "showName": True,
                "showBox": True,
                "rotate": False,
                "position": "left"
            },
            "Annt2": {
                "type": "Bar",
                "position": "right",
                "color": "rgb(167,206,49)",
                "spectrum": [
                    "rgb(69,117,180)",
                    "rgb(145,191,219)",
                    "rgb(224,243,248)",
                    "rgb(255,255,191)",
                    "rgb(254,224,144)",
                    "rgb(252,141,89)",
                    "rgb(215,48,39)"
                ],
                "scheme": "User",
                "showLegend": True,
                "showName": True,
                "showBox": True,
                "rotate": False
            },
            "Annt4": {
                "type": "Stacked",
                "color": "rgb(255,140,2)",
                "spectrum": [
                    "rgb(69,117,180)",
                    "rgb(145,191,219)",
                    "rgb(224,243,248)",
                    "rgb(255,255,191)",
                    "rgb(254,224,144)",
                    "rgb(252,141,89)",
                    "rgb(215,48,39)"
                ],
                "scheme": "User",
                "showLegend": True,
                "showName": True,
                "showBox": True,
                "rotate": False,
                "position": "left"
            },
            "": {
                "type": "Stacked",
                "position": "right",
                "thickness": 80,
                "color": "#edf8e9",
                "showName": False,
                "showBox": False
            },
            "Amplification": {
                "type": "Stacked",
                "position": "right",
                "thickness": 80,
                "color": "rgb(255,0,0)",
                "showName": False,
                "showBox": False
            },
            "Deletion": {
                "type": "Stacked",
                "position": "right",
                "thickness": 80,
                "color": "rgb(0,0,255)",
                "showName": False,
                "showBox": False
            },
            "Missence": {
                "type": "Stacked",
                "position": "right",
                "thickness": 80,
                "color": "#bae4b3",
                "showName": False,
                "showBox": False
            },
            "Nonsense": {
                "type": "Stacked",
                "position": "right",
                "thickness": 80,
                "color": "#74c476",
                "showName": False,
                "showBox": False
            },
            "Truncating": {
                "type": "Stacked",
                "position": "right",
                "thickness": 80,
                "color": "#238b45",
                "showName": False,
                "showBox": False
            },
            "% Altered-Smps": {
                "type": "Text",
                "position": "left",
                "thickness": 35,
                "showName": False,
                "rotate": True
            },
            "Annt1": {
                "type": "Default",
                "color": "rgb(254,41,108)",
                "spectrum": [
                    "rgb(69,117,180)",
                    "rgb(145,191,219)",
                    "rgb(224,243,248)",
                    "rgb(255,255,191)",
                    "rgb(254,224,144)",
                    "rgb(252,141,89)",
                    "rgb(215,48,39)"
                ],
                "scheme": "User",
                "showLegend": True,
                "showName": True,
                "showBox": True,
                "rotate": False,
                "position": "left"
            }
        },
        "smpOverlays": [
            "Annt1",
            "-",
            "Annt2",
            "Annt3",
            "Annt4",
            "Annt5"
        ]
    },
    width=613,
    height=613,
    events=CXEvents(),
    after_render=[],
    other_init_params={
        "version": 35,
        "events": False,
        "info": False,
        "afterRenderInit": False,
        "noValidate": True
    }
)

display = CXNoteBook(cx) 
display.render(output_file="oncoprint_3.html")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12358315005921164, 'fraction_numerical': 0.04254779225173406, 'mean_word_length': 0.5591454569431623, 'pattern_counts': {'":': 125, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '105938', 'license': 'MIT', 'n_tokens_mistral': 3369, 'n_tokens_neox': 2785, 'n_words': 424, 'path': 'tutorials/notebook/cx_site_chart_examples/oncoprint_3.ipynb', 'repo_name': 'docinfosci/canvasxpress-python', 'size': '11822'}