Exemplo n.º 1
0
class CompoundXref(
        six.with_metaclass(ChemblModelMetaClass, ChemblCoreAbstractModel)):

    molecule = models.ForeignKey(MoleculeDictionary,
                                 db_column='molregno',
                                 help_text=u'Foreign key to compounds table')
    xref_src_db = models.ForeignKey(
        XrefSource,
        db_column='xref_src_db',
        help_text=u'Name of the database that this cross reference links to')
    xref_id = ChemblCharField(
        max_length=330,
        unique=True,
        help_text=u'Identifier for the entry in the cross-referenced database')
    xref_name = ChemblCharField(
        max_length=150,
        blank=True,
        null=True,
        help_text=
        u'Name for the entry in the cross-referenced database, where applicable'
    )
    cmpd_xref_id = ChemblPositiveIntegerField(primary_key=True, length=9)

    class Meta(ChemblCoreAbstractModel.Meta):
        pass
Exemplo n.º 2
0
class ResearchCompanies(
        six.with_metaclass(ChemblModelMetaClass, ChemblCoreAbstractModel)):

    co_stem_id = ChemblAutoField(primary_key=True,
                                 length=9,
                                 help_text=u'Primary key.')
    res_stem = models.ForeignKey(
        ResearchStem,
        blank=True,
        null=True,
        help_text=u'Foreign key to research_stem table.')
    company = ChemblCharField(
        max_length=100,
        blank=True,
        null=True,
        help_text=
        u'Name of current company associated with this research code stem.')
    country = ChemblCharField(
        max_length=50,
        blank=True,
        null=True,
        help_text=u'Country in which the company uses this research code stem.'
    )  # TODO: should have a constraint
    previous_company = ChemblCharField(
        max_length=100,
        blank=True,
        null=True,
        help_text=
        u'Previous name of the company associated with this research code stem (e.g., if the company has undergone acquisitions/mergers).'
    )

    class Meta(ChemblCoreAbstractModel.Meta):
        unique_together = (("res_stem", "company"), )
Exemplo n.º 3
0
class MoleculeSynonyms(
        six.with_metaclass(ChemblModelMetaClass, ChemblCoreAbstractModel)):

    molecule = models.ForeignKey(
        MoleculeDictionary,
        db_column='molregno',
        help_text=u'Foreign key to molecule_dictionary')
    synonyms = ChemblCharField(max_length=200,
                               db_index=True,
                               blank=True,
                               null=True,
                               help_text=u'Synonym for the compound')
    syn_type = ChemblCharField(
        max_length=50,
        help_text=
        u'Type of name/synonym (e.g., TRADE_NAME, RESEARCH_CODE, USAN)')
    molsyn_id = ChemblAutoField(primary_key=True,
                                length=9,
                                help_text=u'Primary key.')
    res_stem = models.ForeignKey(
        ResearchStem,
        blank=True,
        null=True,
        help_text=
        u'Foreign key to the research_stem table. Where a synonym is a research code, this links to further information about the company associated with that code.'
    )
    molecule_synonym = ChemblCharField(max_length=200,
                                       blank=True,
                                       null=True,
                                       help_text=u'Synonym for the compound')

    class Meta(ChemblCoreAbstractModel.Meta):
        unique_together = (("molecule", "synonyms", "syn_type"), )
Exemplo n.º 4
0
class RecordSynonyms(
        six.with_metaclass(ChemblModelMetaClass, ChemblCoreAbstractModel)):

    rec_syn_id = ChemblAutoField(primary_key=True,
                                 length=9,
                                 help_text=u'Primary key.')
    record = models.ForeignKey(CompoundRecords)
    record_synonym = ChemblCharField(
        max_length=200,
        blank=True,
        null=True,
        help_text=u'Synonym for the compound record')
    syn_type = ChemblCharField(
        max_length=50,
        help_text=
        u'Type of name/synonym (e.g., TRADE_NAME, RESEARCH_CODE, USAN)')
    res_stem = models.ForeignKey(
        ResearchStem,
        blank=True,
        null=True,
        help_text=
        u'Foreign key to the research_stem table. Where a synonym is a research code, this links to further information about the company associated with that code.'
    )
    canonical_synonym = ChemblCharField(
        max_length=200,
        blank=True,
        null=True,
        help_text=u'Canonical synonym for the compound record')
    removed = ChemblNullBooleanField(
        default=0,
        help_text=
        "Indicates whether the synonym has been removed (1) from the database")

    class Meta(ChemblCoreAbstractModel.Meta):
        unique_together = (("record", "record_synonym", "syn_type"), )
Exemplo n.º 5
0
class StructuralAlerts(
        six.with_metaclass(ChemblModelMetaClass, ChemblCoreAbstractModel)):

    ALERT_SET_ID_CHOICES = (
        (1, '1'),
        (2, '2'),
        (3, '3'),
        (4, '4'),
        (5, '5'),
        (6, '6'),
        (7, '7'),
        (8, '8'),
    )

    alert_id = ChemblPositiveIntegerField(
        primary_key=True,
        length=9,
        help_text=u'Primary key. Unique identifier for the structural alert')
    alert_set = models.ForeignKey(
        StructuralAlertSets,
        choices=ALERT_SET_ID_CHOICES,
        help_text=
        u'Foreign key to structural_alert_sets table indicating which set this particular alert comes from'
    )
    alert_name = ChemblCharField(max_length=100,
                                 help_text=u'A name for the structural alert')
    smarts = ChemblCharField(
        max_length=4000,
        help_text=
        u'SMARTS defining the structural feature that is considered to be an alert'
    )

    class Meta(ChemblCoreAbstractModel.Meta):
        pass  #unique_together = ( ("alert_set", "alert_name", "smarts"),  )
Exemplo n.º 6
0
class Biotherapeutics(
        six.with_metaclass(ChemblModelMetaClass, ChemblCoreAbstractModel)):

    molecule = models.OneToOneField(
        MoleculeDictionary,
        primary_key=True,
        db_column='molregno',
        help_text=u'Foreign key to molecule_dictionary')
    description = ChemblCharField(
        max_length=2000,
        blank=True,
        null=True,
        help_text=u'Description of the biotherapeutic.')
    helm_notation = ChemblCharField(
        max_length=4000,
        blank=True,
        null=True,
        help_text=
        u'Sequence notation generated according to the HELM standard (http://www.openhelm.org/home). Currently for peptides only'
    )
    bio_component_sequences = models.ManyToManyField(
        'BioComponentSequences',
        through="BiotherapeuticComponents",
        blank=True)

    class Meta(ChemblCoreAbstractModel.Meta):
        pass
Exemplo n.º 7
0
class UcStructure(six.with_metaclass(ChemblModelMetaClass, ChemblAbstractModel)):

    uci = ChemblCharField(primary_key=True, max_length=20, help_text=u'UniChem Identifier')
    standardinchi = ChemblCharField(max_length=4000, unique=True, blank=True, null=True, help_text=u'The standard Inchi assigned to this UCI')
    standardinchikey = ChemblCharField(max_length=30, unique=True, blank=True, null=True, help_text=u'The Standard Inchi Key generated from the Standard Inchi field.')
    created = ChemblDateField(blank=True, null=True, help_text=u'Date this record was first created')
    username = ChemblCharField(max_length=20, blank=True, null=True, help_text=u'Name of user who created this record.')
    fikhb = ChemblCharField(max_length=14, db_index=True, blank=True, null=True, help_text=u'First InchKey Hash Block. 14 letters that appear at the start of the InChiKey. Denotes the connectivity of the inchi')

    class Meta:
        app_label = 'unistruct'
        managed = False
Exemplo n.º 8
0
class UcXref(six.with_metaclass(ChemblModelMetaClass, ChemblAbstractModel)):

    uci = models.OneToOneField(UcStructure, primary_key=True, db_column='uci', help_text=u'Foreign key to UCI in UC_STRUCTURE')
    src = models.OneToOneField(UcSource, primary_key=True, help_text=u'Foreign key to SRC_ID in UC_SOURCE')
    src_compound_id = ChemblCharField(primary_key=True, max_length=400, help_text=u'ID of compound as defined in source.')
    assignment = ChemblNullableBooleanField(help_text=u'Flag to indicate whether this assignment of src_compound_id to UCI is CURRENT [1], or is OBSOLETE [0]. ie is this assignment true in the current release.')
    last_release_u_when_current = ChemblNoLimitDecimalField(blank=True, null=True, help_text=u'For obsolete assignments, UniChem release number where ASSIGNMENT was last CURRENT. Note, this release number refers to the release_u, ie the release number assigned by unichem')
    created = ChemblDateField(blank=True, null=True, help_text=u'Date this record was first created.')
    lastupdated = ChemblDateField(blank=True, null=True, help_text=u'Date this record was last updated [NB Only update permitted is the changing of CURRENT to OBSOLETE together with the changing of last_release_when_current from null to a version number]')
    userstamp = ChemblCharField(max_length=20, blank=True, null=True, help_text=u'User who last updated this record.')
    aux_src = ChemblCharField(max_length=4000, blank=True, null=True, help_text=u'Auxiliary information associated with this src_compound_id')

    class Meta:
        unique_together = (("uci", "src", "src_compound_id"),)
        app_label = 'unistruct'
        managed = False
Exemplo n.º 9
0
class UcRelease(six.with_metaclass(ChemblModelMetaClass, ChemblAbstractModel)):

    src = models.OneToOneField(UcSource, primary_key=True, help_text=u'Foreign key to SRC_ID in UC_SOURCE')
    release_u = ChemblNoLimitDecimalField(primary_key=True, help_text=u'The UniChem assigned release number of this data release, for this source - may be different to release numbers or dates assigned by the source')
    created = ChemblDateField(blank=True, null=True, help_text=u'The date that this record was created.')
    src_release_number = ChemblNoLimitDecimalField(blank=True, null=True, help_text=u'The release number (if any) assigned by the source (src) for this data release.')
    src_release_date = ChemblDateField(blank=True, null=True, help_text=u'The release date, if no SRC_RELEASE_NUMBER available, as supplied by the source src.')
    userstamp = ChemblCharField(max_length=20, blank=True, null=True, help_text=u'The user who created this record.')
    records_without_comments = ChemblPositiveIntegerField(length=38, blank=True, null=True, help_text=u'Number of records loaded without comments.')
    records_with_comments = ChemblPositiveIntegerField(length=38, blank=True, null=True, help_text=u'Number of records loaded with comments. Comments in UC_RELEASE_LOGs.')
    records_ignored = ChemblPositiveIntegerField(length=38, blank=True, null=True, help_text=u'Number of records ignored (ie: NOT loaded).  Comments in UC_RELEASE_LOGs.')
    number_of_new_ucis = ChemblPositiveIntegerField(length=38, blank=True, null=True, help_text=u'Number of new UCIs generated when this release was loaded.')
    uc_load_index = ChemblPositiveIntegerField(length=38, blank=True, null=True, help_text=u'Data Release Load Number (order in which data releases were loaded into UniChem)')
    misc = ChemblCharField(max_length=4000, blank=True, null=True)

    class Meta:
        unique_together = (("src", "release_u"),)
        app_label = 'unistruct'
        managed = False
Exemplo n.º 10
0
class StructuralAlertSets(
        six.with_metaclass(ChemblModelMetaClass, ChemblCoreAbstractModel)):

    ALERT_SET_ID_CHOICES = (
        (1, '1'),
        (2, '2'),
        (3, '3'),
        (4, '4'),
        (5, '5'),
        (6, '6'),
        (7, '7'),
        (8, '8'),
    )

    PRIORITY_CHOICES = (
        (1, '1'),
        (2, '2'),
        (3, '3'),
        (4, '4'),
        (5, '5'),
        (6, '6'),
        (7, '7'),
        (8, '8'),
    )

    SET_NAME_CHOICES = (
        ('BMS', 'BMS'),
        ('Dundee', 'Dundee'),
        ('Glaxo', 'Glaxo'),
        ('Inpharmatica', 'Inpharmatica'),
        ('LINT', 'LINT'),
        ('MLSMR', 'MLSMR'),
        ('PAINS', 'PAINS'),
        ('SureChEMBL', 'SureChEMBL'),
    )

    alert_set_id = ChemblPositiveIntegerField(
        primary_key=True,
        length=9,
        choices=ALERT_SET_ID_CHOICES,
        help_text=u'Unique ID for the structural alert set')
    set_name = ChemblCharField(
        max_length=100,
        unique=True,
        choices=SET_NAME_CHOICES,
        help_text=u'Name (or origin) of the structural alert set')
    priority = ChemblPositiveIntegerField(
        length=2,
        choices=PRIORITY_CHOICES,
        help_text=
        u'Priority assigned to the structural alert set for display on the ChEMBL interface (priorities >=4 are shown by default).'
    )

    class Meta(ChemblCoreAbstractModel.Meta):
        pass
Exemplo n.º 11
0
class CompoundStructures(
        six.with_metaclass(ChemblModelMetaClass, ChemblCoreAbstractModel)):

    molecule = models.OneToOneField(
        MoleculeDictionary,
        primary_key=True,
        db_column='molregno',
        help_text=
        u'Internal Primary Key for the compound structure and foreign key to molecule_dictionary table'
    )
    molfile = ChemblTextField(
        blank=True,
        null=True,
        help_text=u'MDL Connection table representation of compound')
    standard_inchi = ChemblCharField(
        max_length=4000,
        db_index=True,
        unique=True,
        blank=True,
        null=True,
        help_text=u'IUPAC standard InChI for the compound')
    standard_inchi_key = ChemblCharField(
        max_length=27,
        db_index=True,
        help_text=u'IUPAC standard InChI key for the compound')
    canonical_smiles = ChemblCharField(
        max_length=4000,
        db_index=True,
        blank=True,
        null=True,
        help_text=u'Canonical smiles, generated using pipeline pilot')
    structure_exclude_flag = ChemblBooleanField(
        default=False,
        help_text=
        u'Indicates whether the structure for this compound should be hidden from users (e.g., organometallic compounds with bad valence etc)'
    )

    class Meta(ChemblCoreAbstractModel.Meta):
        pass
Exemplo n.º 12
0
class BioComponentSequences(
        six.with_metaclass(ChemblModelMetaClass, ChemblCoreAbstractModel)):

    component_id = ChemblAutoField(
        primary_key=True,
        length=9,
        help_text=
        u'Primary key. Unique identifier for each of the molecular components of biotherapeutics in ChEMBL (e.g., antibody chains, recombinant proteins, synthetic peptides).'
    )
    component_type = ChemblCharField(
        max_length=50,
        help_text=u"Type of molecular component (e.g., 'PROTEIN','DNA','RNA')."
    )  # TODO: add constraint, is always PROTEIN now... this should be similar to compound sequences!!!
    description = ChemblCharField(
        max_length=200,
        blank=True,
        null=True,
        help_text=u'Description/name of molecular component.')
    sequence = ChemblTextField(
        blank=True,
        null=True,
        help_text=u'Sequence of the biotherapeutic component.')
    sequence_md5sum = ChemblCharField(
        max_length=32,
        blank=True,
        null=True,
        help_text=u'MD5 checksum of the sequence.')
    tax_id = ChemblPositiveIntegerField(
        length=11,
        blank=True,
        null=True,
        help_text=
        u'NCBI tax ID for the species from which the sequence is derived. May be null for humanized monoclonal antibodies, synthetic peptides etc.'
    )
    organism = ChemblCharField(
        max_length=150,
        blank=True,
        null=True,
        help_text=u'Name of the species from which the sequence is derived.')
    updated_on = ChemblDateField(blank=True, null=True)
    updated_by = ChemblCharField(max_length=100, blank=True, null=True)
    insert_date = ChemblDateField(blank=True, null=True)
    accession = ChemblCharField(max_length=25, blank=True, null=True)
    db_source = ChemblCharField(max_length=25, blank=True, null=True)
    db_version = ChemblCharField(max_length=10, blank=True, null=True)

    class Meta(ChemblCoreAbstractModel.Meta):
        pass
Exemplo n.º 13
0
class StructuralAlerts(
        six.with_metaclass(ChemblModelMetaClass, ChemblCoreAbstractModel)):

    alert_id = ChemblPositiveIntegerField(
        primary_key=True,
        length=9,
        help_text=u'Primary key. Unique identifier for the structural alert')
    alertset = models.ForeignKey(
        StructuralAlertSets,
        db_column='alert_set_id',
        help_text=
        u'Foreign key to structural_alert_sets table indicating which set this particular alert comes from'
    )
    alert_name = ChemblCharField(max_length=100,
                                 help_text=u'A name for the structural alert')
    smarts = ChemblCharField(
        max_length=4000,
        help_text=
        u'SMARTS defining the structural feature that is considered to be an alert'
    )

    class Meta(ChemblCoreAbstractModel.Meta):
        pass  # unique_together = (("alert_set", "alert_name", "smarts"),)
Exemplo n.º 14
0
class ResearchStem(
        six.with_metaclass(ChemblModelMetaClass, ChemblCoreAbstractModel)):

    res_stem_id = ChemblAutoField(
        primary_key=True,
        length=9,
        help_text=u'Primary key. Unique ID for each research code stem.')
    research_stem = ChemblCharField(
        max_length=20,
        unique=True,
        blank=True,
        null=True,
        help_text=u'The actual stem/prefix used in the research code.')

    class Meta(ChemblCoreAbstractModel.Meta):
        pass
Exemplo n.º 15
0
class StructuralAlertSets(
        six.with_metaclass(ChemblModelMetaClass, ChemblCoreAbstractModel)):

    alert_set_id = ChemblPositiveIntegerField(
        primary_key=True,
        length=9,
        help_text=u'Unique ID for the structural alert set')
    set_name = ChemblCharField(
        max_length=100,
        unique=True,
        help_text=u'Name (or origin) of the structural alert set')
    priority = ChemblPositiveIntegerField(
        length=2,
        help_text=
        u'Priority assigned to the structural alert set for display on the ChEMBL interface (priorities >=4 are shown by default).'
    )

    class Meta(ChemblCoreAbstractModel.Meta):
        pass
Exemplo n.º 16
0
class CompoundRecords(
        six.with_metaclass(ChemblModelMetaClass, ChemblCoreAbstractModel)):

    SRC_COMPOUND_ID_VERSION_CHOICES = (
        (1, '1'),
        (2, '2'),
        (3, '3'),
        (4, '4'),
        (5, '5'),
        (6, '6'),
        (7, '7'),
        (8, '8'),
    )

    record_id = ChemblAutoField(primary_key=True,
                                length=9,
                                help_text=u'Unique ID for a compound/record')
    molecule = models.ForeignKey(
        MoleculeDictionary,
        blank=True,
        null=True,
        db_column='molregno',
        help_text=u'Foreign key to compounds table (compound structure)')
    doc = models.ForeignKey(Docs, help_text=u'Foreign key to documents table')
    compound_key = ChemblCharField(
        max_length=250,
        db_index=True,
        blank=True,
        null=True,
        help_text=
        u'Key text identifying this compound in the scientific document')
    compound_name = ChemblCharField(
        max_length=4000,
        blank=True,
        null=True,
        help_text=u'Name of this compound recorded in the scientific document')
    filename = ChemblCharField(max_length=250, blank=True, null=True)
    updated_by = ChemblCharField(max_length=100, blank=True, null=True)
    updated_on = ChemblDateField(blank=True, null=True)
    src = models.ForeignKey(Source, help_text=u'Foreign key to source table')
    src_compound_id = ChemblCharField(
        max_length=150,
        db_index=True,
        blank=True,
        null=True,
        help_text=
        u'Identifier for the compound in the source database (e.g., pubchem SID)'
    )
    removed = ChemblNullBooleanField(default=0)
    src_compound_id_version = ChemblPositiveIntegerField(
        length=3,
        blank=True,
        null=True,
        choices=SRC_COMPOUND_ID_VERSION_CHOICES)
    curated = ChemblBooleanField(
        default=False,
        help_text=
        u'Can be marked as curated if the entry has been mapped to a molregno other than that given by the original structure, and hence care should be taken when updating'
    )
    products = models.ManyToManyField('Products',
                                      through="Formulations",
                                      null=True,
                                      blank=True)
    assays = models.ManyToManyField('Assays',
                                    through="Activities",
                                    null=True,
                                    blank=True)

    class Meta(ChemblCoreAbstractModel.Meta):
        pass
Exemplo n.º 17
0
class UcSource(six.with_metaclass(ChemblModelMetaClass, ChemblAbstractModel)):

    NUMBER_OR_DATE_CHOICES = (
        ('date', 'date'),
        ('number', 'number'),
        )

    SRC_CLASS_CHOICES = (
        (1, '1'),
        (2, '2'),
        (3, '3'),
        )

    src_id = ChemblPositiveIntegerField(length=2, primary_key=True, help_text=u'Unique ID for source (generated by UniChem, ie: an internal ID)')
    name = ChemblCharField(max_length=50, blank=True, null=True, help_text=u'Name of source')
    description = ChemblCharField(max_length=2000, blank=True, null=True, help_text=u'Description of this source.')
    current_release_u = ChemblPositiveIntegerField(length=2, blank=True, null=True, help_text=u'Current unichem release number (assigned by unichem) of this source')
    created = ChemblDateField(blank=True, null=True, help_text=u'Date this record was created')
    last_updated = ChemblDateField(blank=True, null=True, help_text=u'Date this record was last updated')
    userstamp = ChemblCharField(max_length=20, blank=True, null=True, help_text=u'The user who last updated this record')
    number_or_date = ChemblCharField(max_length=20, blank=True, null=True, choices=NUMBER_OR_DATE_CHOICES, help_text=u'Does this source version data releases by date or by number')
    name_long = ChemblCharField(max_length=2000, blank=True, null=True, help_text=u'Name of Source. Longer form for presentation.')
    src_details = ChemblCharField(max_length=2000, blank=True, null=True, help_text=u'Technical details of how the data was/is obtained from the source. Note, more detailed info for each release can be found in UC_RELEASE.MISC')
    src_url = ChemblCharField(max_length=2000, blank=True, null=True, help_text=u'The Home Page URL for the source')
    base_id_url = ChemblCharField(max_length=2000, blank=True, null=True, help_text=u"The base url for the src_compound_id in the source. If 'null', then this source does not support direct links to src_compound_id pages. If not null, simply append src_compound_id to end of this string to create full url if base_id_url available = 1. If base_url_id_available = 0, then a more complex manipulation of base_id_url and src_compound_id is required (managed in interface)")
    base_id_url_available = ChemblNullableBooleanField(help_text=u"May the src_compound_id simply be appended to the base_url_id to create a valid url to a unique page for the src_compound_id ? 1 = yes, 0 = no, a more complex manipulation may be required to create the url. This field ignorred in interface if base_url_id is 'null'")
    aux_required = ChemblNullableBooleanField(help_text=u'Auxilliary information for each src-compound_id is required to be captured at load time for this source [col4 of input file], and stored in UC_XREF.AUX_SRC')
    aux_for_url = ChemblNullableBooleanField(help_text=u'Does the auxiliary information get used to create the URL instead of the src_compound_id ?')
    aux_description = ChemblCharField(max_length=4000, blank=True, null=True, help_text=u'If Auxiliary information is required (ie: if 1 in AUX_REQUIRED field), what is it required FOR, and how should it be processed ? Note: if AUX_FOR_URL = 1, then aux information is used to create the URL instead of the src_compound_id')
    private = ChemblPositiveIntegerField(length=38, blank=True, null=True, help_text=u'A flag to indicate whether data from this source is private (1) or can be made public (0)')
    name_label = ChemblCharField(max_length=200, blank=True, null=True, help_text=u'The name of the source, with spacing and case of text as in the source itself. Suitable for use as a label in hyperlinks. Always less than 30 characters.')
    src_class = ChemblPositiveIntegerField(length=38, blank=True, null=True, choices=SRC_CLASS_CHOICES, help_text=u'Class of the source. FK to UC_SRC_CLASS.CLASS_ID')
    keys_only = ChemblNullableBooleanField(help_text=u'Source has only InChIKeys, as InChIs are not made available. 1=yes, 0 or null = no')
    update_min = ChemblPositiveIntegerField(length=38, blank=True, null=True, help_text=u'The minimum number of days before which an update can be expected. Do not bother trying to update this source if days from last release is smaller than this.')
    update_opt = ChemblPositiveIntegerField(length=38, blank=True, null=True, help_text=u'The optimal number of days between releases (ie: you can expect a new release to be available if the days since the last release equals this number) ')
    update_max = ChemblPositiveIntegerField(length=38, blank=True, null=True, help_text=u'The maximum number of days after which an update can be considered very overdue.')
    update_j = ChemblNullableBooleanField(help_text=u'Are incremental updates appropriate for this source (1=yes, 0=no)')
    update_comments = ChemblCharField(max_length=500, blank=True, null=True, help_text=u'A comment on the reasons behind the settings used for other UPDATE_ columns in this table.')
    synonyms = ChemblPositiveIntegerField(length=38, blank=True, null=True, help_text=u'The number of synonyms captured from this source, and available in UC_SYNONYMS table.')

    class Meta:
        app_label = 'unistruct'
        managed = False
Exemplo n.º 18
0
class CompoundRecords(
        six.with_metaclass(ChemblModelMetaClass, ChemblCoreAbstractModel)):

    SRC_COMPOUND_ID_VERSION_CHOICES = (
        (1, '1'),
        (2, '2'),
        (3, '3'),
        (4, '4'),
        (5, '5'),
        (6, '6'),
        (7, '7'),
        (8, '8'),
    )

    record_id = ChemblAutoField(primary_key=True,
                                length=9,
                                help_text=u'Unique ID for a compound/record')
    molecule = models.ForeignKey(
        MoleculeDictionary,
        blank=True,
        null=True,
        db_column='molregno',
        help_text=u'Foreign key to compounds table (compound structure)')
    doc = models.ForeignKey(Docs, help_text=u'Foreign key to documents table')
    compound_key = ChemblCharField(
        max_length=250,
        db_index=True,
        blank=True,
        null=True,
        help_text=
        u'Key text identifying this compound in the scientific document')
    compound_name = ChemblCharField(
        max_length=4000,
        blank=True,
        null=True,
        help_text=u'Name of this compound recorded in the scientific document')
    filename = ChemblCharField(max_length=250, blank=True, null=True)
    updated_by = ChemblCharField(max_length=100, blank=True, null=True)
    updated_on = ChemblDateField(blank=True, null=True)
    src = models.ForeignKey(Source, help_text=u'Foreign key to source table')
    src_compound_id = ChemblCharField(
        max_length=150,
        db_index=True,
        blank=True,
        null=True,
        help_text=
        u'Identifier for the compound in the source database (e.g., pubchem SID)'
    )
    removed = ChemblNullBooleanField(default=0)
    src_compound_id_version = ChemblPositiveIntegerField(
        length=3,
        blank=True,
        null=True,
        choices=SRC_COMPOUND_ID_VERSION_CHOICES)
    curated = ChemblBooleanField(
        default=False,
        help_text=
        u'Can be marked as curated if the entry has been mapped to a molregno other than that given by the original structure, and hence care should be taken when updating'
    )
    load_date = ChemblDateField(blank=True,
                                null=True,
                                default=datetime.date.today)
    ridx = ChemblCharField(
        max_length=600,
        default=u'CLD0',
        help_text=u'The Depositor Defined Reference Identifier.')
    cidx = ChemblCharField(
        max_length=600,
        default=u'CLD0',
        help_text=u'The Depositor Defined Compound Identifier.')
    job_id = ChemblPositiveIntegerField(
        length=38,
        default=0,
        help_text=u'The JOB_ID assigned to this record when first inserted.')
    log_id = ChemblPositiveIntegerField(length=38, default=0)
    molregno_fixed = ChemblIntegerField(
        length=38,
        blank=True,
        null=True,
        help_text=
        u"The molregno associated with this record has been fixed by curators: Do not update automatically. null = not fixed. '1' = Fixed"
    )
    molregno_comment = ChemblCharField(
        max_length=3000,
        blank=True,
        null=True,
        help_text=u'The reason why this molregno is associated with this record'
    )
    molregno_sv = ChemblNoLimitDecimalField(
        blank=True,
        null=True,
        help_text=u'The version of the standardizer protocol used')
    products = models.ManyToManyField('Products',
                                      through="Formulations",
                                      blank=True)
    assays = models.ManyToManyField('Assays', through="Activities", blank=True)

    def __str__(self):
        return 'Compound Record {0} for Molecule {1}, name {2}, key {3}'.format(
            self.record_id, self.molecule.chembl_id if self.molecule else '',
            self.compound_name, self.compound_key)

    class Meta(ChemblCoreAbstractModel.Meta):
        pass
Exemplo n.º 19
0
class CompoundProperties(
        six.with_metaclass(ChemblModelMetaClass, ChemblCoreAbstractModel)):

    MOLECULAR_SPECIES_CHOICES = (
        ('ACID', 'ACID'),
        ('BASE', 'BASE'),
        ('ZWITTERION', 'ZWITTERION'),
        ('NEUTRAL', 'NEUTRAL'),
    )

    NUM_RO5_VIOLATIONS_CHOICES = (
        (0, '0'),
        (1, '1'),
        (2, '2'),
        (3, '3'),
        (4, '4'),
    )

    RO3_PASS_CHOICES = (
        ('Y', 'Y'),
        ('N', 'N'),
    )

    molecule = models.OneToOneField(
        MoleculeDictionary,
        primary_key=True,
        db_column='molregno',
        help_text=u'Foreign key to compounds table (compound structure)')
    mw_freebase = ChemblPositiveDecimalField(
        db_index=True,
        blank=True,
        null=True,
        decimal_places=2,
        max_digits=9,
        help_text=u'Molecular weight of parent compound')
    alogp = models.DecimalField(db_index=True,
                                blank=True,
                                null=True,
                                decimal_places=2,
                                max_digits=9,
                                help_text=u'Calculated ALogP')
    hba = ChemblPositiveIntegerField(
        length=3,
        db_index=True,
        blank=True,
        null=True,
        help_text=u'Number hydrogen bond acceptors')
    hbd = ChemblPositiveIntegerField(length=3,
                                     db_index=True,
                                     blank=True,
                                     null=True,
                                     help_text=u'Number hydrogen bond donors')
    psa = ChemblPositiveDecimalField(db_index=True,
                                     blank=True,
                                     null=True,
                                     decimal_places=2,
                                     max_digits=9,
                                     help_text=u'Polar surface area')
    rtb = ChemblPositiveIntegerField(length=3,
                                     db_index=True,
                                     blank=True,
                                     null=True,
                                     help_text=u'Number rotatable bonds')
    ro3_pass = ChemblCharField(
        max_length=3,
        blank=True,
        null=True,
        choices=RO3_PASS_CHOICES,
        help_text=
        u'Indicates whether the compound passes the rule-of-three (mw < 300, logP < 3 etc)'
    )
    num_ro5_violations = ChemblPositiveIntegerField(
        length=1,
        db_index=True,
        blank=True,
        null=True,
        choices=NUM_RO5_VIOLATIONS_CHOICES,
        help_text=
        u"Number of violations of Lipinski's rule-of-five, using HBA and HBD definitions"
    )
    acd_most_apka = models.DecimalField(
        blank=True,
        null=True,
        max_digits=9,
        decimal_places=2,
        help_text=u'The most acidic pKa calculated using ACDlabs v12.01')
    acd_most_bpka = ChemblPositiveDecimalField(
        blank=True,
        null=True,
        max_digits=9,
        decimal_places=2,
        help_text=u'The most basic pKa calculated using ACDlabs v12.01')
    acd_logp = models.DecimalField(
        blank=True,
        null=True,
        max_digits=9,
        decimal_places=2,
        help_text=
        u'The calculated octanol/water partition coefficient using ACDlabs v12.01'
    )
    acd_logd = models.DecimalField(
        blank=True,
        null=True,
        max_digits=9,
        decimal_places=2,
        help_text=
        u'The calculated octanol/water distribution coefficient at pH7.4 using ACDlabs v12.01'
    )
    molecular_species = ChemblCharField(
        max_length=50,
        blank=True,
        null=True,
        choices=MOLECULAR_SPECIES_CHOICES,
        help_text=u'Indicates whether the compound is an acid/base/neutral')
    full_mwt = ChemblPositiveDecimalField(
        blank=True,
        null=True,
        max_digits=9,
        decimal_places=2,
        help_text=u'Molecular weight of the full compound including any salts')
    aromatic_rings = ChemblPositiveIntegerField(
        length=3, blank=True, null=True, help_text=u'Number of aromatic rings')
    heavy_atoms = ChemblPositiveIntegerField(
        length=3,
        blank=True,
        null=True,
        help_text=u'Number of heavy (non-hydrogen) atoms')
    qed_weighted = ChemblPositiveDecimalField(
        blank=True,
        null=True,
        max_digits=3,
        decimal_places=2,
        help_text=
        u'Weighted quantitative estimate of drug likeness (as defined by Bickerton et al., Nature Chem 2012)'
    )
    updated_on = ChemblDateField(
        blank=True,
        null=True,
        help_text=u'Shows date properties were last recalculated')
    mw_monoisotopic = ChemblPositiveDecimalField(
        blank=True,
        null=True,
        max_digits=11,
        decimal_places=4,
        help_text=u'Monoisotopic parent molecular weight')
    full_molformula = ChemblCharField(
        max_length=100,
        blank=True,
        null=True,
        help_text=
        u'Molecular formula for the full compound (including any salt)')
    hba_lipinski = ChemblPositiveIntegerField(
        length=3,
        blank=True,
        null=True,
        help_text=
        u"Number of hydrogen bond acceptors calculated according to Lipinski's original rules (i.e., N + O count))"
    )
    hbd_lipinski = ChemblPositiveIntegerField(
        length=3,
        blank=True,
        null=True,
        help_text=
        u"Number of hydrogen bond donors calculated according to Lipinski's original rules (i.e., NH + OH count)"
    )
    num_lipinski_ro5_violations = ChemblPositiveIntegerField(
        length=1,
        blank=True,
        null=True,
        choices=NUM_RO5_VIOLATIONS_CHOICES,
        help_text=
        u"Number of violations of Lipinski's rule of five using HBA_LIPINSKI and HBD_LIPINSKI counts"
    )

    class Meta(ChemblCoreAbstractModel.Meta):
        pass
Exemplo n.º 20
0
class MoleculeBrowseDrugs(
        six.with_metaclass(ChemblModelMetaClass, ChemblCoreAbstractModel)):

    AVAILABILITY_TYPE_CHOICES = (
        (-2, -2),
        (-1, -1),
        (0, 0),
        (1, 1),
        (2, 2),
    )

    CHIRALITY_CHOICES = (
        (-1, -1),
        (0, 0),
        (1, 1),
        (2, 2),
    )

    DEVELOPMENT_PHASE_CHOICES = (
        (0, 0),
        (1, 1),
        (2, 2),
        (3, 3),
        (4, 4),
    )

    parent = models.OneToOneField('MoleculeDictionary',
                                  primary_key=True,
                                  db_column='parent_molregno')
    chembl = models.OneToOneField(
        ChemblIdLookup,
        blank=True,
        null=False,
        help_text=
        u'ChEMBL identifier for this compound (for use on web interface etc)')
    synonyms = ChemblCharField(max_length=4000, blank=True, null=True)
    development_phase = ChemblPositiveIntegerField(
        length=1, blank=True, null=True, choices=DEVELOPMENT_PHASE_CHOICES)
    research_codes = ChemblCharField(max_length=600, blank=True, null=True)
    applicants = ChemblCharField(max_length=2000, blank=True, null=True)
    usan_stem = ChemblCharField(max_length=600, blank=True, null=True)
    usan_year = ChemblPositiveIntegerField(length=4, blank=True, null=True)
    first_approval = ChemblPositiveIntegerField(length=4,
                                                blank=True,
                                                null=True)
    atc_code = ChemblCharField(max_length=2000, blank=True, null=True)
    drug_type = ChemblIntegerField(length=2, blank=True, null=True)
    rule_of_five = ChemblNullableBooleanField()
    first_in_class = ChemblNullableBooleanField()
    chirality = ChemblIntegerField(length=1,
                                   blank=True,
                                   null=True,
                                   choices=CHIRALITY_CHOICES)
    prodrug = ChemblNullableBooleanField()
    oral = ChemblNullableBooleanField()
    parenteral = ChemblNullableBooleanField()
    topical = ChemblNullableBooleanField()
    black_box = ChemblNullableBooleanField()
    availability_type = ChemblIntegerField(length=1,
                                           blank=True,
                                           null=True,
                                           choices=AVAILABILITY_TYPE_CHOICES)
    usan_stem_definition = ChemblCharField(max_length=2000,
                                           blank=True,
                                           null=True)
    indication_class = ChemblCharField(max_length=2000, blank=True, null=True)
    usan_stem_substem = ChemblCharField(max_length=300, blank=True, null=True)
    atc_code_description = ChemblCharField(max_length=2000,
                                           blank=True,
                                           null=True)
    ob_patent = ChemblCharField(max_length=120, blank=True, null=True)
    sc_patent = ChemblCharField(max_length=180, blank=True, null=True)
    withdrawn_year = ChemblPositiveIntegerField(length=4,
                                                blank=True,
                                                null=True)
    withdrawn_country = ChemblCharField(max_length=2000, blank=True, null=True)
    withdrawn_reason = ChemblCharField(max_length=2000, blank=True, null=True)
    withdrawn_class = ChemblCharField(max_length=1000, blank=True, null=True)

    class Meta(ChemblCoreAbstractModel.Meta):
        pass
Exemplo n.º 21
0
class MoleculeDictionary(
        six.with_metaclass(ChemblModelMetaClass, ChemblCoreAbstractModel)):

    AVAILABILITY_TYPE_CHOICES = (
        (-2, '-2'),
        (-1, '-1'),
        (0, '0'),
        (1, '1'),
        (2, '2'),
    )

    CHIRALITY_CHOICES = (
        (-1, '-1'),
        (0, '0'),
        (1, '1'),
        (2, '2'),
    )

    MAX_PHASE_CHOICES = (
        (0, '0'),
        (1, '1'),
        (2, '2'),
        (3, '3'),
        (4, '4'),
    )

    MOLECULE_TYPE_CHOICES = (
        ('Antibody', 'Antibody'),
        ('Cell', 'Cell'),
        ('Enzyme', 'Enzyme'),
        ('Oligonucleotide', 'Oligonucleotide'),
        ('Oligosaccharide', 'Oligosaccharide'),
        ('Protein', 'Protein'),
        ('Small molecule', 'Small molecule'),
        ('Unclassified', 'Unclassified'),
        ('Unknown', 'Unknown'),
    )

    NOMERGE_REASON_CHOICES = (
        ('GSK', 'GSK'),
        ('PARENT', 'PARENT'),
        ('PDBE', 'PDBE'),
        ('SALT', 'SALT'),
    )

    STRUCTURE_TYPE_CHOICES = (
        ('NONE', 'NONE'),
        ('MOL', 'MOL'),
        ('SEQ', 'SEQ'),
        ('BOTH', 'BOTH'),
    )

    @property
    def compoundImage(self):
        if hasattr(self, 'compoundimages'):
            return self.compoundimages
        return None

    @property
    def compoundMol(self):
        if hasattr(self, 'compoundmols'):
            return self.compoundmols
        return None

    @property
    def compoundProperty(self):
        if hasattr(self, 'compoundproperties'):
            return self.compoundproperties
        return None

    @property
    def compoundStructure(self):
        if hasattr(self, 'compoundstructures'):
            return self.compoundstructures
        return None

    @property
    def moleculeHierarchy(self):
        if hasattr(self, 'moleculehierarchy'):
            return self.moleculehierarchy
        return None

    molregno = ChemblAutoField(
        primary_key=True,
        length=9,
        help_text=u'Internal Primary Key for the molecule')
    pref_name = ChemblCharField(max_length=255,
                                db_index=True,
                                blank=True,
                                null=True,
                                help_text=u'Preferred name for the molecule')
    chembl = models.OneToOneField(
        ChemblIdLookup,
        blank=True,
        null=False,
        help_text=
        u'ChEMBL identifier for this compound (for use on web interface etc)'
    )  # This combination of null and blank is actually very important!
    max_phase = ChemblPositiveIntegerField(
        length=1,
        db_index=True,
        default=0,
        choices=MAX_PHASE_CHOICES,
        help_text=
        u'Maximum phase of development reached for the compound (4 = approved). Null where max phase has not yet been assigned.'
    )
    therapeutic_flag = ChemblBooleanField(
        db_index=True,
        default=False,
        help_text=
        u'Indicates that a drug has a therapeutic application (as opposed to e.g., an imaging agent, additive etc).'
    )
    dosed_ingredient = ChemblBooleanField(
        default=False,
        help_text=
        u'Indicates that the drug is dosed in this form (e.g., a particular salt)'
    )
    structure_key = ChemblCharField(
        max_length=27,
        db_index=True,
        unique=True,
        blank=True,
        null=True,
        help_text=
        u'Unique key for the structure/sequence (e.g., inchi_key or sequence md5sum) to help enforce non-redundancy.'
    )
    structure_type = ChemblCharField(
        max_length=10,
        default='MOL',
        choices=STRUCTURE_TYPE_CHOICES,
        novalidate_default=True,
        help_text=
        u'Indications whether the molecule has a small molecule structure or a protein sequence (MOL indicates an entry in the compound_structures table, SEQ indications an entry in the protein_therapeutics table, NONE indicates an entry in neither table, e.g., structure unknown)'
    )
    chebi_id = ChemblPositiveIntegerField(
        length=9,
        unique=True,
        blank=True,
        null=True,
        help_text=
        u'Assigned ChEBI ID for the compound, where it is a small molecule.')
    chebi_par_id = ChemblPositiveIntegerField(
        length=9,
        blank=True,
        null=True,
        help_text=
        u'Preferred ChEBI ID for the compound (where different from assigned)')
    insert_date = ChemblDateField(
        blank=False, null=True, default=datetime.date.today
    )  # blank is false because it has default value
    molfile_update = ChemblDateField(blank=True, null=True)
    downgraded = ChemblBooleanField(default=False)
    downgrade_reason = ChemblCharField(max_length=2000, blank=True, null=True)
    replacement_mrn = ChemblPositiveIntegerField(length=9,
                                                 blank=True,
                                                 null=True)
    checked_by = ChemblCharField(max_length=2000, blank=True, null=True)
    nomerge = ChemblBooleanField(
        default=False,
        help_text=
        u"Flag to show that this entry shouldn't be merged with others of the same structure (when set to 1)"
    )
    nomerge_reason = ChemblCharField(
        max_length=200,
        blank=True,
        null=True,
        choices=NOMERGE_REASON_CHOICES,
        help_text=
        u'Reason for entry not being merged with others of the same structure (e.g., known to be a stereoisomer)'
    )
    molecule_type = ChemblCharField(
        max_length=30,
        blank=True,
        null=True,
        choices=MOLECULE_TYPE_CHOICES,
        help_text=
        u'Type of molecule (Small molecule, Protein, Antibody, Oligosaccharide, Oligonucleotide, Cell, Unknown)'
    )
    first_approval = ChemblPositiveIntegerField(
        length=4,
        blank=True,
        null=True,
        help_text=u'Earliest known approval year for the molecule'
    )  # TODO: should be date!
    oral = ChemblBooleanField(
        default=False,
        help_text=
        u'Indicates whether the drug is known to be administered orally.')
    parenteral = ChemblBooleanField(
        default=False,
        help_text=
        u'Indicates whether the drug is known to be administered parenterally')
    topical = ChemblBooleanField(
        default=False,
        help_text=
        u'Indicates whether the drug is known to be administered topically.')
    black_box_warning = ChemblNullBooleanField(
        default=0,
        help_text=u'Indicates that the drug has a black box warning')
    natural_product = ChemblNullBooleanField(
        default=(-1),
        help_text=
        u'Indicates whether the compound is natural product-derived (currently curated only for drugs)'
    )
    first_in_class = ChemblNullBooleanField(
        default=(-1),
        help_text=
        u'Indicates whether this is known to be the first compound of its class (e.g., acting on a particular target).'
    )
    chirality = ChemblIntegerField(
        length=1,
        default=(-1),
        choices=CHIRALITY_CHOICES,
        help_text=
        u'Shows whether a drug is dosed as a racemic mixture (0), single stereoisomer (1) or is an achiral molecule (2)'
    )
    prodrug = ChemblNullBooleanField(
        default=(-1),
        help_text=
        u'Indicates that the molecule is a pro-drug (see molecule hierarchy for active component, where known)'
    )
    inorganic_flag = ChemblNullBooleanField(
        default=0,
        help_text=
        u'Indicates whether the molecule is inorganic (i.e., containing only metal atoms and <2 carbon atoms)'
    )
    usan_year = ChemblPositiveIntegerField(
        length=4,
        blank=True,
        null=True,
        help_text=
        u'The year in which the application for a USAN/INN name was made')
    availability_type = ChemblIntegerField(
        length=1,
        blank=True,
        null=True,
        choices=AVAILABILITY_TYPE_CHOICES,
        help_text=
        u'The availability type for the drug (0 = discontinued, 1 = prescription only, 2 = over the counter)'
    )
    usan_stem = ChemblCharField(
        max_length=50,
        blank=True,
        null=True,
        help_text=
        u'Where the compound has been assigned a USAN name, this indicates the stem, as described in the USAN_STEM table.'
    )
    polymer_flag = ChemblNullableBooleanField(
        help_text=
        u'Indicates whether a molecule is a small molecule polymer (e.g., polistyrex)'
    )
    usan_substem = ChemblCharField(
        max_length=50,
        blank=True,
        null=True,
        help_text=
        u'Where the compound has been assigned a USAN name, this indicates the substem'
    )
    usan_stem_definition = ChemblCharField(
        max_length=1000,
        blank=True,
        null=True,
        help_text=u'Definition of the USAN stem')
    indication_class = ChemblCharField(
        max_length=1000,
        blank=True,
        null=True,
        help_text=
        u'Indication class(es) assigned to a drug in the USP dictionary')
    products = models.ManyToManyField('Products',
                                      through="Formulations",
                                      blank=True)
    docs = models.ManyToManyField('Docs',
                                  through="CompoundRecords",
                                  blank=True)
    assays = models.ManyToManyField('Assays', through="Activities", blank=True)
    withdrawn_flag = ChemblBooleanField(
        default=False,
        help_text=
        "Flag indicating whether the drug has been withdrawn in at least one country (not necessarily in the US)"
    )
    withdrawn_year = ChemblPositiveIntegerField(
        length=4,
        blank=True,
        null=True,
        help_text=u'Year the drug was first withdrawn in any country')
    withdrawn_country = ChemblCharField(
        max_length=2000,
        blank=True,
        null=True,
        help_text=u'List of countries/regions where the drug has been withdrawn'
    )
    withdrawn_reason = ChemblCharField(
        max_length=2000,
        blank=True,
        null=True,
        help_text=u'Reasons for withdrawal (e.g., safety)')
    withdrawn_class = ChemblCharField(max_length=1000, blank=True, null=True)

    def __str__(self):
        return 'Molecule {0} ({1}) {2}'.format(self.molregno, self.chembl_id,
                                               self.pref_name)

    class Meta(ChemblCoreAbstractModel.Meta):
        pass
Exemplo n.º 22
0
class RecordDrugProperties(
        six.with_metaclass(ChemblModelMetaClass, ChemblCoreAbstractModel)):

    AVAILABILITY_TYPE_CHOICES = (
        (-2, '-2'),
        (-1, '-1'),
        (0, '0'),
        (1, '1'),
        (2, '2'),
    )

    CHIRALITY_CHOICES = (
        (-1, '-1'),
        (0, '0'),
        (1, '1'),
        (2, '2'),
    )

    MAX_PHASE_CHOICES = (
        (0, '0'),
        (1, '1'),
        (2, '2'),
        (3, '3'),
        (4, '4'),
    )

    MOLECULE_TYPE_CHOICES = (
        ('Antibody', 'Antibody'),
        ('Cell', 'Cell'),
        ('Enzyme', 'Enzyme'),
        ('Oligonucleotide', 'Oligonucleotide'),
        ('Oligosaccharide', 'Oligosaccharide'),
        ('Protein', 'Protein'),
        ('Small molecule', 'Small molecule'),
        ('Unclassified', 'Unclassified'),
        ('Unknown', 'Unknown'),
    )

    record = models.OneToOneField(CompoundRecords, primary_key=True)
    max_phase = ChemblPositiveIntegerField(
        length=1,
        db_index=True,
        default=0,
        choices=MAX_PHASE_CHOICES,
        help_text=
        u'Maximum phase of development reached for the compound (4 = approved). Null where max phase has not yet been assigned.'
    )
    molecule_type = ChemblCharField(
        max_length=30,
        blank=True,
        null=True,
        choices=MOLECULE_TYPE_CHOICES,
        help_text=
        u'Type of molecule (Small molecule, Protein, Antibody, Oligosaccharide, Oligonucleotide, Cell, Unknown)'
    )
    first_approval = ChemblPositiveIntegerField(
        length=4,
        blank=True,
        null=True,
        help_text=u'Earliest known approval year for the molecule'
    )  # TODO: should be date!
    oral = ChemblNullableBooleanField(
        default=False,
        help_text=
        u'Indicates whether the drug is known to be administered orally.')
    parenteral = ChemblNullableBooleanField(
        default=False,
        help_text=
        u'Indicates whether the drug is known to be administered parenterally')
    topical = ChemblNullableBooleanField(
        default=False,
        help_text=
        u'Indicates whether the drug is known to be administered topically.')
    black_box_warning = ChemblNullableBooleanField(
        default=0,
        help_text=u'Indicates that the drug has a black box warning')
    first_in_class = ChemblNullBooleanField(
        default=(-1),
        help_text=
        u'Indicates whether this is known to be the first compound of its class (e.g., acting on a particular target).'
    )
    chirality = ChemblIntegerField(
        length=1,
        default=(-1),
        choices=CHIRALITY_CHOICES,
        help_text=
        u'Shows whether a drug is dosed as a racemic mixture (0), single stereoisomer (1) or is an achiral molecule (2)'
    )
    prodrug = ChemblNullableBooleanField(
        default=False,
        help_text=
        u'Indicates that the molecule is a pro-drug (see molecule hierarchy for active component, where known)'
    )
    therapeutic_flag = ChemblNullableBooleanField(
        db_index=True,
        default=False,
        help_text=
        u'Indicates that a drug has a therapeutic application (as opposed to e.g., an imaging agent, additive etc).'
    )
    natural_product = ChemblNullBooleanField(
        default=(-1),
        help_text=
        u'Indicates whether the compound is natural product-derived (currently curated only for drugs)'
    )
    inorganic_flag = ChemblNullableBooleanField(
        default=0,
        help_text=
        u'Indicates whether the molecule is inorganic (i.e., containing only metal atoms and <2 carbon atoms)'
    )
    applicants = ChemblCharField(max_length=1000, blank=True, null=True)
    usan_stem = ChemblCharField(
        max_length=50,
        blank=True,
        null=True,
        help_text=
        u'Where the compound has been assigned a USAN name, this indicates the stem, as described in the USAN_STEM table.'
    )
    usan_year = ChemblPositiveIntegerField(
        length=4,
        blank=True,
        null=True,
        help_text=
        u'The year in which the application for a USAN/INN name was made')
    availability_type = ChemblIntegerField(
        length=1,
        blank=True,
        null=True,
        choices=AVAILABILITY_TYPE_CHOICES,
        help_text=
        u'The availability type for the drug (0 = discontinued, 1 = prescription only, 2 = over the counter)'
    )
    usan_substem = ChemblCharField(
        max_length=50,
        blank=True,
        null=True,
        help_text=
        u'Where the compound has been assigned a USAN name, this indicates the substem'
    )
    indication_class = ChemblCharField(
        max_length=1000,
        blank=True,
        null=True,
        help_text=
        u'Indication class(es) assigned to a drug in the USP dictionary')
    usan_stem_definition = ChemblCharField(
        max_length=1000,
        blank=True,
        null=True,
        help_text=u'Definition of the USAN stem')
    polymer_flag = ChemblNullableBooleanField(
        help_text=
        u'Indicates whether a molecule is a small molecule polymer (e.g., polistyrex)'
    )
    withdrawn_flag = ChemblPositiveIntegerField(length=1,
                                                blank=True,
                                                null=True)
    withdrawn_year = ChemblPositiveIntegerField(length=4,
                                                blank=True,
                                                null=True)
    withdrawn_country = ChemblCharField(max_length=1000, blank=True, null=True)
    withdrawn_reason = ChemblCharField(max_length=1000, blank=True, null=True)
    withdrawn_class = ChemblCharField(max_length=1000, blank=True, null=True)

    class Meta(ChemblCoreAbstractModel.Meta):
        pass