#### "bionty"

Basic biological entities, coupled to public ontologies [source].

* Create records from public ontologies using ".from_source()".

* Access public ontologies via ".public()" to search & bulk-create
  records.

* Use hierarchical relationships among records (".parents").

* Use ".synonyms" and ".abbr" to manage synonyms.

* Manage ontology versions.

Mount "bionty" in a new instance:

 lamin init --storage <path_to_storage_location> --modules bionty

Import the package:

 import bionty as bt

Access public ontologies:

 genes = bt.Gene.public()
 genes.validate(["BRCA1", "TCF7"], field="symbol")

Create records from public ontologies:

 cell_type = bt.CellType.from_source(ontology_id="CL:0000037")
 cell_type.save()

View ontological hierarchy:

 cell_type.view_parents()

Create your own records:

 cell_type_new = bt.CellType(name="my new cell type")
 cell_type_new.save()
 cell_type_new.parents.add(cell_type)
 cell_type_new.view_parents()

Manage synonyms:

 cell_type_new.add_synonyms(["my cell type", "my cell"])
 cell_type_new.set_abbr("MCT")

Detailed guides:

* Access public ontologies

* Manage biological ontologies

Registries:

| --- | --- |
| "Organism | Organism - NCBI Taxonomy, Ensembl Organism. |
| "() |
| --- | --- |
| "Gene"() | Genes - Ensembl, NCBI Gene. |
| --- | --- |
| "Protein" | Proteins - Uniprot. |
| () |
| --- | --- |
| "CellMark | Cell markers - CellMarker. |
| er"() |
| --- | --- |
| "CellType | Cell types - Cell Ontology. |
| "() |
| --- | --- |
| "CellLine | Cell lines - Cell Line Ontology. |
| "() |
| --- | --- |
| "Tissue"() | Tissues - Uberon. |
| --- | --- |
| "Disease" | Diseases - Mondo, Human Disease. |
| () |
| --- | --- |
| "Pathway" | Pathways - Gene Ontology, Pathway Ontology. |
| () |
| --- | --- |
| "Phenotyp | Phenotypes - Human Phenotype, Phecodes, Mammalian Phenotype, Zebrafish Phenotype. |
| e"() |
| --- | --- |
| "Experime | Experimental factors - Experimental Factor Ontology. |
| ntalFacto |
| r"() |
| --- | --- |
| "Developm | Developmental stages - Human Developmental Stages, Mouse Developmental Stages. |
| entalStag |
| e"() |
| --- | --- |
| "Ethnicit | Ethnicity - Human Ancestry Ontology. |
| y"() |
| --- | --- |

* bionty.Organism

  * "Organism"

 * "Organism.scientific_name"

 * "Organism.artifacts"

 * "Organism.records"

 * "Organism.from_source()"

* bionty.Gene

  * "Gene"

 * "Gene.symbol"

 * "Gene.stable_id"

 * "Gene.ensembl_gene_id"

 * "Gene.ncbi_gene_ids"

 * "Gene.biotype"

 * "Gene.organism"

 * "Gene.artifacts"

 * "Gene.records"

 * "Gene.schemas"

 * "Gene.from_source()"

* bionty.Protein

  * "Protein"

 * "Protein.name"

 * "Protein.uniprotkb_id"

 * "Protein.length"

 * "Protein.gene_symbol"

 * "Protein.ensembl_gene_ids"

 * "Protein.organism"

 * "Protein.artifacts"

 * "Protein.records"

 * "Protein.schemas"

 * "Protein.from_source()"

* bionty.CellMarker

  * "CellMarker"

 * "CellMarker.name"

 * "CellMarker.gene_symbol"

 * "CellMarker.ncbi_gene_id"

 * "CellMarker.uniprotkb_id"

 * "CellMarker.organism"

 * "CellMarker.artifacts"

 * "CellMarker.records"

 * "CellMarker.schemas"

 * "CellMarker.from_source()"

* bionty.CellType

  * "CellType"

 * "CellType.artifacts"

 * "CellType.records"

 * "CellType.from_source()"

* bionty.CellLine

  * "CellLine"

 * "CellLine.artifacts"

 * "CellLine.records"

 * "CellLine.from_source()"

* bionty.Tissue

  * "Tissue"

 * "Tissue.artifacts"

 * "Tissue.records"

 * "Tissue.from_source()"

* bionty.Disease

  * "Disease"

 * "Disease.artifacts"

 * "Disease.records"

 * "Disease.from_source()"

* bionty.Pathway

  * "Pathway"

 * "Pathway.genes"

 * "Pathway.schemas"

 * "Pathway.artifacts"

 * "Pathway.records"

 * "Pathway.from_source()"

* bionty.Phenotype

  * "Phenotype"

 * "Phenotype.artifacts"

 * "Phenotype.records"

 * "Phenotype.from_source()"

* bionty.ExperimentalFactor

  * "ExperimentalFactor"

 * "ExperimentalFactor.artifacts"

 * "ExperimentalFactor.records"

 * "ExperimentalFactor.from_source()"

* bionty.DevelopmentalStage

  * "DevelopmentalStage"

 * "DevelopmentalStage.artifacts"

 * "DevelopmentalStage.records"

 * "DevelopmentalStage.from_source()"

* bionty.Ethnicity

  * "Ethnicity"

 * "Ethnicity.artifacts"

 * "Ethnicity.records"

 * "Ethnicity.from_source()"

Settings:

| --- | --- |
| "settings" | Global "Settings". |
| --- | --- |

* bionty.settings

  * "settings"

Ontology versions:

| --- | --- |
| "Source"() | Versions of ontology sources. |
| --- | --- |

* bionty.Source

  * "Source"

 * "Source.uid"

 * "Source.entity"

 * "Source.organism"

 * "Source.name"

 * "Source.version"

 * "Source.in_db"

 * "Source.currently_used"

 * "Source.description"

 * "Source.url"

 * "Source.md5"

 * "Source.source_website"

 * "Source.dataframe_artifact"

 * "Source.artifacts"

 * "Source.save()"

Submodules:

| --- | --- |
| "core" | Developer API. |
| --- | --- |
| "base" | Access to public ontologies. |
| --- | --- |
| "models" | Models library. |
| --- | --- |
| "uids" | UIDs. |
| --- | --- |

* bionty.core

  * Classes

 * bionty.core.BioRecord

 * "BioRecord"

 * "BioRecord.uid"

 * "BioRecord.abbr"

 * "BioRecord.synonyms"

 * "BioRecord.description"

 * "BioRecord.require_organism()"

 * "BioRecord.save()"

 * bionty.core.StaticReference

 * "StaticReference"

 * bionty.core.Settings

 * "Settings"

 * "Settings.organism"

  * Functions

* bionty.base

  * Sources & settings

 * "display_sources()"

 * "display_currently_used_sources()"

 * "settings"

  * Base class

 * "PublicOntology"

 * "PublicOntologyField"

  * Entities

 * "Organism"

 * "Gene"

 * "Protein"

 * "CellMarker"

 * "CellType"

 * "CellLine"

 * "Tissue"

 * "Disease"

 * "Phenotype"

 * "Pathway"

 * "ExperimentalFactor"

 * "DevelopmentalStage"

 * "Drug"

 * "Ethnicity"

 * "BFXPipeline"

 * "BioSample"

* bionty.models

  * "BioRecord"

 * "BioRecord.uid"

 * "BioRecord.abbr"

 * "BioRecord.synonyms"

 * "BioRecord.description"

 * "BioRecord.require_organism()"

 * "BioRecord.save()"

  * "HasOntologyId"

 * "HasOntologyId.parents"

  * "HasSource"

 * "HasSource.source_id"

 * "HasSource.source"

 * "HasSource.import_source()"

 * "HasSource.add_source()"

 * "HasSource.public()"

 * "HasSource.from_source()"

* bionty.uids

  * "ontology()"

  * "source()"