@@ -14,7 +14,7 @@ erDiagram
1414 string Metadata_JCP2022 FK
1515 string Metadata_Source
1616 }
17-
17+
1818 PLATE }|--|| MICROSCOPE-CONFIG : "imaged with"
1919 PLATE }|--|| CELLPROFILER-VERSION : "analyzed with"
2020 PLATE {
@@ -23,58 +23,58 @@ erDiagram
2323 string Metadata_Batch
2424 string Metadata_PlateType
2525 }
26-
26+
2727 PERTURBATION ||--o{ COMPOUND : "if compound"
2828 PERTURBATION ||--o{ ORF : "if ORF"
2929 PERTURBATION ||--o{ CRISPR : "if CRISPR"
3030 PERTURBATION {
3131 string Metadata_JCP2022 PK
3232 string Metadata_perturbation_modality "compound/orf/crispr/unknown"
3333 }
34-
34+
3535 PERTURBATION-CONTROL }o--|| PERTURBATION : "describes"
3636 PERTURBATION-CONTROL {
3737 string Metadata_JCP2022 PK,FK
3838 string Metadata_pert_type "poscon/negcon/empty"
3939 string Metadata_Name "Human-readable name"
4040 }
41-
41+
4242 COMPOUND ||--o{ COMPOUND-SOURCE : "sourced from"
4343 COMPOUND {
4444 string Metadata_JCP2022 PK
4545 string Metadata_InChIKey
4646 string Metadata_SMILES
4747 }
48-
48+
4949 COMPOUND-SOURCE {
5050 string Metadata_JCP2022 PK,FK
5151 string Metadata_Compound_Source PK
5252 }
53-
53+
5454 ORF {
5555 string Metadata_JCP2022 PK
5656 string Metadata_Symbol "Gene symbol"
5757 string Metadata_NCBI_Gene_ID
5858 }
59-
59+
6060 CRISPR {
6161 string Metadata_JCP2022 PK
6262 string Metadata_Symbol "Gene symbol"
6363 string Metadata_NCBI_Gene_ID
6464 }
65-
65+
6666 MICROSCOPE-CONFIG }o--|| MICROSCOPE-FILTER : "uses"
6767 MICROSCOPE-CONFIG {
6868 string Metadata_Source PK
6969 string Metadata_Microscope_Name
7070 string Metadata_Filter_Configuration FK
7171 }
72-
72+
7373 MICROSCOPE-FILTER {
7474 string Metadata_Filter_Configuration PK
7575 string wavelength_configs "DNA/ER/RNA/AGP/Mito channels"
7676 }
77-
77+
7878 CELLPROFILER-VERSION {
7979 string Metadata_Source PK
8080 string Metadata_CellProfiler_Version
@@ -101,6 +101,14 @@ This creates a database with:
101101- All CSV data imported as tables with data validation
102102- Documentation for all tables and columns embedded in the schema
103103
104+ ## SQLite Export
105+
106+ To export the DuckDB database to SQLite format:
107+
108+ ``` bash
109+ bash db/export_sqlite.sh
110+ ```
111+
104112## Querying the Database
105113
106114``` bash
@@ -121,13 +129,13 @@ Full schema documentation is embedded in the database. To view:
121129SELECT table_name, comment FROM duckdb_tables();
122130
123131-- View column descriptions
124- SELECT table_name, column_name, comment
125- FROM duckdb_columns()
132+ SELECT table_name, column_name, comment
133+ FROM duckdb_columns()
126134WHERE comment IS NOT NULL ;
127135
128136-- View all foreign key relationships
129- SELECT table_name, constraint_text
130- FROM duckdb_constraints()
137+ SELECT table_name, constraint_text
138+ FROM duckdb_constraints()
131139WHERE constraint_type = ' FOREIGN KEY' ;
132140```
133141
@@ -136,7 +144,7 @@ WHERE constraint_type = 'FOREIGN KEY';
136144When adding or modifying tables:
137145
1381461 . ** Add data file** : Use ` .csv ` for small tables (<1MB) or ` .csv.gz ` for larger ones
139- 2 . ** Update ` db/setup.sql ` ** :
147+ 2 . ** Update ` db/setup.sql ` ** :
140148 - Define table with PRIMARY KEY and FOREIGN KEY constraints
141149 - Add COMMENT statements for table and columns
142150 - Update the import section with correct file extension
0 commit comments