<jupyter_start><jupyter_text>Create dynamic plots for COAD<jupyter_code>import plotly.express as px
import pandas as pd
# get data
database = "../db/dbCOAD-DRD_Top50.csv"
df = pd.read_csv(database)
df
df.columns
# by Gene
fig1 = px.box(df, x="HGNC_symbol", y="AE", points="all",
             hover_data=["ProteinID","Drug"],
             notched=True, # used notched shape
             
            )

fig1.update_layout(
    title="Docking affinity energies by COAD genes",
    xaxis_title="Gene target",
    yaxis_title="Affinity Energy (AE, kcal/mol)",
    yaxis=dict(autorange='reversed'),
    font=dict(
        family="Courier New, monospace",
        size=14,
        color="#7f7f7f"
    )
)
    
fig1.show()
import plotly
plotly.offline.plot(fig1, filename='../extras/top50_byGene.html', auto_open=False)
# by Drug Name
import plotly.express as px
fig2 = px.scatter(df, x="DrugName", y="AE", color="HGNC_symbol",
                  hover_data=["DrugCID","ProteinID"])

fig2.update_layout(
    title="Best 50 interactions by Drug Name for COAD",
    xaxis_title="Drug name",
    yaxis=dict(autorange='reversed'),
    yaxis_title="Affinity Energy (AE, kcal/mol)",
    font=dict(
        family="Courier New, monospace",
        size=14,
        color="#7f7f7f"
    )
)

fig2.show()
import plotly
plotly.offline.plot(fig2, filename='../extras/top50_byDrugName.html', auto_open=False)
# by PDBid  (['AE', 'HGNC_symbol', 'DrugName', 'ProteinID', 'DrugCID', 'Drug'])
fig3 = px.box(df, x="ProteinID", y="AE", points="all",
             hover_data=["HGNC_symbol","Drug"],
             notched=True, # used notched shape
             
            )

fig3.update_layout(
    title="Docking affinity energies by PDB IDs for COAD",
    xaxis_title="PDB target",
    yaxis_title="Affinity Energy (AE, kcal/mol)",
    yaxis=dict(autorange='reversed'),
    font=dict(
        family="Courier New, monospace",
        size=14,
        color="#7f7f7f"
    )
)
    
fig3.show()
import plotly
plotly.offline.plot(fig3, filename='../extras/top50_byPDB.html', auto_open=False)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14722753346080306, 'fraction_numerical': 0.01768642447418738, 'mean_word_length': 3.2889344262295084, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '654414', 'license': 'CC0-1.0', 'n_tokens_mistral': 784, 'n_tokens_neox': 749, 'n_words': 145, 'path': 'COAD-DRD/scripts/top50_Plotpy.ipynb', 'repo_name': 'muntisa/muntisa.github.io', 'size': '2092'}