Skip to content
Snippets Groups Projects
Commit 072a4a29 authored by Olivia Doppelt-Azeroual's avatar Olivia Doppelt-Azeroual
Browse files
parents f5ab69f2 d7519b44
No related branches found
No related tags found
No related merge requests found
No preview for this file type
...@@ -228,7 +228,50 @@ select distinct protein.NumUniprot, domain.PfamNumAccession , complexe.NbCopy, ...@@ -228,7 +228,50 @@ select distinct protein.NumUniprot, domain.PfamNumAccession , complexe.NbCopy,
compound.log_d = row[13] #LogD compound.log_d = row[13] #LogD
compound.a_log_p = row[14] #ALogP compound.a_log_p = row[14] #ALogP
compound.mean_atom_vol_vdw = row[15] #MeanAtomVolVdW compound.mean_atom_vol_vdw = row[15] #MeanAtomVolVdW
compound.molecular_weight = row[16] compound.molecular_weight = row[16] #MolecularWeight
compound.nb_acceptor_h = row[17] #NbAcceptorH
compound.nb_aliphatic_amines = row[18] #NbAliphaticsAmines
compound.nb_aromatic_bonds = row[19] #NbAromaticBonds
compound.nb_aromatic_ether = row[20] #NbAromaticsEther
compound.nb_aromatic_sssr = row[21] #NbAromaticsSSSR
compound.nb_atom = row[22] #NbAtom
compound.nb_atom_non_h = row[23] #NbAtomNonH
compound.nb_benzene_like_rings = row[24] #NbBenzLikeRings
compound.nb_bonds = row[25] #NbBonds
compound.nb_bonds_non_h = row[26] #NbBondsNonH
compound.nb_br = row[27] #NbBr
compound.nb_c = row[28] #NbC
compound.nb_chiral_centers = row[29] #NbChiralCenters
compound.nb_circuits = row[30] #NbCircuits
compound.nb_cl = row[31] #NbCl
compound.nb_csp2 = row[32] #NbCsp2
compound.nb_csp3 = row[33] #NbCsp3
compound.nb_donor_h = row[34] #NbDonorH
compound.nb_double_bonds = row[35] #NbDoubleBonds
compound.nb_f = row[36] #NbF
compound.nb_i = row[37] #NbI
compound.nb_multiple_bonds = row[38] #NbMultBonds
compound.nb_n = row[39] #NbN
compound.nb_o = row[40] #NbO
compound.nb_rings = row[41] #NbRings
compound.nb_rotatable_bonds = row[42] #NbRotatableBonds
compound.randic_index = row[44] #RandicIndex
compound.rdf070m = row[45] #RDF070m
compound.rotatable_bond_fraction = row[46] #RotatableBondFraction
compound.sum_atom_polar = row[47] #SumAtomPolar
compound.sum_atom_vol_vdw = row[48] #SumAtomVolVdW
compound.tpsa = row[51] #TPSA
compound.ui = row[52] #Ui
compound.wiener_index = row[54] #WienerIndex
if row[55]!='N':
compound.common_name = row[55] #CmpdNameSh
compound.pubchem_id = row[56] #IdPubchem
if row[57]!='N':
compound.chemspider_id = row[57] #IdPubchem
compound.chembl_id = row[58]
compound.iupac_name = row[59]
#compound.mddr_compound = row[60]
#FIXME lookup MDDR to get the right ID
compound.save() compound.save()
except Exception as e: except Exception as e:
if options['stoponfail']: if options['stoponfail']:
......
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-05-19 14:42
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ippidb', '0014_auto_20170519_1243'),
]
operations = [
migrations.AlterField(
model_name='compound',
name='pubchem_id',
field=models.CharField(blank=True, max_length=10, null=True, verbose_name='Pubchem ID'),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-05-19 14:53
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ippidb', '0015_auto_20170519_1442'),
]
operations = [
migrations.AlterField(
model_name='compound',
name='iupac_name',
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='IUPAC name'),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-05-19 15:00
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ippidb', '0016_auto_20170519_1453'),
]
operations = [
migrations.AlterField(
model_name='compound',
name='chembl_id',
field=models.CharField(blank=True, max_length=30, null=True, verbose_name='Chembl ID'),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-05-22 15:01
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ippidb', '0017_auto_20170519_1500'),
]
operations = [
migrations.CreateModel(
name='MDDRActivityClass',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('activity_class', models.CharField(max_length=100, unique=True, verbose_name='Activity Class')),
],
options={
'verbose_name_plural': 'MDDR activity classes',
},
),
migrations.AlterUniqueTogether(
name='mddrcompoundactivityclass',
unique_together=set([]),
),
migrations.RemoveField(
model_name='mddrcompoundactivityclass',
name='mddr_compound',
),
migrations.DeleteModel(
name='MDDRCompoundActivityClass',
),
migrations.AddField(
model_name='mddrcompoundimport',
name='activity_classes',
field=models.ManyToManyField(to='ippidb.MDDRActivityClass'),
),
]
...@@ -236,13 +236,22 @@ class Compound(models.Model): ...@@ -236,13 +236,22 @@ class Compound(models.Model):
ui = models.DecimalField('Unsaturation index', max_digits=4, decimal_places=2) ui = models.DecimalField('Unsaturation index', max_digits=4, decimal_places=2)
wiener_index = models.IntegerField('Wiener index') wiener_index = models.IntegerField('Wiener index')
common_name = models.CharField('Common name', unique=True, max_length=20, blank=True, null=True) common_name = models.CharField('Common name', unique=True, max_length=20, blank=True, null=True)
pubchem_id = models.CharField('Pubchem ID', unique=True, max_length=10, blank=True, null=True) pubchem_id = models.CharField('Pubchem ID', max_length=10, blank=True, null=True)
chemspider_id = models.CharField('Chemspider ID', unique=True, max_length=10, blank=True, null=True) chemspider_id = models.CharField('Chemspider ID', unique=True, max_length=10, blank=True, null=True)
chembl_id = models.CharField('Chembl ID', unique=True, max_length=30, blank=True, null=True) chembl_id = models.CharField('Chembl ID', max_length=30, blank=True, null=True)
iupac_name = models.CharField('IUPAC name', unique=True, max_length=255, blank=True, null=True) iupac_name = models.CharField('IUPAC name', max_length=255, blank=True, null=True)
mddr_compound = models.ForeignKey('MDDRCompoundImport', blank=True, null=True) mddr_compound = models.ForeignKey('MDDRCompoundImport', blank=True, null=True)
class MDDRActivityClass(models.Model):
activity_class = models.CharField('Activity Class', max_length=100, unique=True)
class Meta:
verbose_name_plural = "MDDR activity classes"
def __str__(self):
return self.activity_class
class MDDRCompoundImport(models.Model): class MDDRCompoundImport(models.Model):
mddr_compound_id = models.IntegerField('MDDR compound ID') mddr_compound_id = models.IntegerField('MDDR compound ID')
mddr_name = models.CharField('MDDR name', max_length=40) mddr_name = models.CharField('MDDR name', max_length=40)
...@@ -250,6 +259,7 @@ class MDDRCompoundImport(models.Model): ...@@ -250,6 +259,7 @@ class MDDRCompoundImport(models.Model):
canonical_smile = models.CharField('Canonical Smile', max_length=500, unique=True, blank=True, null=True) canonical_smile = models.CharField('Canonical Smile', max_length=500, unique=True, blank=True, null=True)
#TODO index this table on canonical_smile #TODO index this table on canonical_smile
db_import_date = models.DecimalField('MDDR release year/month', max_digits=6, decimal_places=0) db_import_date = models.DecimalField('MDDR release year/month', max_digits=6, decimal_places=0)
activity_classes = models.ManyToManyField(MDDRActivityClass)
class Meta: class Meta:
# over multiple releases of the MDDR database, the same compound can evolve in its development phase # over multiple releases of the MDDR database, the same compound can evolve in its development phase
...@@ -257,16 +267,6 @@ class MDDRCompoundImport(models.Model): ...@@ -257,16 +267,6 @@ class MDDRCompoundImport(models.Model):
unique_together = (('mddr_compound_id', 'mddr_name', 'dvpmt_phase'),) unique_together = (('mddr_compound_id', 'mddr_name', 'dvpmt_phase'),)
verbose_name_plural = "MDDR compound imports" verbose_name_plural = "MDDR compound imports"
class MDDRCompoundActivityClass(models.Model):
mddr_compound = models.ForeignKey(MDDRCompoundImport)
activity_class = models.CharField('Activity Class', max_length=100)
class Meta:
unique_together = (('mddr_compound', 'activity_class'),)
verbose_name_plural = "MDDR compound activity classes"
class MDDRSimilarity(models.Model): class MDDRSimilarity(models.Model):
canonical_smile_ippidb = models.CharField('Canonical Smile for IPPIDB compound', max_length=500, unique=True, blank=True, null=True) canonical_smile_ippidb = models.CharField('Canonical Smile for IPPIDB compound', max_length=500, unique=True, blank=True, null=True)
canonical_smile_mddr = models.CharField('Canonical Smile for MDDR Compound', max_length=500, unique=True, blank=True, null=True) canonical_smile_mddr = models.CharField('Canonical Smile for MDDR Compound', max_length=500, unique=True, blank=True, null=True)
......
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