Skip to content
Snippets Groups Projects
Commit c35074c2 authored by UMEC Mathieu's avatar UMEC Mathieu
Browse files

change the method of clustering

parent 14ef9ec7
No related branches found
No related tags found
No related merge requests found
...@@ -105,17 +105,60 @@ def visualisation_recouvrement (File, titre_du_graphique="Recouvrement moyen des ...@@ -105,17 +105,60 @@ def visualisation_recouvrement (File, titre_du_graphique="Recouvrement moyen des
p1.tick_params(axis='x', rotation=90, size=1) #rotation des ticklabels p1.tick_params(axis='x', rotation=90, size=1) #rotation des ticklabels
plt.show() plt.show()
visualisation_recouvrement ("C:\\Users\\mumec\\Desktop\\Mini_codes\\fichier_pour_tests_graph.xlsx",titre_du_graphique="Recouvrement moyen des différentes voies métaboliques de la liste constructeurs sur KEGG") #visualisation_recouvrement ("C:\\Users\\mumec\\Desktop\\Mini_codes\\fichier_pour_tests_graph.xlsx",titre_du_graphique="Recouvrement moyen des différentes voies métaboliques de la liste constructeurs sur KEGG")
def boite_a_moustache(File_of_data, titre_de_la_boite="boite a moustache des mes données",numero_de_la_colonne_a_grapher=1,numero_de_la_colonne_de_labels=0 ):
dataframe= pd.read_excel(File_of_data)
colnames = list(dataframe.columns)
Data=dataframe[colnames[numero_de_la_colonne_a_grapher]].tolist()
print(Data)
plt.boxplot(Data)
plt.ylim(0,max(Data)+2)
# plt.savefig('SimpleBoxPlot.png')
plt.show()
#☻boite_a_moustache("C:\\Users\\mumec\\Desktop\\Mini_codes\\fichier_pour_test_moustache.xlsx", titre_de_la_boite="boite a moustache des mes données")
def Camenbert(File_of_data, titre_de_la_boite="boite a moustache des mes données",numero_de_la_colonne_a_grapher=1,numero_de_la_colonne_de_labels=0, valeur_filtrage=100, barplot="oui"):
dataframe= pd.read_excel(File_of_data)
colnames = list(dataframe.columns)
Data=dataframe[colnames[numero_de_la_colonne_a_grapher]].tolist()
labels=dataframe[colnames[numero_de_la_colonne_de_labels]].tolist()
object_gardes=[]
labels_gardes=[]
Total=sum(Data)
for indice in range (len(Data)) :
if Data[indice]>= (Total*valeur_filtrage/100): #plus de valeur_filtrage des interactions
object_gardes.append(Data[indice])
labels_gardes.append(labels[indice])
if barplot=="oui" :
fig, ax = plt.subplots()
ax.bar(labels_gardes, object_gardes)
ax.bar_label(ax.containers[0])
ax.set_ylabel('fréquence des métabolites')
ax.set_title('Les métabolites les plus présents')
ax.tick_params(axis='x', rotation=90, size=1)
plt.show()
object_gardes.append(Total-sum(object_gardes))
labels_gardes.append("autre")
print(object_gardes)
plt.pie(object_gardes,labels=labels_gardes)
plt.show()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment