Exemplo n.º 1
0
class EnsemblGene(db.Model):
    __tablename__ = 'ensembl_genes'
    id = db.Column(db.Integer, primary_key=True)
    crawl_number = db.Column(db.Integer)
    gene_id = db.Column(db.String(64))
    ensembl_transcripts = db.relationship('EnsemblTranscript', backref='ensembl_gene', lazy='dynamic')
    ensembl_proteins = db.relationship('EnsemblProtein', backref='ensembl_gene', lazy='dynamic')
    db_entry_id = db.Column(db.Integer, db.ForeignKey('db_entries.id'))
    def __repr__(self):
        return '<EnsemblGene ID {}>'.format(self.gene_id)
Exemplo n.º 2
0
class PDBEntry(db.Model):
    __tablename__ = 'pdb_entries'
    id = db.Column(db.Integer, primary_key=True)
    crawl_number = db.Column(db.Integer)
    pdb_id = db.Column(db.String(64))
    method = db.Column(db.Text)
    resolution = db.Column(db.Float)
    chains = db.relationship('PDBChain', backref='pdb_entry', lazy='dynamic')
    expression_data = db.relationship('PDBExpressionData', backref='pdb_entry', lazy='dynamic')
    db_entry_id = db.Column(db.Integer, db.ForeignKey('db_entries.id'))
    def __repr__(self):
        return '<PDBEntry ID {}>'.format(self.pdb_id)
Exemplo n.º 3
0
class UniProtIsoform(db.Model):
    __tablename__ = 'uniprot_isoforms'
    id = db.Column(db.Integer, primary_key=True)
    crawl_number = db.Column(db.Integer)
    ac = db.Column(db.String(64))
    is_canonical = db.Column(db.Boolean)
    length = db.Column(db.Integer)
    mass = db.Column(db.Integer)
    date_modified = db.Column(db.String(64))
    version = db.Column(db.Integer)
    sequence = db.Column(db.Text)
    notes = db.relationship('UniProtIsoformNote', backref='uniprot_isoform', lazy='dynamic')
    ensembl_transcripts = db.relationship('EnsemblTranscript', backref='uniprot_isoform', lazy='dynamic')
    db_entry_id = db.Column(db.Integer, db.ForeignKey('db_entries.id'))
    uniprot_id = db.Column(db.Integer, db.ForeignKey('uniprot_entries.id'))
    def __repr__(self):
        return '<UniProtIsoform {} canonical: {}>'.format(self.ac, self.is_canonical)
Exemplo n.º 4
0
class CbioportalCase(db.Model):
    __tablename__ = 'cbioportal_cases'
    id = db.Column(db.Integer, primary_key=True)
    crawl_number = db.Column(db.Integer)
    study = db.Column(db.Text)
    case_id = db.Column(db.Text)
    mutations = db.relationship('CbioportalMutation', backref='cbioportal_case', lazy='dynamic')
    def __repr__(self):
        return '<CbioportalCase ID {0}>'.format(self.case_id)
Exemplo n.º 5
0
class NCBIGeneEntry(db.Model):
    __tablename__ = 'ncbi_gene_entries'
    id = db.Column(db.Integer, primary_key=True)
    crawl_number = db.Column(db.Integer)
    gene_id = db.Column(db.Integer)
    publications = db.relationship('NCBIGenePublication', backref='ncbi_gene_entry', lazy='dynamic')
    db_entry_id = db.Column(db.Integer, db.ForeignKey('db_entries.id'))
    def __repr__(self):
        return '<NCBIGeneEntry ID {}>'.format(self.gene_id)
Exemplo n.º 6
0
class UniProtDomain(db.Model):
    __tablename__ = 'uniprot_domains'
    id = db.Column(db.Integer, primary_key=True)
    crawl_number = db.Column(db.Integer)
    domain_id = db.Column(db.Integer)
    target_id = db.Column(db.String(64))   # ABL1_HUMAN_D0 (Protein kinase)
    is_target_domain = db.Column(db.Boolean)
    description = db.Column(db.Text())
    begin = db.Column(db.Integer)
    end = db.Column(db.Integer)
    length = db.Column(db.Integer)
    sequence = db.Column(db.Text)
    is_pseudodomain = db.Column(db.Boolean)
    pseudodomain_notes = db.Column(db.Text)
    pdb_chains = db.relationship('PDBChain', backref='uniprot_domain', lazy='dynamic')
    cbioportal_mutations = db.relationship('CbioportalMutation', backref='uniprot_domain', lazy='dynamic')
    db_entry_id = db.Column(db.Integer, db.ForeignKey('db_entries.id'))
    uniprot_id = db.Column(db.Integer, db.ForeignKey('uniprot_entries.id'))
    def __repr__(self):
        return '<UniProtDomain description {}>'.format(self.description)
Exemplo n.º 7
0
class UniProtEntry(db.Model):
    __tablename__ = 'uniprot_entries'
    id = db.Column(db.Integer, primary_key=True)
    crawl_number = db.Column(db.Integer)
    ac = db.Column(db.String(64))
    entry_name = db.Column(db.String(64))
    family = db.Column(db.String(64))
    recommended_name = db.Column(db.Text)
    ncbi_taxon_id = db.Column(db.String(64))
    taxon_name_scientific = db.Column(db.String(120))
    taxon_name_common = db.Column(db.String(120))
    lineage = db.Column(db.Text)   # ascending comma-separated values
    last_uniprot_update = db.Column(db.String(64))
    isoforms = db.relationship('UniProtIsoform', backref='uniprot_entry', lazy='dynamic')
    domains = db.relationship('UniProtDomain', backref='uniprot_entry', lazy='dynamic')
    gene_names = db.relationship('UniProtGeneName', backref='uniprot_entry', lazy='dynamic')
    functions = db.relationship('UniProtFunction', backref='uniprot_entry', lazy='dynamic')
    disease_associations = db.relationship('UniProtDiseaseAssociation', backref='uniprot_entry', lazy='dynamic')
    subcellular_locations = db.relationship('UniProtSubcellularLocation', backref='uniprot_entry', lazy='dynamic')
    db_entry_id = db.Column(db.Integer, db.ForeignKey('db_entries.id'))
    def __repr__(self):
        return '<UniProtEntry AC {} entry_name {}>'.format(self.ac, self.entry_name)
Exemplo n.º 8
0
class DBEntry(db.Model):
    """
    Essentially a "top-level" table for uniting all data types.
    Represents a "biological entity" - incorporating gene, transcript, and protein data.
    """
    __tablename__ = 'db_entries'
    id = db.Column(db.Integer, primary_key=True)
    crawl_number = db.Column(db.Integer)
    npdbs = db.Column(db.Integer)
    ndomains = db.Column(db.Integer)
    nisoforms = db.Column(db.Integer)
    nfunctions = db.Column(db.Integer)
    ndisease_associations = db.Column(db.Integer)
    npubs = db.Column(db.Integer)
    nbioassays = db.Column(db.Integer)
    uniprot = db.relationship('UniProtEntry', backref='db_entry', lazy='dynamic')
    uniprot_domains = db.relationship('UniProtDomain', backref='db_entry', lazy='dynamic')
    uniprot_gene_names = db.relationship('UniProtGeneName', backref='db_entry', lazy='dynamic')
    uniprot_isoforms = db.relationship('UniProtIsoform', backref='db_entry', lazy='dynamic')
    uniprot_functions = db.relationship('UniProtFunction', backref='db_entry', lazy='dynamic')
    uniprot_disease_associations = db.relationship('UniProtDiseaseAssociation', backref='db_entry', lazy='dynamic')
    uniprot_subcellular_locations = db.relationship('UniProtSubcellularLocation', backref='db_entry', lazy='dynamic')
    pdbs = db.relationship('PDBEntry', backref='db_entry', lazy='dynamic')
    ncbi_gene_entries = db.relationship('NCBIGeneEntry', backref='db_entry', lazy='dynamic')
    ensembl_genes = db.relationship('EnsemblGene', backref='db_entry', lazy='dynamic')
    hgnc_entries = db.relationship('HGNCEntry', backref='db_entry', lazy='dynamic')
    bindingdb_bioassays = db.relationship('BindingDBBioassay', backref='db_entry', lazy='dynamic')
    cbioportal_mutations = db.relationship('CbioportalMutation', backref='db_entry', lazy='dynamic')
    def __repr__(self):
        return '<DBEntry {}>'.format(self.id)