Skip to main content

Single cell studies data model

Project description

This package contains the source files and built models for an "ADI" (Application Data Interface) schema describing single cell data collection and analysis studies.

Examples

pip install adiscstudies

Tables and fields

import importlib.resources
import pandas as pd

with importlib.resources.path('adiscstudies', 'tables.tsv') as path:
    tables = pd.read_csv(path, sep='\t')

print(tables)
                            Name  ...                                         Entity
                         subject  ...                                  Study subject
                       diagnosis  ...                                Diagnosis event
  diagnostic_selection_criterion  ...                 Diagnostic selection criterion
       specimen_collection_study  ...                   Biospecimen collection study
     specimen_collection_process  ...                 Biospecimen collection process
    histology_assessment_process  ...                   Histology assessment process
...
import importlib.resources
with importlib.resources.path('adiscstudies', 'fields.tsv') as path:
    fields = pd.read_csv(path, sep='\t')

print(fields[fields['Table'] == 'Histological structure identification'][[
    'Label', 'Table', 'Foreign table', 'Foreign key', 'Ordinality',
]])
                      Label                                  Table                       Foreign table  Foreign key  Ordinality
     Histological structure  Histological structure identification              Histological structure   Identifier           1
                Data source  Histological structure identification                           Data file  SHA256 hash           2
                 Shape file  Histological structure identification                          Shape file   Identifier           3
Plane coordinates reference  Histological structure identification  Plane coordinates reference system         Name           4
      Identification method  Histological structure identification                                 NaN          NaN           5
        Identification date  Histological structure identification                                 NaN          NaN           6
                  Annotator  Histological structure identification                                 NaN          NaN           7

SQL

import importlib.resources
with importlib.resources.path('adiscstudies', 'schema.sql') as path:
    sql_create = open(path, 'rt').read()

print(sql_create)
CREATE TABLE IF NOT EXISTS subject (
    identifier VARCHAR(512) PRIMARY KEY,
    species VARCHAR(512),
    sex VARCHAR(512),
    birth_date VARCHAR,
    death_date VARCHAR,
    cause_of_death VARCHAR
);

CREATE TABLE IF NOT EXISTS diagnosis (
    subject VARCHAR(512) REFERENCES subject(identifier),
    condition VARCHAR,
    result VARCHAR(512),
    assessor VARCHAR(512),
    date VARCHAR
);

...

OWL

import importlib.resources
with importlib.resources.path('adiscstudies', 'schema.owl') as path:
    schema = open(path, 'rt').read()

with open('schema.owl', 'wt') as file:
    file.write(schema)

Then open schema.owl e.g. with Protege.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

adiscstudies-0.11.0-py3-none-any.whl (75.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page