<jupyter_start><jupyter_text>MassesMasses that are actually used seem very low, at  0,9 %What should I actually do here?Total protein mass: 117633655349 Dalton<jupyter_code>import numpy as np; np.random.seed(42)
import matplotlib.pyplot as plt
import seaborn as sns

df = perc_usages_1.to_frame()
df["perc_usages_2"] = perc_usages_2
df["perc_usages_3"] = perc_usages_3
df.columns = ["Measurement 1", "Measurement 2", "Measurement 3"]

sns.boxplot(x="variable", y="value", data=pd.melt(df[(df > 0) & (df < 100)]))
plt.xlabel('Measurements')
plt.ylabel('Usage of measurement in %')
plt.title('% usage of proteins per ec simulation ')
plt.savefig(f'{FIGURES}/ec_incorporation_perc_usage_box_ac')
plt.show()


#df['pct'] = df['Location'].div(df.groupby('Hour')['Location'].transform('sum'))
#g = sns.FacetGrid(df, row="pct", hue="pct", aspect=15, height=.5, palette=pal)

perc_incorporation_pyr = pd.melt(df[(df > 0) & (df < 100)])
 
# Method 1: on the same Axis
sns.distplot( df[(df > 0) & (df < 100)].iloc[:,0] , color="skyblue", label="1", kde=False)
sns.distplot( df[(df > 0) & (df < 100)].iloc[:,1], color="red", label="2", kde=False)
sns.distplot( df[(df > 0) & (df < 100)].iloc[:,2], color="green", label="3", kde=False)

from sklearn.preprocessing import StandardScaler

# standardize data for pca 
# #features = ['sepal length', 'sepal width', 'petal length', 'petal width']# Separating out the features
pca_df_all_proteomics_and_pyr = pd.read_csv(proteomics_dataset, index_col="UP").loc[df.index,:]
pca_df_all_proteomics_and_pyr['pyr_1'] = abs_usages_1
pca_df_all_proteomics_and_pyr = pca_df_all_proteomics_and_pyr.T.dropna(axis='columns')
x = pca_df_all_proteomics_and_pyr.values
x = StandardScaler().fit_transform(x)

# run pca
from sklearn.decomposition import PCA
pca = PCA(n_components=2)
principalComponents = pca.fit_transform(x)
principalDf = pd.DataFrame(data = principalComponents, columns = ['principal component 1', 'principal component 2'])
principalDf.index = pca_df_all_proteomics_and_pyr.index

fig = plt.figure(figsize = (8,8))
ax = fig.add_subplot(1,1,1) 
ax.set_xlabel('Principal Component 1', fontsize = 15)
ax.set_ylabel('Principal Component 2', fontsize = 15)
ax.set_title('2 component PCA with zero values', fontsize = 20)

amount = len(principalDf.index)
for i in range(amount):
    c = [float(i)/float(amount), 0.0, float(amount-i)/float(amount)] #R,G,B
    ax.scatter(principalDf.loc[principalDf.index[i], 'principal component 1']
           , principalDf.loc[principalDf.index[i], 'principal component 2']
           , color = c 
           , s = 50)
ax.scatter(principalDf.loc["pyr_1", 'principal component 1']
           , principalDf.loc[principalDf.index[i], 'principal component 2']
           , color = "green"
           , s = 50)


#ax.legend(pca_df_all_proteomics_and_pyr.index)
ax.grid()
plt.savefig(f'{FIGURES}/')

# standardize data for pca 
# #features = ['sepal length', 'sepal width', 'petal length', 'petal width']# Separating out the features
pca_df_all_proteomics_and_pyr = pd.read_csv(proteomics_dataset, index_col="UP").loc[df.index,:]
pca_df_all_proteomics_and_pyr['pyr_1'] = abs_usages_1
pca_df_all_proteomics_and_pyr = pca_df_all_proteomics_and_pyr[pca_df_all_proteomics_and_pyr['pyr_1'] > 0]
pca_df_all_proteomics_and_pyr = pca_df_all_proteomics_and_pyr.T.dropna(axis='columns')
x = pca_df_all_proteomics_and_pyr.values
x = StandardScaler().fit_transform(x)

# run pca
from sklearn.decomposition import PCA
pca = PCA(n_components=2)
principalComponents = pca.fit_transform(x)
principalDf = pd.DataFrame(data = principalComponents, columns = ['principal component 1', 'principal component 2'])
principalDf.index = pca_df_all_proteomics_and_pyr.index

fig = plt.figure(figsize = (8,8))
ax = fig.add_subplot(1,1,1) 
ax.set_xlabel('Principal Component 1', fontsize = 15)
ax.set_ylabel('Principal Component 2', fontsize = 15)
ax.set_title('2 component PCA without zero values', fontsize = 20)

amount = len(principalDf.index)
for i in range(amount):
    c = [float(i)/float(amount), 0.0, float(amount-i)/float(amount)] #R,G,B
    ax.scatter(principalDf.loc[principalDf.index[i], 'principal component 1']
           , principalDf.loc[principalDf.index[i], 'principal component 2']
           , color = c 
           , s = 50)
ax.scatter(principalDf.loc["pyr_1", 'principal component 1']
           , principalDf.loc[principalDf.index[i], 'principal component 2']
           , color = "green"
           , s = 50)

ax.grid()
pd.DataFrame({'ac_1':abs_usages_1, 'ac_2':abs_usages_2, 'ac_3':abs_usages_3}).to_csv(f'{INTERMEDIATE}/proteomics/acetate_usages.csv')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14790858128503664, 'fraction_numerical': 0.02630444156964209, 'mean_word_length': 5.570821529745042, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '414302', 'license': 'CC0-1.0', 'n_tokens_mistral': 1898, 'n_tokens_neox': 1765, 'n_words': 339, 'path': 'data_science/code/modeling/acetate/ec_incorporation_acetate.ipynb', 'repo_name': 'blablabananarama/thesis', 'size': '4638'}