class Protein(models.Model): """A Django model to hold the information for a given protein, unique set of coords""" # code for this protein (e.g. NUDT5A-x0001_1) code = models.CharField(max_length=50, db_index=True) target_id = models.ForeignKey(Target) apo_holo = models.NullBooleanField() # Set the groups types prot_choices, default_prot = get_prot_choices() prot_type = models.CharField(choices=prot_choices, default=default_prot, max_length=2) pdb_info = models.FileField(upload_to="pdbs/", null=True, max_length=255) bound_info = models.FileField(upload_to="bound/", null=True, max_length=255) cif_info = models.FileField(upload_to="cifs/", null=True, max_length=255) mtz_info = models.FileField(upload_to="mtzs/", null=True, max_length=255) map_info = models.FileField(upload_to="maps/", null=True, max_length=255) aligned = models.NullBooleanField() aligned_to = models.ForeignKey("self", null=True) has_eds = models.NullBooleanField() class Meta: unique_together = ("code", "prot_type") permissions = (("view_protein", "View protein"), )
class Protein(models.Model): """Django model for holding information about a protein. A protein is a protein structure which has a unique set of 3D coordinates, rather than a target, which is a set of protein objects of the same protein. A Molecule object is also linked to a protein, so that a complete structure is comprised of the molecule and protein in separate parts in fragalysis. Parameters ---------- code: CharField A unique name for the protein (e.g. NUDT5A-x0001_1) target_id: ForeignKey Foreign key linking the protein to it's target apo_holo: NullBooleanField 0 for apo (ligand removed), 1 for holo (ligand in tact) prot_type: CharField protein type - from a pre-defined list and determined by file extension on upload (defined in loader.config.get_prot_choices): prot_choices = ( (APO, "Apo", "_apo.pdb", "APO"), (STRIPPED, "Stripped", "_no_buffer_altlocs.pdb", "STRIPPED"), (TLEAPED, "Tleaped", "_tleap.pdb", "TLEAP"), (CHUNKED, "Chunked", "_chunk.pdb", "CHUNK"), (BOUND, "Bound", '_bound.pdb', "BOUND") ) pdb_info: FileField File link to apo pdb structure - pdb file with ligand removed bound_info: FileField File link to bound state structure - same as apo pdb but with ligand in-tact cif_info: FileField File link to cif file for ligand restraints (optional) mtz_info: FileField File link to uploaded mtz file (optional) map_info: FileField File link to uploaded map file (optional) aligned: NullBooleanField Bool - 1 if aligned, 0 if not aligned_to: ForeignKey (self) Foreign key to another instance of a protein to which this protein is aligned (optional) has_eds: NullBooleanField Bool - 1 if has ED, 0 it not (optional) """ # code for this protein (e.g. NUDT5A-x0001_1A) code = models.CharField(max_length=50, db_index=True) target_id = models.ForeignKey(Target, on_delete=models.CASCADE) apo_holo = models.NullBooleanField() # Set the groups types prot_choices, default_prot = get_prot_choices() prot_type = models.CharField( choices=prot_choices, default=default_prot, max_length=2 ) pdb_info = models.FileField(upload_to="pdbs/", null=True, max_length=255) bound_info = models.FileField(upload_to="bound/", null=True, max_length=255) cif_info = models.FileField(upload_to="cifs/", null=True, max_length=255) mtz_info = models.FileField(upload_to="mtzs/", null=True, max_length=255) map_info = models.FileField(upload_to="maps/", null=True, max_length=255) sigmaa_info = models.FileField(upload_to="maps/", null=True, max_length=255) diff_info = models.FileField(upload_to="maps/", null=True, max_length=255) event_info = models.FileField(upload_to="maps/", null=True, max_length=255) aligned = models.NullBooleanField() aligned_to = models.ForeignKey("self", null=True, on_delete=models.CASCADE) has_eds = models.NullBooleanField() class Meta: unique_together = ("code", "prot_type")