Skip to content
Snippets Groups Projects
Commit e9c16014 authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

add compound smiles to the biplots in the DB

this is to be used to display compound structures in biplots
for #78


Former-commit-id: fa228c05ef260891812bb6af526bf54a60f8e9a3
parent b4819206
No related branches found
No related tags found
No related merge requests found
36d6cd00e9e6efdd15fc7cff299eb7ef8e17c136
\ No newline at end of file
0278cb552333e3c6a9abdb8ccbd7a3a7f573486b
\ No newline at end of file
......@@ -20,7 +20,7 @@ class Command(BaseCommand):
if comp.le is not None:
le = round(comp.le, 7)
lle = round(comp.lle, 7)
le_lle_data.append({'x': le, 'y': lle, 'id': comp.id, 'family_name': comp.best_pXC50_activity_ppi_family})
le_lle_data.append({'x': le, 'y': lle, 'id': comp.id, 'family_name': comp.best_pXC50_activity_ppi_family, 'smiles': comp.canonical_smile})
else:
self.stdout.write(
self.style.WARNING('compound %s has no LE (probably because no pXC50 activity results have been registered)' % comp.id))
......
......@@ -81,7 +81,8 @@ class Command(BaseCommand):
principal_df = pd.DataFrame(data = principal_components , columns = ['x', 'y'])
final_df = pd.concat([principal_df, df[['family','id']]], axis = 1)
for index, row in final_df.iterrows():
pca_data.append({'x': row.x, 'y': row.y, 'id': row.id, 'family_name': row.family})
smiles = Compound.objects.get(id=row.id).canonical_smile
pca_data.append({'x': row.x, 'y': row.y, 'id': row.id, 'family_name': row.family, 'smiles': smiles})
pca_data_cc = {'data': pca_data, 'correlation_circle': figdata_png.decode("utf-8")}
pca_json = json.dumps(pca_data_cc, separators=(',',':'))
new = PcaBiplotData()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment