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

pockets_nb is a property of the PPI, not the complex

change data model and migration script
parent 1808807b
No related branches found
No related tags found
No related merge requests found
......@@ -175,6 +175,7 @@ select distinct protein.NumUniprot, domain.PfamNumAccession , complexe.NbCopy,
ppi = Ppi()
disease, created = Disease.objects.get_or_create(name=row[7])
ppi.pdb_id = row[4]
ppi.pockets_nb = 1
ppi.symmetry = Symmetry.objects.get(code='AS')
ppi.save()
ppi.diseases.add(disease)
......@@ -194,7 +195,6 @@ select distinct protein.NumUniprot, domain.PfamNumAccession , complexe.NbCopy,
c.ppc_copy_nb = row[2]
if isinstance(c, ProteinDomainBoundComplex):
c.ppp_copy_nb_per_p = 1
c.pockets_nb = 1
c.save()
# create the PpiComplex object
ppi_complex = PpiComplex()
......
......@@ -131,7 +131,6 @@ class ProteinDomainComplex(models.Model):
class ProteinDomainBoundComplex(ProteinDomainComplex):
ppp_copy_nb_per_p = models.IntegerField('Number of copies of the protein in the pocket')
pockets_nb = models.IntegerField('Total number of pockets in the complex')
class Meta:
verbose_name_plural = "bound complexes"
......@@ -158,6 +157,7 @@ class Disease(models.Model):
class Ppi(models.Model):
pdb_id = models.CharField('PDB ID', max_length=4, null=True)
pockets_nb = models.IntegerField('Total number of pockets in the complex', default=1)
symmetry = models.ForeignKey(Symmetry)
diseases = models.ManyToManyField(Disease)
......
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