From a663f6d59e1679bff5c8cafeb0f93039b32506e6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Herv=C3=A9=20=20MENAGER?= <herve.menager@pasteur.fr>
Date: Wed, 4 Apr 2018 17:57:22 +0200
Subject: [PATCH] started working on compound LE vs LLE biplot, WIP

Former-commit-id: 76a8d4129343edf8f59505cd3317ad37a2cde881
---
 ippisite/ippidb/management/commands/lle_le.py | 17 +++++++++++++++++
 ippisite/ippidb/models.py                     |  3 +++
 ippisite/requirements.txt                     |  1 +
 3 files changed, 21 insertions(+)
 create mode 100644 ippisite/ippidb/management/commands/lle_le.py

diff --git a/ippisite/ippidb/management/commands/lle_le.py b/ippisite/ippidb/management/commands/lle_le.py
new file mode 100644
index 00000000..9eeec916
--- /dev/null
+++ b/ippisite/ippidb/management/commands/lle_le.py
@@ -0,0 +1,17 @@
+import glob
+
+from django.utils import timezone
+from django.core.management import BaseCommand, CommandError
+
+from ippidb.models import Compound
+
+class Command(BaseCommand):
+
+    help = "Generate the data for the compound LE vs LLE biplot"
+
+    def handle(self, *args, **options):
+        self.stdout.write(self.style.SUCCESS('Generating the LE vs. LLE biplot...'))
+        df = Compound.objects.all().to_dataframe()
+        df['le']=df[
+        print(df.to_csv())
+        print(df.columns)
diff --git a/ippisite/ippidb/models.py b/ippisite/ippidb/models.py
index dc2484e4..ba47ac4a 100644
--- a/ippisite/ippidb/models.py
+++ b/ippisite/ippidb/models.py
@@ -1,6 +1,7 @@
 from __future__ import unicode_literals
 
 from django.db import models
+from django_pandas.managers import DataFrameManager
 
 from .ws import get_pubmed_info, get_epo_info, get_uniprot_info, get_taxonomy_info, get_go_info, get_pfam_info
 
@@ -321,6 +322,8 @@ class Compound(models.Model):
     mddr_compound = models.ForeignKey(
         'MDDRCompoundImport', models.CASCADE, blank=True, null=True)
 
+    objects = DataFrameManager()
+
     @property
     def biblio_refs(self):
         """
diff --git a/ippisite/requirements.txt b/ippisite/requirements.txt
index 3d316df5..946f211d 100644
--- a/ippisite/requirements.txt
+++ b/ippisite/requirements.txt
@@ -1,5 +1,6 @@
 Django==1.11
 django-bootstrap3
+django-pandas
 bioservices
 #typing
 django-extensions>=2.0.5
-- 
GitLab