InĀ [1]:
import plotly.express as px
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import plotly.io as pio
pio.renderers.default = "notebook"
InĀ [2]:
maf_data = 'Variants_for_allele_frequencies.xlsx'
cmr = pd.read_excel(maf_data, sheet_name="cmrdf", header=0, index_col=False)
cmr.head()
gnomad = pd.read_excel(maf_data, sheet_name="gnomadf", header=0, index_col=False)
gnomad.head()
Out[2]:
| Population | Variant | MAF | Color | |
|---|---|---|---|---|
| 0 | gnomAD | GJB2_chr13-20189546-AC-A (rs80338939) | 0.007050 | 1 |
| 1 | gnomAD | GJB6_chr13-20223467-G-A (rs104894414) | 0.000009 | 1 |
| 2 | gnomAD | SLC26A4_chr7-107672182-C-T (rs145254330) | 0.000319 | 1 |
| 3 | gnomAD | MYO15A_chr17-18149488-TCAGA-T (rs780170125) | 0.000181 | 1 |
| 4 | gnomAD | CDH23 _chr10-71779316-G-A (rs111033270) | 0.000160 | 1 |
InĀ [3]:
cmr_fig = px.scatter(
cmr,
x="Variant",
y="Population",
size="MAF",
color="MAF",
hover_name="Population",
width=800, height=500
)
cmr_fig.write_image("cameroon_HI-variants_maf_plot.svg")
cmr_fig.write_image("cameroon_HI-variants_maf_plot.pdf")
cmr_fig.show()
InĀ [4]:
gnomad_fig = px.scatter(
gnomad,
x="Variant",
y="Population",
size="MAF",
color="MAF",
hover_name="Population",
width=800, height=500,
)
gnomad_fig.write_image("gnomad-variants_maf_plot.svg")
gnomad_fig.write_image("gnomad-variants_maf_plot.pdf")
gnomad_fig.show()