Skip to content
Snippets Groups Projects
Commit f5687ff0 authored by Tracanna, Vittorio's avatar Tracanna, Vittorio
Browse files

Replace amplicon_pipeline.py

parent dbc89e05
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,7 @@ import time
import scipy
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib
import seaborn as sns
import scipy.stats
from ete3 import NCBITaxa
......@@ -600,7 +601,6 @@ def beta_diversity_plot(normalized_df, argOptions):
for s in samples:
if c.startswith(s):
meta_df.loc[c, ['Sample']] = s
fig = pcoa_results.plot(df=meta_df, column='Sample', cmap='Set1', s=50)
plt.savefig('{}beta_diversity_pcoa.pdf'.format(argOptions['outputDir']))
plt.close()
......@@ -620,7 +620,7 @@ def beta_diversity_plot(normalized_df, argOptions):
for target, color in zip(targets, sns.color_palette("husl", len(targets))):
indicesToKeep = finalDf['Sample'] == target
ax.scatter(finalDf.loc[indicesToKeep, 'principal component 1'],
finalDf.loc[indicesToKeep, 'principal component 2'], c=color, s=50)
finalDf.loc[indicesToKeep, 'principal component 2'], c=np.array([color]), s=50)
ax.legend(targets)
ax.grid()
plt.savefig('{}beta_div_pca.pdf'.format(argOptions['outputDir']))
......@@ -636,7 +636,7 @@ def beta_diversity_plot(normalized_df, argOptions):
for target, color in zip(targets, sns.color_palette("husl", len(targets))):
indicesToKeep = finalDf[finalDf['Sample'] == target]
for i in indicesToKeep.index:
ax.scatter(X_r[i, 0], X_r[i, 1], c=color, s=50)
ax.scatter(X_r[i, 0], X_r[i, 1], c=np.array([color]), s=50)
ax.legend(targets)
ax.grid()
plt.savefig('{}beta_diversity_mds.pdf'.format(argOptions['outputDir']))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment