# if categorical variables exist, add 2 select lists to choose the categorical variables to color the PCA
# if categorical variables exist, add 2 select lists to choose the categorical variables to color the PCA
ifcat_cols[0]=="no categories":
ifcat_cols[0]=="no categories":
scatter_column.plotly_chart(px.scatter(data_frame=pca_data,x=pca_1,y=pca_2,template="simple_white",height=800,hover_name=pca_data.index,title="PCA plot of sample spectra"))
plot_pca=scatter_column.plotly_chart(px.scatter(data_frame=pca_data,x=pca_1,y=pca_2,template="simple_white",height=800,hover_name=pca_data.index,title="PCA plot of sample spectra"))
scatter_column.plotly_chart(px.scatter(data_frame=pca_data,x=pca_1,y=pca_2,template="simple_white",height=800,color=categorical_variable,hover_data=[categorical_variable_2],hover_name=pca_data.index,title="PCA plot of sample spectra"))
plot_pca=scatter_column.plotly_chart(px.scatter(data_frame=pca_data,x=pca_1,y=pca_2,template="simple_white",height=800,color=categorical_variable,hover_data=[categorical_variable_2],hover_name=pca_data.index,title="PCA plot of sample spectra"))
# plot the pca with clustering only (no selected samples)
plot=scatter_column.plotly_chart(px.scatter(data_frame=pca_data,x=pca_1,y=pca_2,template="simple_white",height=800,color=kmeans_samples.labels_,hover_name=pca_data.index,title="PCA projection with K-Means Clusters"))
# plot de pca with colored clusters and selected samples
graph_selected=px.scatter(data_frame=pca_data,x=pca_1,y=pca_2,template="simple_white",height=800,color=kmeans_samples.labels_,hover_name=pca_data.index,title="PCA projection with K-Means Clusters and selected samples")
plot=scatter_column.plotly_chart(graph_selected)
# button to export the names of selected samples - by cluster if random - in a csv