diff --git a/src/Packages.py b/src/Packages.py index 7577a4af756ed4a82a6e68bd69bee2be620eb617..7b60e45ab02fc546af3fc5b02ef17a28869379f8 100644 --- a/src/Packages.py +++ b/src/Packages.py @@ -24,7 +24,7 @@ from scipy.sparse import csgraph # Modelling # import julia -from julia import Main, Jchemo, DataFrames, Base, Pandas +#from julia import Main, Jchemo, DataFrames, Base, Pandas from pinard import utils from pinard import preprocessing as pp diff --git a/src/Report/Figures/.gitkeep b/src/Report/Figures/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/pages/1-samples_selection.py b/src/pages/1-samples_selection.py index fa876c57de0f95dbe8d5813b33f107a7a2640c2a..c9f3315d89c2a1059f688bb1ecea69e448b45d85 100644 --- a/src/pages/1-samples_selection.py +++ b/src/pages/1-samples_selection.py @@ -224,34 +224,33 @@ if not t.empty: name = 'selected samples') st.plotly_chart(fig, use_container_width=True) + import plotly.express as px -## Export en 2d Axe1..Axe3 -if not t.empty: - if dim_red_method == dim_red_methods[1]: - - # nombre de clusters num_clusters = len(np.unique(labels)) - # Une couleur par cluster custom_color_palette = px.colors.qualitative.Plotly[:num_clusters] + color_discrete_sequence=custom_color_palette + + # Créer et exporter le graphique Axe1-Axe2 en PNG + fig_axe1_axe2 = px.scatter(tcr, x=axis1, y=axis2, color=labels if list(labels) else None, color_discrete_sequence=custom_color_palette) + fig_axe1_axe2.update_layout(title='Axe1-Axe2') + fig_axe1_axe2.update_traces(marker=dict(size=4)) + fig_axe1_axe2.write_image("plot_axe1_axe2.png") + + + # Créer et exporter le graphique Axe1-Axe3 en PNG + fig_axe1_axe3 = px.scatter(tcr, x=axis1, y=axis3, color=labels if list(labels) else None, color_discrete_sequence=custom_color_palette) + fig_axe1_axe3.update_layout(title='Axe1-Axe3') + fig_axe1_axe3.update_traces(marker=dict(size=4)) + fig_axe1_axe3.write_image("plot_axe1_axe3.png") + + + # Créer et exporter le graphique Axe2-Axe3 en PNG + fig_axe2_axe3 = px.scatter(tcr, x=axis2, y=axis3, color=labels if list(labels) else None, color_discrete_sequence=custom_color_palette) + fig_axe2_axe3.update_layout(title='Axe2-Axe3') + fig_axe2_axe3.update_traces(marker=dict(size=4)) + fig_axe2_axe3.write_image("plot_axe2_axe3.png") - # Graphique pour les dimensions (axis1, axis2) - fig_2d_axis1_axis2 = px.scatter(t, x=axis1, y=axis2, color=labels, color_discrete_sequence=custom_color_palette) - img_2d_axis1_axis2 = pio.to_image(fig_2d_axis1_axis2, format="png") - with open("./Report/figures/scores_plot_2d_axis1_axis2.png", "wb") as f: - f.write(img_2d_axis1_axis2) - - # Graphique pour les dimensions (axis1, axis3) - fig_2d_axis1_axis3 = px.scatter(t, x=axis1, y=axis3, color=labels, color_discrete_sequence=custom_color_palette) - img_2d_axis1_axis3 = pio.to_image(fig_2d_axis1_axis3, format="png") - with open("./Report/figures/scores_plot_2d_axis1_axis3.png", "wb") as f: - f.write(img_2d_axis1_axis3) - - # Graphique pour les dimensions (axis2, axis3) - fig_2d_axis2_axis3 = px.scatter(t, x=axis2, y=axis3, color=labels, color_discrete_sequence=custom_color_palette) - img_2d_axis2_axis3 = pio.to_image(fig_2d_axis2_axis3, format="png") - with open("./Report/figures/scores_plot_2d_axis2_axis3.png", "wb") as f: - f.write(img_2d_axis2_axis3) if not spectra.empty: if dim_red_method == dim_red_methods[1]: diff --git a/src/plot_axe1_axe2.png b/src/plot_axe1_axe2.png new file mode 100644 index 0000000000000000000000000000000000000000..2b5dd05e63e92679d8078beac1166ab7a42a2032 Binary files /dev/null and b/src/plot_axe1_axe2.png differ diff --git a/src/plot_axe1_axe3.png b/src/plot_axe1_axe3.png new file mode 100644 index 0000000000000000000000000000000000000000..d1258eeb59cac6171ceb0ff117c3d1038064f4f4 Binary files /dev/null and b/src/plot_axe1_axe3.png differ diff --git a/src/plot_axe2_axe3.png b/src/plot_axe2_axe3.png new file mode 100644 index 0000000000000000000000000000000000000000..f253a84bbb53fe31d1cd92eaae6015d1d366f21e Binary files /dev/null and b/src/plot_axe2_axe3.png differ