File size: 269,878 Bytes
d824890 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 | CREATE SCHEMA IF NOT EXISTS annotation;
CREATE SCHEMA IF NOT EXISTS clinical;
CREATE SCHEMA IF NOT EXISTS ontology;
CREATE SCHEMA IF NOT EXISTS provenance;
CREATE SCHEMA IF NOT EXISTS raw;
CREATE SCHEMA IF NOT EXISTS reference;
CREATE SCHEMA IF NOT EXISTS resource;
CREATE OR REPLACE VIEW provenance.release AS SELECT * FROM read_parquet('./provenance/release.parquet');
COMMENT ON VIEW provenance.release IS 'One row per (biocOnIce release, source, artifact): what this release was built from, file by file. This is what makes a release reproducible — resolve it here to each source''s own version, then query each table at that release. Durable by design: unlike Iceberg snapshot summaries it does not expire.';
COMMENT ON COLUMN provenance.release."release" IS 'biocOnIce release, YYYY.MM with zero-padded corrections YYYY.MM.NN. Zero-padded because ''2026.10.10'' sorts before ''2026.10.2'' and release ordering would otherwise invert.';
COMMENT ON COLUMN provenance.release."source" IS 'The provider, e.g. ensembl, ncbi_gene, obo. Which of its files or species a row describes is `artifact`.';
COMMENT ON COLUMN provenance.release."source_version" IS 'The upstream version in the SOURCE''S OWN vocabulary, never normalised: ''116'' for Ensembl, ''2026-08-06'' for a source that publishes no version. NULL only where nothing at all is knowable.';
COMMENT ON COLUMN provenance.release."version_method" IS 'How the version was determined: release_number, http_last_modified, etag, ftp_index_probe, retrieval_date, unavailable. ''unavailable'' is a legitimate value — a source that publishes no version is recorded as such, never given a fabricated one.';
COMMENT ON COLUMN provenance.release."retrieved_at" IS 'UTC timestamp at which the source was fetched.';
COMMENT ON COLUMN provenance.release."url" IS 'Canonical URL fetched.';
COMMENT ON COLUMN provenance.release."checksum" IS 'SHA-256 (hex) of the file as retrieved — the zip, where the source ships one — or the sha256 the source publishes for it (BEDbase). NULL where the URL was read directly with no local copy: see etag and last_modified.';
COMMENT ON COLUMN provenance.release."row_count" IS 'Rows landed from this artifact, as a cheap integrity check.';
CREATE OR REPLACE VIEW raw.ncbi__gene2ensembl AS SELECT * FROM read_parquet('./raw/ncbi__gene2ensembl.parquet');
COMMENT ON VIEW raw.ncbi__gene2ensembl IS 'NCBI gene2ensembl landed verbatim and whole: every organism NCBI knows, not only the ones we derive annotation for. NCBI''s ''-'' placeholder is read as NULL. Regenerated nightly upstream, so it has no release: the retrieval date is the version, per NLM''s own citation form.';
COMMENT ON COLUMN raw.ncbi__gene2ensembl."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.';
COMMENT ON COLUMN raw.ncbi__gene2ensembl."gene_id" IS 'NCBI Entrez GeneID.';
COMMENT ON COLUMN raw.ncbi__gene2ensembl."ensembl_gene_id" IS 'Ensembl stable gene id NCBI maps this Entrez gene to.';
COMMENT ON COLUMN raw.ncbi__gene2ensembl."rna_accession" IS 'RefSeq RNA accession.version.';
COMMENT ON COLUMN raw.ncbi__gene2ensembl."ensembl_rna_id" IS 'Ensembl transcript id.';
COMMENT ON COLUMN raw.ncbi__gene2ensembl."protein_accession" IS 'RefSeq protein accession.version.';
COMMENT ON COLUMN raw.ncbi__gene2ensembl."ensembl_protein_id" IS 'Ensembl protein id.';
COMMENT ON COLUMN raw.ncbi__gene2ensembl."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW raw.ncbi__gene_info AS SELECT * FROM read_parquet('./raw/ncbi__gene_info.parquet');
COMMENT ON VIEW raw.ncbi__gene_info IS 'NCBI gene_info landed verbatim and whole — 71.5M records across 53,800 taxa, not only the ones we derive annotation for, since a third species should not cost a re-fetch. NCBI''s ''-'' placeholder is read as NULL. Pipe-separated fields are kept as published, unsplit: splitting is interpretation and belongs in transform. Regenerated nightly upstream, so the retrieval date is the version.';
COMMENT ON COLUMN raw.ncbi__gene_info."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.';
COMMENT ON COLUMN raw.ncbi__gene_info."gene_id" IS 'NCBI Entrez GeneID.';
COMMENT ON COLUMN raw.ncbi__gene_info."symbol" IS 'Default symbol. The nomenclature authority''s symbol where there is one, otherwise NCBI''s own; symbol_authority says which.';
COMMENT ON COLUMN raw.ncbi__gene_info."locus_tag" IS 'Submitter-assigned locus tag, e.g. b0001. Mostly prokaryotic.';
COMMENT ON COLUMN raw.ncbi__gene_info."synonyms" IS 'Alternate symbols, pipe-separated in one string as NCBI publishes them. Split at ''|'' to get ALIAS rows.';
COMMENT ON COLUMN raw.ncbi__gene_info."dbxrefs" IS 'Cross-references, pipe-separated ''Authority:id'' pairs, e.g. ''MIM:191170|HGNC:HGNC:11998|Ensembl:ENSG00000141510''. Split at the FIRST colon only: HGNC''s own ids embed one.';
COMMENT ON COLUMN raw.ncbi__gene_info."chromosome" IS 'Chromosome as NCBI names it, e.g. 17. May be a pipe-separated list for genes placed on more than one, or ''Un'' for unplaced.';
COMMENT ON COLUMN raw.ncbi__gene_info."map_location" IS 'Cytogenetic band, e.g. 17p13.1. Not a coordinate; for coordinates use annotation.exon.';
COMMENT ON COLUMN raw.ncbi__gene_info."description" IS 'Descriptive gene name, e.g. ''tumor protein p53''. This is the column OrgDb serves as GENENAME.';
COMMENT ON COLUMN raw.ncbi__gene_info."type_of_gene" IS 'NCBI gene type, e.g. protein-coding, ncRNA, pseudo. NCBI''s vocabulary, hyphenated — not Ensembl''s biotype vocabulary.';
COMMENT ON COLUMN raw.ncbi__gene_info."symbol_authority" IS 'Symbol as assigned by the nomenclature authority (HGNC, MGI), NULL where none has named the gene.';
COMMENT ON COLUMN raw.ncbi__gene_info."full_name_authority" IS 'Full name from the nomenclature authority, NULL where none.';
COMMENT ON COLUMN raw.ncbi__gene_info."nomenclature_status" IS '''O'' official, ''I'' interim, NULL where the gene is unnamed.';
COMMENT ON COLUMN raw.ncbi__gene_info."other_designations" IS 'Further names, pipe-separated. Free text, not symbols: not treated as ALIAS.';
COMMENT ON COLUMN raw.ncbi__gene_info."modification_date" IS 'Date this Gene record last changed, YYYYMMDD. Per-record, so it is not a version for the file as a whole.';
COMMENT ON COLUMN raw.ncbi__gene_info."feature_type" IS 'Feature type for records that are not genes, e.g. ''biological region''. NULL for ordinary genes.';
COMMENT ON COLUMN raw.ncbi__gene_info."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW raw.ncbi__gene_history AS SELECT * FROM read_parquet('./raw/ncbi__gene_history.parquet');
COMMENT ON VIEW raw.ncbi__gene_history IS 'NCBI gene_history landed verbatim and whole: the tombstone list for every Entrez GeneID ever withdrawn. Landed but NOT YET INTERPRETED — nothing derives from it, because whether supersession (''merged into'') is modelled as a table, a typed retirement reason, or not at all is still open (issue #15, item 4). It is here so that question can be settled against real data rather than guessed at.';
COMMENT ON COLUMN raw.ncbi__gene_history."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.';
COMMENT ON COLUMN raw.ncbi__gene_history."gene_id" IS 'Entrez GeneID that discontinued_gene_id was merged INTO. NULL (NCBI''s ''-'') means the id was retired outright with no successor, which is the majority of this table.';
COMMENT ON COLUMN raw.ncbi__gene_history."discontinued_gene_id" IS 'The Entrez GeneID that no longer exists. This is what a stale identifier in an old analysis looks up as.';
COMMENT ON COLUMN raw.ncbi__gene_history."discontinued_symbol" IS 'Symbol the discontinued id carried when it was withdrawn.';
COMMENT ON COLUMN raw.ncbi__gene_history."discontinue_date" IS 'Date of withdrawal, YYYYMMDD. NCBI''s own clock, not a biocOnIce release.';
COMMENT ON COLUMN raw.ncbi__gene_history."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW raw.bugsigdb__full_dump AS SELECT * FROM read_parquet('./raw/bugsigdb__full_dump.parquet');
COMMENT ON VIEW raw.bugsigdb__full_dump IS 'BugSigDB''s full_dump.csv landed verbatim: one row per curated microbial signature, flattened across study, experiment and signature. Every column is a string and nothing is split, per the raw contract — in particular the two member-list columns keep their '';'' and ''|'' nesting. BugSigDB''s ''NA'' placeholder is read as NULL, the same treatment NCBI''s ''-'' gets. Landed from a release TAG rather than the hourly devel export, so it is immutable and citable (each release has a Zenodo DOI). Licence CC BY 4.0, declared both in .zenodo.json and in the file''s own banner line.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."bsdb_id" IS 'BugSigDB signature id, e.g. ''bsdb:83/1/1''. Compound: study/experiment/signature. Unique per row (7,425 of 7,425 distinct at v1.3.1), so it is the natural key even though raw declares none.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."study" IS 'Wiki page name of the study, e.g. ''Study 83''.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."study_design" IS 'e.g. case-control, cross-sectional observational, laboratory experiment, prospective cohort.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."pmid" IS 'PubMed id of the source publication.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."doi" IS 'DOI of the source publication.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."url" IS 'Publication URL as curated.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."authors_list" IS 'Author list of the publication, free text.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."title" IS 'Title of the publication.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."journal" IS 'Journal name.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."year" IS 'Publication year. String, not an integer, because raw is landed unparsed.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."keywords" IS 'Curator keywords; frequently absent.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."experiment" IS 'Wiki page name of the experiment within the study, e.g. ''Experiment 1''. One study has many experiments; one experiment has many signatures.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."location_of_subjects" IS 'Geographic origin of subjects.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."host_species" IS 'Host organism, e.g. Homo sapiens. Not the microbes — those are the signature.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."body_site" IS 'Sampled body site as curated text.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."uberon_id" IS 'UBERON CURIE for body_site, e.g. UBERON:0001988.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."condition" IS 'Studied condition as curated text.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."efo_id" IS 'EFO CURIE for condition, e.g. EFO:0001073.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."group_0_name" IS 'Name of the control/reference group.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."group_1_name" IS 'Name of the group the signature describes.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."group_1_definition" IS 'Free-text inclusion criteria for group 1.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."group_0_sample_size" IS 'Subjects in group 0. String: not always numeric.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."group_1_sample_size" IS 'Subjects in group 1. String: not always numeric.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."antibiotics_exclusion" IS 'Antibiotic washout required for inclusion, e.g. ''3 months''.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."sequencing_type" IS 'Assay: 16S, WMS (whole metagenome shotgun), ''ITS / ITS2'', PCR.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."variable_region_16s" IS '16S hypervariable region, upstream column ''16S variable region''. Digits are CONCATENATED region numbers, not a number: ''34'' means V3-V4, ''4'' means V4, ''12'' means V1-V2. Do not cast this to an integer.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."sequencing_platform" IS 'Instrument/platform reported.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."data_transformation" IS 'e.g. relative abundances, raw counts, centered log-ratio.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."statistical_test" IS 'Test used for differential abundance.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."significance_threshold" IS 'Alpha, e.g. ''0.05''. String, unparsed.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."mht_correction" IS 'Whether multiple-hypothesis correction was applied: ''TRUE''/''FALSE'' as strings, since raw is unparsed.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."lda_score_above" IS 'LEfSe LDA score cutoff where one was used.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."matched_on" IS 'Comma-separated variables the groups were matched on, e.g. ''age,sex''.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."confounders_controlled_for" IS 'Comma-separated confounders adjusted for.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."pielou" IS 'Direction this alpha-diversity metric moved in group 1: ''increased'', ''decreased'' or ''unchanged''. NOT a diversity value — there is no number here to plot. NULL where the study did not report the metric, which is the majority.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."shannon" IS 'Direction this alpha-diversity metric moved in group 1: ''increased'', ''decreased'' or ''unchanged''. NOT a diversity value — there is no number here to plot. NULL where the study did not report the metric, which is the majority.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."chao1" IS 'Direction this alpha-diversity metric moved in group 1: ''increased'', ''decreased'' or ''unchanged''. NOT a diversity value — there is no number here to plot. NULL where the study did not report the metric, which is the majority.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."simpson" IS 'Direction this alpha-diversity metric moved in group 1: ''increased'', ''decreased'' or ''unchanged''. NOT a diversity value — there is no number here to plot. NULL where the study did not report the metric, which is the majority.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."inverse_simpson" IS 'Direction this alpha-diversity metric moved in group 1: ''increased'', ''decreased'' or ''unchanged''. NOT a diversity value — there is no number here to plot. NULL where the study did not report the metric, which is the majority.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."richness" IS 'Direction this alpha-diversity metric moved in group 1: ''increased'', ''decreased'' or ''unchanged''. NOT a diversity value — there is no number here to plot. NULL where the study did not report the metric, which is the majority.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."signature_page_name" IS 'Wiki page name of the signature within its experiment, e.g. ''Signature 1''.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."source_in_paper" IS 'Where in the publication the signature was read from, e.g. ''Table 2'', ''Figure 3''. Upstream column name is ''Source''; renamed here because `source` elsewhere in this catalog means the asserting authority.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."curated_date" IS 'Date of curation as published, e.g. ''10 January 2021''. Human-readable, not ISO 8601 — parsing it is a transform concern.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."curator" IS 'Wiki username of the curator.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."revision_editor" IS 'Wiki username of the last editor.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."description" IS 'Curator''s description of the signature.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."abundance_in_group_1" IS 'Direction of the signature: ''increased'' or ''decreased'' in group 1 relative to group 0. This is what makes a signature signed — the same taxa increased and decreased are different signatures.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."metaphlan_taxon_names" IS 'Signature members as MetaPhlAn lineages. TWO levels of nesting, kept verbatim: '';'' separates members, ''|'' separates ranks within one member''s lineage, with k__/p__/c__/o__/f__/g__/s__ rank prefixes. Splitting on ''|'' alone silently turns one taxon into seven.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."ncbi_taxonomy_ids" IS 'Signature members as NCBI taxon ids, same two-level nesting as metaphlan_taxon_names: '';'' between members, ''|'' up each member''s lineage from kingdom to the curated rank. The LAST element of each ''|'' group is the taxon actually reported; the rest are its lineage.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."state" IS 'Curation state. Only ''Complete'' appears: the export filters incomplete records upstream, so this is not a usable filter here.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."reviewer" IS 'Wiki username of the reviewer.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."export_timestamp" IS 'The export''s own self-declared timestamp, taken from the banner line of the CSV, e.g. ''2026-04-24_00:41_UTC''. In-band provenance: it is the only version marker when landing from the hourly devel export, which carries no tag.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."bugsigdb_version" IS 'The BugSigDBExports release tag this file came from, e.g. ''v1.3.1''. Raw is replaced wholesale per value of this column.';
COMMENT ON COLUMN raw.bugsigdb__full_dump."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW raw.ensembl__gtf AS SELECT * FROM read_parquet('./raw/ensembl__gtf.parquet');
COMMENT ON VIEW raw.ensembl__gtf IS 'Ensembl GTF landed verbatim, one row per feature line. Deliberately has no merge key and no validity interval: a GTF line has no natural identity, and an Ensembl release is immutable, so this table is replaced wholesale per (taxon_id, genome_id, ensembl_release) and is idempotent under re-ingest. History here is the accumulation of releases, not a validity interval.';
COMMENT ON COLUMN raw.ensembl__gtf."seqname" IS 'GTF column 1, the sequence name.';
COMMENT ON COLUMN raw.ensembl__gtf."source" IS 'GTF column 2, the annotation source.';
COMMENT ON COLUMN raw.ensembl__gtf."feature" IS 'GTF column 3: gene, transcript, exon, CDS, five_prime_utr, three_prime_utr, start_codon, stop_codon, Selenocysteine.';
COMMENT ON COLUMN raw.ensembl__gtf."start" IS 'GTF column 4, 1-based inclusive.';
COMMENT ON COLUMN raw.ensembl__gtf."end" IS 'GTF column 5, 1-based inclusive.';
COMMENT ON COLUMN raw.ensembl__gtf."score" IS 'GTF column 6, ''.'' throughout Ensembl GTFs.';
COMMENT ON COLUMN raw.ensembl__gtf."strand" IS 'GTF column 7, ''+'' or ''-''.';
COMMENT ON COLUMN raw.ensembl__gtf."frame" IS 'GTF column 8. On a CDS row this is the reading-frame phase; ''.'' elsewhere.';
COMMENT ON COLUMN raw.ensembl__gtf."attribute" IS 'GTF column 9 verbatim, unparsed: the semicolon-separated key "value" list carrying gene_id, transcript_id, exon_number, tag and the rest. Kept whole so attributes nobody has needed yet can be extracted later without re-fetching the source.';
COMMENT ON COLUMN raw.ensembl__gtf."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.';
COMMENT ON COLUMN raw.ensembl__gtf."ensembl_release" IS 'Ensembl release this file came from, e.g. 116.';
COMMENT ON COLUMN raw.ensembl__gtf."landed_in" IS 'The biocOnIce release whose ingest landed these rows. Not a validity interval: raw is replaced per source version, not versioned.';
CREATE OR REPLACE VIEW reference.genome AS SELECT * FROM read_parquet('./reference/genome.parquet');
COMMENT ON VIEW reference.genome IS 'Genome assemblies. One row per assembly per organism per source: two providers may describe the same assembly, and neither may retire the other''s row. A taxon can have many (Ensembl 116: 359 assemblies over 276 taxa); is_canonical names the default one.';
COMMENT ON COLUMN reference.genome."genome_id" IS 'Assembly accession, e.g. GCA_000001405.29. Stable across releases. Ensembl publishes no accession for 13 old assemblies (turTru1, TETRAODON 8.0, ...); those carry the assembly name here instead.';
COMMENT ON COLUMN reference.genome."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.';
COMMENT ON COLUMN reference.genome."source" IS 'The asserting annotation provider, from the controlled writer vocabulary: ''ENSEMBL'' now; ''REFSEQ'', ''GENCODE'' when they land. Part of the business key and of every writer''s merge scope, so providers stack in one table and none can retire another''s rows (ADR-0004).';
COMMENT ON COLUMN reference.genome."assembly_name" IS 'Provider''s assembly name, e.g. GRCh38.p14.';
COMMENT ON COLUMN reference.genome."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN reference.genome."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW annotation.gene AS SELECT * FROM read_parquet('./annotation/gene.parquet');
COMMENT ON VIEW annotation.gene IS 'Genes, stacked across annotation providers: one row per gene per organism per source per assembly, in the provider''s own id space. Join to annotation.transcript on (gene_id, taxon_id, source, genome_id). A taxon with several assemblies loaded (mouse strains, pig breeds) has one set of rows per assembly — see genome_id. Descriptions and cytogenetic bands are not here: they come from NCBI, keyed by Entrez id, in annotation.ncbi__gene.';
COMMENT ON COLUMN annotation.gene."gene_id" IS 'The provider''s stable gene id without version, e.g. ENSG00000141510 under source ENSEMBL. Part of the merge key; an upstream version bump updates this row rather than creating a new one.';
COMMENT ON COLUMN annotation.gene."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.';
COMMENT ON COLUMN annotation.gene."source" IS 'The asserting annotation provider, from the controlled writer vocabulary: ''ENSEMBL'' now; ''REFSEQ'', ''GENCODE'' when they land. Part of the business key and of every writer''s merge scope, so providers stack in one table and none can retire another''s rows (ADR-0004).';
COMMENT ON COLUMN annotation.gene."version" IS 'Upstream record version at this release, e.g. 21. Changes over time.';
COMMENT ON COLUMN annotation.gene."symbol" IS 'Official gene symbol, e.g. TP53. NULL for genes with no assigned name.';
COMMENT ON COLUMN annotation.gene."gene_type" IS 'Gene biotype in the provider''s vocabulary, e.g. protein_coding, lncRNA for Ensembl.';
COMMENT ON COLUMN annotation.gene."curation_source" IS 'The provider''s own annotation-source tag, e.g. ensembl_havana from GTF column 2. Curation provenance within the provider — the asserting provider itself is `source`.';
COMMENT ON COLUMN annotation.gene."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN annotation.gene."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW annotation.ncbi__gene AS SELECT * FROM read_parquet('./annotation/ncbi__gene.parquet');
COMMENT ON VIEW annotation.ncbi__gene IS 'Genes as NCBI Gene defines them, keyed by Entrez GeneID. Separate from annotation.gene rather than extra columns on it, because gene_info is keyed by Entrez id and the Entrez-to-Ensembl mapping is many-to-many in both directions: writing a description onto an Ensembl-keyed row would mean silently picking one of several Entrez records for the genes where they disagree. Reach it from an Ensembl gene through annotation.identifier_mapping (ENSEMBL <-> ENTREZ), which keeps the fan-out visible instead of resolving it at write time. Synonyms and dbXrefs from the same source land in annotation.identifier_mapping. Note that ''gene'' here is NCBI''s sense of the word: most rows are gene_type ''biological-region'' — regulatory features, 128,261 of human''s 193,809 records against 20,595 protein-coding. They are kept rather than filtered, because gene_type distinguishes them and OrgDb''s ENTREZID key space includes them; filter on gene_type if you want genes in the narrower sense.';
COMMENT ON COLUMN annotation.ncbi__gene."gene_id" IS 'NCBI Entrez GeneID, e.g. 7157. The central key of OrgDb, which is why this table exists keyed on it rather than on an Ensembl id.';
COMMENT ON COLUMN annotation.ncbi__gene."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.';
COMMENT ON COLUMN annotation.ncbi__gene."symbol" IS 'NCBI''s default symbol, e.g. TP53. May disagree with the symbol Ensembl carries in annotation.gene; neither is corrected to match the other.';
COMMENT ON COLUMN annotation.ncbi__gene."description" IS 'Descriptive gene name, e.g. ''tumor protein p53''. This is OrgDb''s GENENAME.';
COMMENT ON COLUMN annotation.ncbi__gene."gene_type" IS 'NCBI gene type, e.g. protein-coding, ncRNA, pseudo. OrgDb''s GENETYPE. NCBI''s hyphenated vocabulary, deliberately not mapped onto Ensembl''s biotype names in annotation.gene.gene_type.';
COMMENT ON COLUMN annotation.ncbi__gene."chromosome" IS 'Chromosome as NCBI names it. Pipe-separated where NCBI places the gene on more than one, kept as published.';
COMMENT ON COLUMN annotation.ncbi__gene."map_location" IS 'Cytogenetic band, e.g. 17p13.1. OrgDb''s MAP. Not a coordinate.';
COMMENT ON COLUMN annotation.ncbi__gene."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN annotation.ncbi__gene."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW annotation.transcript AS SELECT * FROM read_parquet('./annotation/transcript.parquet');
COMMENT ON VIEW annotation.transcript IS 'Transcripts, stacked across annotation providers. One row per transcript per source per assembly; a gene has many.';
COMMENT ON COLUMN annotation.transcript."transcript_id" IS 'The provider''s stable transcript id without version, e.g. ENST00000269305 under source ENSEMBL.';
COMMENT ON COLUMN annotation.transcript."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.';
COMMENT ON COLUMN annotation.transcript."source" IS 'The asserting annotation provider, from the controlled writer vocabulary: ''ENSEMBL'' now; ''REFSEQ'', ''GENCODE'' when they land. Part of the business key and of every writer''s merge scope, so providers stack in one table and none can retire another''s rows (ADR-0004).';
COMMENT ON COLUMN annotation.transcript."gene_id" IS 'Stable gene id of the parent gene, in the same provider''s id space. Joins to annotation.gene on (gene_id, taxon_id, source, genome_id).';
COMMENT ON COLUMN annotation.transcript."version" IS 'Upstream record version at this release.';
COMMENT ON COLUMN annotation.transcript."biotype" IS 'Transcript biotype, e.g. protein_coding, retained_intron.';
COMMENT ON COLUMN annotation.transcript."canonical" IS 'True if Ensembl tags this as the canonical transcript of its gene.';
COMMENT ON COLUMN annotation.transcript."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN annotation.transcript."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW annotation.exon AS SELECT * FROM read_parquet('./annotation/exon.parquet');
COMMENT ON VIEW annotation.exon IS 'Exons in transcript context, carrying coding bounds, stacked across annotation providers. Stands in for TxDb''s exon, cds and splicing tables: a row is already keyed by exon and transcript, so it is the splicing junction, and a coding segment always falls within an exon of the same transcript. UTRs are derived from cds bounds, not stored.';
COMMENT ON COLUMN annotation.exon."exon_id" IS 'The provider''s stable exon id without version, e.g. ENSE00002064269 under source ENSEMBL. NOT unique on its own: one exon is shared by every transcript containing it, so the key is (exon_id, transcript_id, taxon_id, source, genome_id).';
COMMENT ON COLUMN annotation.exon."transcript_id" IS 'Transcript this row places the exon in. Joins to annotation.transcript on (transcript_id, taxon_id, source, genome_id).';
COMMENT ON COLUMN annotation.exon."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.';
COMMENT ON COLUMN annotation.exon."source" IS 'The asserting annotation provider, from the controlled writer vocabulary: ''ENSEMBL'' now; ''REFSEQ'', ''GENCODE'' when they land. Part of the business key and of every writer''s merge scope, so providers stack in one table and none can retire another''s rows (ADR-0004).';
COMMENT ON COLUMN annotation.exon."sequence_name" IS 'Sequence the exon lies on, as named by Ensembl, e.g. 17 — not chr17.';
COMMENT ON COLUMN annotation.exon."start" IS 'Start coordinate, 1-based and inclusive (Ensembl/GTF convention, NOT the 0-based half-open convention of BED and UCSC).';
COMMENT ON COLUMN annotation.exon."end" IS 'End coordinate, 1-based and inclusive.';
COMMENT ON COLUMN annotation.exon."strand" IS '''+'' or ''-''.';
COMMENT ON COLUMN annotation.exon."rank" IS 'Ordinal of this exon within the transcript, 5'' to 3'', starting at 1. Order exons by rank, not by coordinate: on the minus strand the two disagree and coordinate order is reversed.';
COMMENT ON COLUMN annotation.exon."cds_start" IS 'Start of the coding segment within this exon, 1-based inclusive. NULL where the exon is not translated.';
COMMENT ON COLUMN annotation.exon."cds_end" IS 'End of the coding segment, 1-based inclusive.';
COMMENT ON COLUMN annotation.exon."cds_phase" IS 'Reading frame of the coding segment: bases to remove from its start to reach the first complete codon. Not recoverable from coordinates.';
COMMENT ON COLUMN annotation.exon."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN annotation.exon."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW annotation.identifier_mapping AS SELECT * FROM read_parquet('./annotation/identifier_mapping.parquet');
COMMENT ON VIEW annotation.identifier_mapping IS 'Cross-references between identifier authorities. Mappings are many-to-many in both directions. The whole tuple is the key: a mapping has no attributes that can change, so it is only ever asserted or withdrawn, never updated. Carries no assembly: source = ''ENSEMBL'' rows are written for a taxon''s canonical assembly only (reference.genome.is_canonical), so alternate-strain gene ids such as MGP_129S1SvImJ_G… have no rows here — their symbols are on annotation.gene.';
COMMENT ON COLUMN annotation.identifier_mapping."source_namespace" IS 'Authority of the source identifier, e.g. ENSEMBL.';
COMMENT ON COLUMN annotation.identifier_mapping."source_id" IS 'Identifier in source_namespace.';
COMMENT ON COLUMN annotation.identifier_mapping."target_namespace" IS 'Authority of the target identifier, e.g. SYMBOL.';
COMMENT ON COLUMN annotation.identifier_mapping."target_id" IS 'Identifier in target_namespace.';
COMMENT ON COLUMN annotation.identifier_mapping."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.';
COMMENT ON COLUMN annotation.identifier_mapping."source" IS 'Who asserts this mapping, e.g. ENSEMBL, NCBI. Part of the business key, so that one source cannot retire another''s cross-references.';
COMMENT ON COLUMN annotation.identifier_mapping."confidence" IS 'Asserter''s confidence where one is published; NULL where none is.';
COMMENT ON COLUMN annotation.identifier_mapping."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN annotation.identifier_mapping."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW raw.ncbi__gene2pubmed AS SELECT * FROM read_parquet('./raw/ncbi__gene2pubmed.parquet');
COMMENT ON VIEW raw.ncbi__gene2pubmed IS 'NCBI gene2pubmed landed verbatim and whole — every organism, ~40M rows, not only the taxa we derive annotation for, since a third species should not cost a re-fetch. Regenerated nightly upstream, so it has no release: the retrieval date is the version.';
COMMENT ON COLUMN raw.ncbi__gene2pubmed."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.';
COMMENT ON COLUMN raw.ncbi__gene2pubmed."gene_id" IS 'NCBI Entrez GeneID.';
COMMENT ON COLUMN raw.ncbi__gene2pubmed."pubmed_id" IS 'PubMed id (PMID) of a publication NCBI links to this gene.';
COMMENT ON COLUMN raw.ncbi__gene2pubmed."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW annotation.ncbi__gene_pubmed AS SELECT * FROM read_parquet('./annotation/ncbi__gene_pubmed.parquet');
COMMENT ON VIEW annotation.ncbi__gene_pubmed IS 'Gene-to-publication links as NCBI Gene curates them, keyed by Entrez GeneID. One row per (gene, publication): a gene has many publications and a publication many genes. The whole tuple is the key — a link has no attributes that can change, so it is only ever asserted or withdrawn, never updated.';
COMMENT ON COLUMN annotation.ncbi__gene_pubmed."gene_id" IS 'NCBI Entrez GeneID, e.g. 7157. Part of the merge key.';
COMMENT ON COLUMN annotation.ncbi__gene_pubmed."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.';
COMMENT ON COLUMN annotation.ncbi__gene_pubmed."pubmed_id" IS 'PubMed id (PMID) of a publication discussing this gene. This is the column OrgDb serves as PMID.';
COMMENT ON COLUMN annotation.ncbi__gene_pubmed."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN annotation.ncbi__gene_pubmed."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW raw.ncbi__gene2accession AS SELECT * FROM read_parquet('./raw/ncbi__gene2accession.parquet');
COMMENT ON VIEW raw.ncbi__gene2accession IS 'NCBI gene2accession landed verbatim and whole: every organism and every accession status, a superset of gene2refseq and by far the largest raw table here (~1e9 rows upstream), so it lands streamed in batches. NCBI''s ''-'' placeholder is read as NULL. Positions are strings, unparsed: raw is landed uninterpreted. Regenerated nightly upstream, so the retrieval date is the version.';
COMMENT ON COLUMN raw.ncbi__gene2accession."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.';
COMMENT ON COLUMN raw.ncbi__gene2accession."gene_id" IS 'NCBI Entrez GeneID. Upstream column ''GeneID''.';
COMMENT ON COLUMN raw.ncbi__gene2accession."status" IS 'RefSeq status: REVIEWED, VALIDATED, PROVISIONAL, PREDICTED, INFERRED, MODEL, or the literal string ''NA''. NULL (NCBI''s ''-'') marks a GenBank/INSDC submission, not a RefSeq record.';
COMMENT ON COLUMN raw.ncbi__gene2accession."rna_nucleotide_accession_version" IS 'RNA accession.version, e.g. NM_000546.6, version kept as published. Upstream column ''RNA_nucleotide_accession.version''; upstream''s dots become underscores here because a dot is not a valid column name.';
COMMENT ON COLUMN raw.ncbi__gene2accession."rna_nucleotide_gi" IS 'GI number of the RNA record. Upstream column ''RNA_nucleotide_gi''.';
COMMENT ON COLUMN raw.ncbi__gene2accession."protein_accession_version" IS 'Protein accession.version, e.g. NP_000537.3. Upstream column ''protein_accession.version''.';
COMMENT ON COLUMN raw.ncbi__gene2accession."protein_gi" IS 'GI number of the protein record. Upstream column ''protein_gi''.';
COMMENT ON COLUMN raw.ncbi__gene2accession."genomic_nucleotide_accession_version" IS 'Genomic accession.version the gene is placed on — RefSeq (NC_/NT_/NW_) or GenBank, distinguished by the underscore only RefSeq accessions carry. Upstream column ''genomic_nucleotide_accession.version''.';
COMMENT ON COLUMN raw.ncbi__gene2accession."genomic_nucleotide_gi" IS 'GI number of the genomic record. Upstream column ''genomic_nucleotide_gi''.';
COMMENT ON COLUMN raw.ncbi__gene2accession."start_position_on_the_genomic_accession" IS 'Start of the gene on the genomic accession, 0-based as NCBI publishes this file. String, unparsed, per the raw contract.';
COMMENT ON COLUMN raw.ncbi__gene2accession."end_position_on_the_genomic_accession" IS 'End of the gene on the genomic accession. String, unparsed.';
COMMENT ON COLUMN raw.ncbi__gene2accession."orientation" IS '''+'', ''-'', or ''?'' where the orientation is not known.';
COMMENT ON COLUMN raw.ncbi__gene2accession."assembly" IS 'Assembly the genomic accession belongs to, e.g. ''Reference GRCh38.p14 Primary Assembly''.';
COMMENT ON COLUMN raw.ncbi__gene2accession."mature_peptide_accession_version" IS 'Mature peptide accession.version, rarely present. Upstream column ''mature_peptide_accession.version''.';
COMMENT ON COLUMN raw.ncbi__gene2accession."mature_peptide_gi" IS 'GI number of the mature peptide record. Upstream column ''mature_peptide_gi''.';
COMMENT ON COLUMN raw.ncbi__gene2accession."symbol" IS 'Default symbol at the time of the dump. Upstream column ''Symbol''. gene_info''s symbol is authoritative; this one is a convenience copy.';
COMMENT ON COLUMN raw.ncbi__gene2accession."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW raw.ncbi__gene2go AS SELECT * FROM read_parquet('./raw/ncbi__gene2go.parquet');
COMMENT ON VIEW raw.ncbi__gene2go IS 'NCBI gene2go landed verbatim and whole: every organism NCBI annotates, not only the ones we derive annotation for. NCBI''s ''-'' placeholder is read as NULL; pipe-separated fields are kept as published, unsplit. Regenerated nightly upstream, so the retrieval date is the version.';
COMMENT ON COLUMN raw.ncbi__gene2go."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.';
COMMENT ON COLUMN raw.ncbi__gene2go."gene_id" IS 'NCBI Entrez GeneID.';
COMMENT ON COLUMN raw.ncbi__gene2go."go_id" IS 'GO term id, e.g. GO:0000122. Already CURIE-prefixed by NCBI.';
COMMENT ON COLUMN raw.ncbi__gene2go."evidence" IS 'GO evidence code, e.g. IEA, IDA, TAS. NULL (NCBI''s ''-'') where none is recorded.';
COMMENT ON COLUMN raw.ncbi__gene2go."qualifier" IS 'GO relation qualifier, e.g. involved_in, located_in, enables; ''NOT'' prefixes a negated annotation. Pipe-separated where several apply, kept as published. NULL (NCBI''s ''-'') where none.';
COMMENT ON COLUMN raw.ncbi__gene2go."go_term" IS 'The GO term''s name at retrieval time, e.g. ''nucleus''. A convenience denormalised by NCBI — the ontology, not this file, is the authority for names.';
COMMENT ON COLUMN raw.ncbi__gene2go."pubmed" IS 'PubMed ids supporting the annotation, pipe-separated in one string as NCBI publishes them. NULL (NCBI''s ''-'') where uncited.';
COMMENT ON COLUMN raw.ncbi__gene2go."category" IS 'GO aspect: Function, Process or Component. NCBI''s spelling of the three GO namespaces.';
COMMENT ON COLUMN raw.ncbi__gene2go."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW annotation.ncbi__gene_go AS SELECT * FROM read_parquet('./annotation/ncbi__gene_go.parquet');
COMMENT ON VIEW annotation.ncbi__gene_go IS 'Direct GO annotations per Entrez gene, from NCBI gene2go: OrgDb''s GO table. One row per (gene, term, evidence code, qualifier) per organism. Supporting PMIDs are not carried — they live unsplit in raw.ncbi__gene2go. The GOALL closure over ancestor terms is deliberately absent: it depends on a GO DAG snapshot, which is its own source.';
COMMENT ON COLUMN annotation.ncbi__gene_go."gene_id" IS 'NCBI Entrez GeneID, e.g. 7157. OrgDb''s ENTREZID; reach an Ensembl gene through annotation.identifier_mapping.';
COMMENT ON COLUMN annotation.ncbi__gene_go."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.';
COMMENT ON COLUMN annotation.ncbi__gene_go."go_id" IS 'GO term id, e.g. GO:0000122. DIRECT annotation only — ancestor terms (OrgDb''s GOALL) need the GO DAG and are not here.';
COMMENT ON COLUMN annotation.ncbi__gene_go."evidence" IS 'GO evidence code, e.g. IEA, IDA, TAS. OrgDb''s EVIDENCE. Part of the merge key — the same term asserted under two codes is two annotations. Empty string where NCBI published ''-'', never NULL: a NULL key never joins to itself and would churn on every merge.';
COMMENT ON COLUMN annotation.ncbi__gene_go."qualifier" IS 'GO relation qualifier, e.g. involved_in, located_in; ''NOT'' prefixes a negated annotation — dropping it would invert the claim, which is why this is part of the merge key. Pipe-separated where several apply. Empty string where NCBI published ''-'', never NULL, for the same join reason as evidence.';
COMMENT ON COLUMN annotation.ncbi__gene_go."go_term" IS 'The GO term''s name as NCBI carried it at retrieval, e.g. ''nucleus''. Denormalised convenience; the ontology is the authority.';
COMMENT ON COLUMN annotation.ncbi__gene_go."category" IS 'GO aspect: Function, Process or Component. OrgDb''s ONTOLOGY column, under NCBI''s spelling rather than BP/CC/MF.';
COMMENT ON COLUMN annotation.ncbi__gene_go."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN annotation.ncbi__gene_go."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW raw.icite__metadata AS SELECT * FROM read_parquet('./raw/icite__metadata.parquet');
COMMENT ON VIEW raw.icite__metadata IS 'The NIH iCite database snapshot landed verbatim, every column as text — the citation lists included. Holds the LATEST snapshot only, a deliberate narrowing of the raw layer''s per-version rule: one snapshot is ~40M rows dominated by PMID lists, older snapshots stay immutable on Figshare, and every snapshot''s metrics are kept in annotation.icite__metrics. CC BY 4.0; cite iCite.';
COMMENT ON COLUMN raw.icite__metadata."pmid" IS 'PubMed id, as text as upstream prints it.';
COMMENT ON COLUMN raw.icite__metadata."doi" IS 'DOI if iCite has one; blank upstream reads as blank here.';
COMMENT ON COLUMN raw.icite__metadata."year" IS 'Publication year.';
COMMENT ON COLUMN raw.icite__metadata."title" IS 'Article title.';
COMMENT ON COLUMN raw.icite__metadata."authors" IS 'Author names, one comma-separated string.';
COMMENT ON COLUMN raw.icite__metadata."journal" IS 'Journal name, ISO abbreviation.';
COMMENT ON COLUMN raw.icite__metadata."is_research_article" IS '''Yes''/''No'': publication types consistent with primary research.';
COMMENT ON COLUMN raw.icite__metadata."relative_citation_ratio" IS 'RCR: field- and time-normalised citation rate, NIH R01 papers = 1.0.';
COMMENT ON COLUMN raw.icite__metadata."nih_percentile" IS 'RCR percentile among NIH-funded papers.';
COMMENT ON COLUMN raw.icite__metadata."human" IS 'Translation module: human fraction, 0-1.';
COMMENT ON COLUMN raw.icite__metadata."animal" IS 'Translation module: animal fraction, 0-1.';
COMMENT ON COLUMN raw.icite__metadata."molecular_cellular" IS 'Translation module: molecular/cellular fraction, 0-1.';
COMMENT ON COLUMN raw.icite__metadata."apt" IS 'Approximate Potential to Translate: predicted probability of citation by a clinical article.';
COMMENT ON COLUMN raw.icite__metadata."is_clinical" IS '''Yes''/''No'': the article itself is clinical.';
COMMENT ON COLUMN raw.icite__metadata."citation_count" IS 'Citations received, per the NIH Open Citation Collection.';
COMMENT ON COLUMN raw.icite__metadata."citations_per_year" IS 'citation_count over years since publication.';
COMMENT ON COLUMN raw.icite__metadata."expected_citations_per_year" IS 'Field-expected citations per year, the RCR denominator.';
COMMENT ON COLUMN raw.icite__metadata."field_citation_rate" IS 'Citation rate of the paper''s co-citation network.';
COMMENT ON COLUMN raw.icite__metadata."provisional" IS '''Yes''/''No'': RCR is provisional (paper under two years old).';
COMMENT ON COLUMN raw.icite__metadata."x_coord" IS 'Translation triangle x coordinate.';
COMMENT ON COLUMN raw.icite__metadata."y_coord" IS 'Translation triangle y coordinate.';
COMMENT ON COLUMN raw.icite__metadata."cited_by_clin" IS 'Space-separated PMIDs of clinical articles citing this one.';
COMMENT ON COLUMN raw.icite__metadata."cited_by" IS 'Space-separated PMIDs citing this one.';
COMMENT ON COLUMN raw.icite__metadata."references" IS 'Space-separated PMIDs this one cites.';
COMMENT ON COLUMN raw.icite__metadata."last_modified" IS 'Upstream last-modified timestamp of the record.';
COMMENT ON COLUMN raw.icite__metadata."snapshot" IS 'iCite snapshot label, e.g. ''2026-08'': the monthly Figshare release these values were read from.';
COMMENT ON COLUMN raw.icite__metadata."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW annotation.icite__publication AS SELECT * FROM read_parquet('./annotation/icite__publication.parquet');
COMMENT ON VIEW annotation.icite__publication IS 'One row per PubMed record as iCite describes it: what the paper is, not how it is cited — those numbers move monthly and live in annotation.icite__metrics. Joins to annotation.ncbi__gene_pubmed on pmid. Source: NIH iCite, CC BY 4.0.';
COMMENT ON COLUMN annotation.icite__publication."pmid" IS 'PubMed id (PMID) of the paper. Part of the merge key.';
COMMENT ON COLUMN annotation.icite__publication."doi" IS 'DOI, normalised: lower-case, no resolver prefix, always ''10.<registrant>/<suffix>''. NULL when iCite has none or its value is not a DOI (6,414 rows in the 2026-08 snapshot); the original text is in raw.icite__metadata.doi. Not unique: 16,521 DOIs map to more than one PMID.';
COMMENT ON COLUMN annotation.icite__publication."title" IS 'Article title, whitespace-trimmed.';
COMMENT ON COLUMN annotation.icite__publication."authors" IS 'Author names as one string, as iCite prints them.';
COMMENT ON COLUMN annotation.icite__publication."journal" IS 'Journal name, ISO abbreviation.';
COMMENT ON COLUMN annotation.icite__publication."year" IS 'Publication year.';
COMMENT ON COLUMN annotation.icite__publication."is_research_article" IS 'Publication types consistent with primary research, per iCite.';
COMMENT ON COLUMN annotation.icite__publication."is_clinical" IS 'The article itself is a clinical article, per iCite.';
COMMENT ON COLUMN annotation.icite__publication."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN annotation.icite__publication."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW annotation.icite__metrics AS SELECT * FROM read_parquet('./annotation/icite__metrics.parquet');
COMMENT ON VIEW annotation.icite__metrics IS 'iCite''s citation metrics for one paper as of one monthly snapshot. Keyed by (pmid, snapshot) so a snapshot''s numbers are facts that never change — the alternative, metrics as Type 2 attributes, would open ~40M version rows a month. For the current view take the latest snapshot; to see a paper''s trajectory, order by snapshot. Source: NIH iCite, CC BY 4.0.';
COMMENT ON COLUMN annotation.icite__metrics."pmid" IS 'PubMed id (PMID) of the paper. Part of the merge key.';
COMMENT ON COLUMN annotation.icite__metrics."snapshot" IS 'iCite snapshot label, e.g. ''2026-08'': the monthly Figshare release these values were read from. Part of the merge key.';
COMMENT ON COLUMN annotation.icite__metrics."relative_citation_ratio" IS 'RCR: field- and time-normalised citation rate; NIH R01-funded papers average 1.0.';
COMMENT ON COLUMN annotation.icite__metrics."nih_percentile" IS 'RCR percentile among NIH-funded papers.';
COMMENT ON COLUMN annotation.icite__metrics."citation_count" IS 'Citations received per the NIH Open Citation Collection.';
COMMENT ON COLUMN annotation.icite__metrics."citations_per_year" IS 'citation_count over years since publication.';
COMMENT ON COLUMN annotation.icite__metrics."expected_citations_per_year" IS 'Field-expected citations per year, the RCR denominator.';
COMMENT ON COLUMN annotation.icite__metrics."field_citation_rate" IS 'Citation rate of the paper''s co-citation network.';
COMMENT ON COLUMN annotation.icite__metrics."human" IS 'Translation module: human fraction, 0-1.';
COMMENT ON COLUMN annotation.icite__metrics."animal" IS 'Translation module: animal fraction, 0-1.';
COMMENT ON COLUMN annotation.icite__metrics."molecular_cellular" IS 'Translation module: molecular/cellular fraction, 0-1.';
COMMENT ON COLUMN annotation.icite__metrics."apt" IS 'Approximate Potential to Translate: predicted probability of citation by a clinical article.';
COMMENT ON COLUMN annotation.icite__metrics."provisional" IS 'RCR is provisional (paper under two years old).';
COMMENT ON COLUMN annotation.icite__metrics."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN annotation.icite__metrics."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW raw.cellxgene__dataset AS SELECT * FROM read_parquet('./raw/cellxgene__dataset.parquet');
COMMENT ON VIEW raw.cellxgene__dataset IS 'The CELLxGENE Discover PUBLIC dataset listing landed verbatim: one row per dataset version. Scalar fields are typed directly; multi-valued and nested fields are kept as their JSON text, unexploded, per the raw contract. Holds the LATEST crawl only, a deliberate narrowing of the raw layer''s per-version rule (same reason as raw.icite__metadata): the listing has no archived versions of its own to accumulate. Licence CC BY 4.0.';
COMMENT ON COLUMN raw.cellxgene__dataset."dataset_id" IS 'CELLxGENE dataset id. Stable across revisions; a revision keeps this id and gets a new dataset_version_id.';
COMMENT ON COLUMN raw.cellxgene__dataset."dataset_version_id" IS 'Id of this specific version of the dataset. What resource.cellxgene__dataset is keyed on.';
COMMENT ON COLUMN raw.cellxgene__dataset."collection_id" IS 'Id of the collection this dataset belongs to.';
COMMENT ON COLUMN raw.cellxgene__dataset."collection_version_id" IS 'Id of this version of the collection.';
COMMENT ON COLUMN raw.cellxgene__dataset."collection_name" IS 'Collection title, e.g. a study or atlas name.';
COMMENT ON COLUMN raw.cellxgene__dataset."collection_doi" IS 'DOI of the collection''s publication, where one exists.';
COMMENT ON COLUMN raw.cellxgene__dataset."collection_doi_label" IS 'Human-readable citation for collection_doi, as CZI formats it.';
COMMENT ON COLUMN raw.cellxgene__dataset."title" IS 'Dataset title.';
COMMENT ON COLUMN raw.cellxgene__dataset."citation" IS 'CZI''s own suggested citation string for this dataset version.';
COMMENT ON COLUMN raw.cellxgene__dataset."schema_version" IS 'CELLxGENE schema version the dataset''s H5AD conforms to, e.g. ''7.1.0''.';
COMMENT ON COLUMN raw.cellxgene__dataset."cell_count" IS 'Total cells in the dataset.';
COMMENT ON COLUMN raw.cellxgene__dataset."primary_cell_count" IS 'Cells flagged is_primary_data = true, CZI''s own de-duplication rule (a cell profiled in two datasets is primary in exactly one). <= cell_count.';
COMMENT ON COLUMN raw.cellxgene__dataset."mean_genes_per_cell" IS 'Mean genes detected per cell.';
COMMENT ON COLUMN raw.cellxgene__dataset."published_at" IS 'ISO 8601 timestamp the dataset was first published, as CZI publishes it. Unparsed.';
COMMENT ON COLUMN raw.cellxgene__dataset."revised_at" IS 'ISO 8601 timestamp of the latest revision; NULL if never revised. Unparsed.';
COMMENT ON COLUMN raw.cellxgene__dataset."explorer_url" IS 'CELLxGENE Explorer URL for interactive browsing.';
COMMENT ON COLUMN raw.cellxgene__dataset."processing_status" IS 'CZI''s own pipeline status, e.g. ''SUCCESS''.';
COMMENT ON COLUMN raw.cellxgene__dataset."tombstone" IS 'CZI''s tombstone flag. Always false in this table in practice: a tombstoned dataset is excluded from the PUBLIC listing outright rather than kept with this set, so retirement here is via ordinary set-difference against the next crawl, not this column.';
COMMENT ON COLUMN raw.cellxgene__dataset."visibility" IS 'CZI''s visibility tag. Always ''PUBLIC'': the listing is fetched pre-filtered to it.';
COMMENT ON COLUMN raw.cellxgene__dataset."is_pre_analysis" IS 'CZI flag: dataset predates a schema change that added fields later versions carry.';
COMMENT ON COLUMN raw.cellxgene__dataset."revision_of_collection" IS 'Collection id this collection supersedes, where this is a revision. NULL otherwise.';
COMMENT ON COLUMN raw.cellxgene__dataset."revision_of_dataset" IS 'Dataset id this dataset version supersedes, where this is a revision. NULL otherwise.';
COMMENT ON COLUMN raw.cellxgene__dataset."x_approximate_distribution" IS 'Distribution family CZI assumes for X, e.g. ''COUNT'', for tools that need it.';
COMMENT ON COLUMN raw.cellxgene__dataset."organism" IS '[{label, ontology_term_id}, ...] as JSON text, unexploded -- exploding is interpretation, done in transform. NCBITaxon terms. Every dataset observed 2026-09-18 carries exactly one.';
COMMENT ON COLUMN raw.cellxgene__dataset."assay" IS '[{label, ontology_term_id}, ...] as JSON text. EFO terms.';
COMMENT ON COLUMN raw.cellxgene__dataset."tissue" IS '[{label, ontology_term_id, tissue_type}, ...] as JSON text. UBERON (or CL for cell culture) terms.';
COMMENT ON COLUMN raw.cellxgene__dataset."disease" IS '[{label, ontology_term_id}, ...] as JSON text. MONDO terms, or PATO:0000461 for ''normal''.';
COMMENT ON COLUMN raw.cellxgene__dataset."cell_type" IS '[{label, ontology_term_id}, ...] as JSON text. CL terms, or ''unknown''.';
COMMENT ON COLUMN raw.cellxgene__dataset."development_stage" IS '[{label, ontology_term_id}, ...] as JSON text. HsapDv/MmusDv/UBERON terms depending on organism.';
COMMENT ON COLUMN raw.cellxgene__dataset."self_reported_ethnicity" IS '[{label, ontology_term_id}, ...] as JSON text. HANCESTRO terms, or ''unknown''/''na''.';
COMMENT ON COLUMN raw.cellxgene__dataset."sex" IS '[{label, ontology_term_id}, ...] as JSON text. PATO terms, or ''unknown''.';
COMMENT ON COLUMN raw.cellxgene__dataset."donor_id" IS '[donor id, ...] as JSON text: plain curator-assigned strings, no ontology term.';
COMMENT ON COLUMN raw.cellxgene__dataset."suspension_type" IS '[suspension type, ...] as JSON text, e.g. ''cell'', ''nucleus'', ''na''. Plain strings, no ontology term.';
COMMENT ON COLUMN raw.cellxgene__dataset."is_primary_data" IS '[bool, ...] as JSON text: which is_primary_data values occur among this dataset''s cells.';
COMMENT ON COLUMN raw.cellxgene__dataset."assets" IS '[{filesize, filetype, url}, ...] as JSON text. filetype is ''H5AD'' for every dataset observed 2026-09-18, plus ''ATAC_FRAGMENT''/''ATAC_INDEX'' for 21 ATAC datasets. No SpatialData/OME-Zarr filetype has been observed; resource.cellxgene__dataset.spatialdata_uri stays NULL until one is.';
COMMENT ON COLUMN raw.cellxgene__dataset."spatial" IS '{has_fullres, is_single} as JSON text where the dataset is spatial; NULL (JSON null) otherwise. Presence, not content, is what resource.cellxgene__dataset.is_spatial reads.';
COMMENT ON COLUMN raw.cellxgene__dataset."batch_condition" IS '[column name, ...] as JSON text: obs columns CZI suggests batching on, where curated. Often NULL.';
COMMENT ON COLUMN raw.cellxgene__dataset."perturbation_types" IS '[perturbation type, ...] as JSON text, e.g. ''chemical''. NULL where not a perturbation dataset.';
COMMENT ON COLUMN raw.cellxgene__dataset."genetic_perturbation_strategy" IS '[strategy, ...] as JSON text. NULL in every dataset observed 2026-09-18.';
COMMENT ON COLUMN raw.cellxgene__dataset."retrieval_date" IS 'UTC date this crawl of the listing was taken, YYYY-MM-DD. The source''s own version: the Discover API publishes a live current-state listing, not archived per-release dumps.';
COMMENT ON COLUMN raw.cellxgene__dataset."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW resource.cellxgene__dataset AS SELECT * FROM read_parquet('./resource/cellxgene__dataset.parquet');
COMMENT ON VIEW resource.cellxgene__dataset IS 'One row per CELLxGENE dataset version: what the dataset is, where its H5AD and Census cells live, never the expression matrix itself. A dataset that disappears from the next crawl (tombstoned, or superseded by a revision under a new dataset_version_id) is closed by the ordinary merge set-difference rule; the revision''s new dataset_version_id opens a new row (issue #84 acceptance criterion 5). annotation.cellxgene__gene (Census var, keyed by feature_id and census_release) and annotation.cellxgene__cell (Census obs, issue #85) are companions, not here: var ships only inside the TileDB-SOMA store and tiledbsoma is not an allowed dependency, so that table is deferred until Census publishes var in a DuckDB-readable form.';
COMMENT ON COLUMN resource.cellxgene__dataset."dataset_id" IS 'CELLxGENE dataset id. Stable across revisions; several rows here can share one, each a different dataset_version_id.';
COMMENT ON COLUMN resource.cellxgene__dataset."dataset_version_id" IS 'Id of this specific dataset version. The business key: a revision or a tombstoned dataset closes this row (valid_to set) rather than updating it in place.';
COMMENT ON COLUMN resource.cellxgene__dataset."collection_id" IS 'Id of the collection this dataset belongs to.';
COMMENT ON COLUMN resource.cellxgene__dataset."collection_name" IS 'Collection title, e.g. a study or atlas name.';
COMMENT ON COLUMN resource.cellxgene__dataset."collection_doi" IS 'DOI of the collection''s publication, where one exists.';
COMMENT ON COLUMN resource.cellxgene__dataset."title" IS 'Dataset title.';
COMMENT ON COLUMN resource.cellxgene__dataset."taxon_id" IS 'NCBI taxon id, parsed from the listing''s organism ontology_term_id (always ''NCBITaxon:<id>'' in data observed 2026-09-18). A dataset whose organism does not parse this way, or that carries more than one organism, fails the ingest loudly rather than dropping or guessing (issue #84 acceptance criterion 3).';
COMMENT ON COLUMN resource.cellxgene__dataset."organism_label" IS 'Organism common/scientific name as CZI labels it, e.g. ''Homo sapiens''.';
COMMENT ON COLUMN resource.cellxgene__dataset."assay_term_ids" IS 'Ontology term ids of every value the listing gives, sorted, as a list — a convenience for list_contains() filters. The joinable form is resource.resource_relationship, one row per (dataset version, relationship, term). EFO terms.';
COMMENT ON COLUMN resource.cellxgene__dataset."tissue_term_ids" IS 'Ontology term ids of every value the listing gives, sorted, as a list — a convenience for list_contains() filters. The joinable form is resource.resource_relationship, one row per (dataset version, relationship, term). UBERON (or CL) terms.';
COMMENT ON COLUMN resource.cellxgene__dataset."disease_term_ids" IS 'Ontology term ids of every value the listing gives, sorted, as a list — a convenience for list_contains() filters. The joinable form is resource.resource_relationship, one row per (dataset version, relationship, term). MONDO terms, or PATO:0000461 for ''normal''.';
COMMENT ON COLUMN resource.cellxgene__dataset."cell_type_term_ids" IS 'Ontology term ids of every value the listing gives, sorted, as a list — a convenience for list_contains() filters. The joinable form is resource.resource_relationship, one row per (dataset version, relationship, term). CL terms, or ''unknown''.';
COMMENT ON COLUMN resource.cellxgene__dataset."cell_count" IS 'Total cells in the dataset.';
COMMENT ON COLUMN resource.cellxgene__dataset."primary_cell_count" IS 'Cells flagged is_primary_data = true. <= cell_count.';
COMMENT ON COLUMN resource.cellxgene__dataset."mean_genes_per_cell" IS 'Mean genes detected per cell.';
COMMENT ON COLUMN resource.cellxgene__dataset."schema_version" IS 'CELLxGENE schema version the dataset''s H5AD conforms to, e.g. ''7.1.0''.';
COMMENT ON COLUMN resource.cellxgene__dataset."license" IS 'Always ''CC BY 4.0'': CELLxGENE Discover''s uniform licence for public data.';
COMMENT ON COLUMN resource.cellxgene__dataset."h5ad_uri" IS 'Public HTTPS URL of the dataset''s H5AD, from the listing''s assets. Referenced, never landed (SPEC.md Large Data Integration). Required: every row has one, or the ingest fails (issue #84 acceptance criterion 2).';
COMMENT ON COLUMN resource.cellxgene__dataset."census_release" IS 'Census build (e.g. ''2025-11-08'') this dataset''s cells are reachable through, via annotation.cellxgene__cell (issue #85) keyed the same way. Defaults to the Census release manifest''s ''stable'' LTS alias at ingest time.';
COMMENT ON COLUMN resource.cellxgene__dataset."published_at" IS 'ISO 8601 timestamp the dataset was first published. Unparsed.';
COMMENT ON COLUMN resource.cellxgene__dataset."revised_at" IS 'ISO 8601 timestamp of the latest revision; NULL if never revised. Unparsed.';
COMMENT ON COLUMN resource.cellxgene__dataset."tombstone" IS 'CZI''s tombstone flag, carried through from raw. Always false in practice here: a tombstoned dataset is excluded from the PUBLIC listing outright, so its row is closed by ordinary retirement (valid_to set) rather than by this flag flipping true.';
COMMENT ON COLUMN resource.cellxgene__dataset."is_spatial" IS 'True for a spatial dataset (the listing''s spatial object is non-null: Visium, Slide-seq and similar). Issue #84 acceptance criterion 9.';
COMMENT ON COLUMN resource.cellxgene__dataset."spatial_platform" IS 'Spatial platform name, derived from the assay ontology term via a controlled mapping (SPATIAL_PLATFORMS in cellxgene.py) -- never free text. NULL for a non-spatial dataset; for a spatial one, an assay term absent from the mapping fails the ingest loudly rather than becoming NULL (issue #84 acceptance criterion 11).';
COMMENT ON COLUMN resource.cellxgene__dataset."spatialdata_uri" IS 'URI of the scverse SpatialData (OME-Zarr) store, where the source publishes one. Images and transcript-level point clouds live there, referenced, never landed. NULL where absent -- as of 2026-09-18 that is every dataset (issue #84 acceptance criterion 10).';
COMMENT ON COLUMN resource.cellxgene__dataset."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN resource.cellxgene__dataset."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW raw.obo__cl AS SELECT * FROM read_parquet('./raw/obo__cl.parquet');
COMMENT ON VIEW raw.obo__cl IS 'CL landed verbatim from its OBO Graphs JSON release: one row per node and one row per edge, the WHOLE file — every imported class or property from another ontology included, not filtered to the CL namespace. Filtering at land time would make raw a function of what ontology.term happens to derive today (ADR-0002); ontology.term''s node count matches this table''s node-row count exactly for that reason. Licence CC-BY-4.0.';
COMMENT ON COLUMN raw.obo__cl."kind" IS '''node'' or ''edge'': which half of the OBO Graphs JSON this row came from.';
COMMENT ON COLUMN raw.obo__cl."id" IS 'Node IRI. NULL on an edge row.';
COMMENT ON COLUMN raw.obo__cl."lbl" IS 'Node label (rdfs:label). NULL on an edge row, and on the node rows the file itself leaves unlabeled (imported classes mostly).';
COMMENT ON COLUMN raw.obo__cl."sub" IS 'Edge subject IRI. NULL on a node row.';
COMMENT ON COLUMN raw.obo__cl."pred" IS 'Edge predicate: ''is_a'' verbatim (the only relation OBO Graphs JSON ever states unqualified), otherwise the relation''s own IRI. NULL on a node row.';
COMMENT ON COLUMN raw.obo__cl."obj" IS 'Edge object IRI. NULL on a node row.';
COMMENT ON COLUMN raw.obo__cl."meta" IS 'The node''s or edge''s ''meta'' object — definition, synonyms, xrefs, basicPropertyValues, deprecated flag — serialized back to JSON text verbatim. Kept whole and unparsed, like the GTF attribute column: interpreting it is a transform concern. NULL where the file carries no meta for that node or edge.';
COMMENT ON COLUMN raw.obo__cl."release_version" IS 'This ontology''s own version, read from graphs[0].meta.version in the file (a version IRI or a date, whichever the ontology publishes). Raw is replaced wholesale per value of this column, so more than one release can coexist, the same as raw.ensembl__gtf per ensembl_release.';
COMMENT ON COLUMN raw.obo__cl."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW raw.obo__uberon AS SELECT * FROM read_parquet('./raw/obo__uberon.parquet');
COMMENT ON VIEW raw.obo__uberon IS 'UBERON landed verbatim from its OBO Graphs JSON release: one row per node and one row per edge, the WHOLE file — every imported class or property from another ontology included, not filtered to the UBERON namespace. Filtering at land time would make raw a function of what ontology.term happens to derive today (ADR-0002); ontology.term''s node count matches this table''s node-row count exactly for that reason. Licence CC-BY-3.0.';
COMMENT ON COLUMN raw.obo__uberon."kind" IS '''node'' or ''edge'': which half of the OBO Graphs JSON this row came from.';
COMMENT ON COLUMN raw.obo__uberon."id" IS 'Node IRI. NULL on an edge row.';
COMMENT ON COLUMN raw.obo__uberon."lbl" IS 'Node label (rdfs:label). NULL on an edge row, and on the node rows the file itself leaves unlabeled (imported classes mostly).';
COMMENT ON COLUMN raw.obo__uberon."sub" IS 'Edge subject IRI. NULL on a node row.';
COMMENT ON COLUMN raw.obo__uberon."pred" IS 'Edge predicate: ''is_a'' verbatim (the only relation OBO Graphs JSON ever states unqualified), otherwise the relation''s own IRI. NULL on a node row.';
COMMENT ON COLUMN raw.obo__uberon."obj" IS 'Edge object IRI. NULL on a node row.';
COMMENT ON COLUMN raw.obo__uberon."meta" IS 'The node''s or edge''s ''meta'' object — definition, synonyms, xrefs, basicPropertyValues, deprecated flag — serialized back to JSON text verbatim. Kept whole and unparsed, like the GTF attribute column: interpreting it is a transform concern. NULL where the file carries no meta for that node or edge.';
COMMENT ON COLUMN raw.obo__uberon."release_version" IS 'This ontology''s own version, read from graphs[0].meta.version in the file (a version IRI or a date, whichever the ontology publishes). Raw is replaced wholesale per value of this column, so more than one release can coexist, the same as raw.ensembl__gtf per ensembl_release.';
COMMENT ON COLUMN raw.obo__uberon."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW raw.obo__mondo AS SELECT * FROM read_parquet('./raw/obo__mondo.parquet');
COMMENT ON VIEW raw.obo__mondo IS 'MONDO landed verbatim from its OBO Graphs JSON release: one row per node and one row per edge, the WHOLE file — every imported class or property from another ontology included, not filtered to the MONDO namespace. Filtering at land time would make raw a function of what ontology.term happens to derive today (ADR-0002); ontology.term''s node count matches this table''s node-row count exactly for that reason. Licence CC-BY-4.0.';
COMMENT ON COLUMN raw.obo__mondo."kind" IS '''node'' or ''edge'': which half of the OBO Graphs JSON this row came from.';
COMMENT ON COLUMN raw.obo__mondo."id" IS 'Node IRI. NULL on an edge row.';
COMMENT ON COLUMN raw.obo__mondo."lbl" IS 'Node label (rdfs:label). NULL on an edge row, and on the node rows the file itself leaves unlabeled (imported classes mostly).';
COMMENT ON COLUMN raw.obo__mondo."sub" IS 'Edge subject IRI. NULL on a node row.';
COMMENT ON COLUMN raw.obo__mondo."pred" IS 'Edge predicate: ''is_a'' verbatim (the only relation OBO Graphs JSON ever states unqualified), otherwise the relation''s own IRI. NULL on a node row.';
COMMENT ON COLUMN raw.obo__mondo."obj" IS 'Edge object IRI. NULL on a node row.';
COMMENT ON COLUMN raw.obo__mondo."meta" IS 'The node''s or edge''s ''meta'' object — definition, synonyms, xrefs, basicPropertyValues, deprecated flag — serialized back to JSON text verbatim. Kept whole and unparsed, like the GTF attribute column: interpreting it is a transform concern. NULL where the file carries no meta for that node or edge.';
COMMENT ON COLUMN raw.obo__mondo."release_version" IS 'This ontology''s own version, read from graphs[0].meta.version in the file (a version IRI or a date, whichever the ontology publishes). Raw is replaced wholesale per value of this column, so more than one release can coexist, the same as raw.ensembl__gtf per ensembl_release.';
COMMENT ON COLUMN raw.obo__mondo."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW raw.obo__efo AS SELECT * FROM read_parquet('./raw/obo__efo.parquet');
COMMENT ON VIEW raw.obo__efo IS 'EFO landed verbatim from its OBO Graphs JSON release: one row per node and one row per edge, the WHOLE file — every imported class or property from another ontology included, not filtered to the EFO namespace. Filtering at land time would make raw a function of what ontology.term happens to derive today (ADR-0002); ontology.term''s node count matches this table''s node-row count exactly for that reason. Licence Apache-2.0.';
COMMENT ON COLUMN raw.obo__efo."kind" IS '''node'' or ''edge'': which half of the OBO Graphs JSON this row came from.';
COMMENT ON COLUMN raw.obo__efo."id" IS 'Node IRI. NULL on an edge row.';
COMMENT ON COLUMN raw.obo__efo."lbl" IS 'Node label (rdfs:label). NULL on an edge row, and on the node rows the file itself leaves unlabeled (imported classes mostly).';
COMMENT ON COLUMN raw.obo__efo."sub" IS 'Edge subject IRI. NULL on a node row.';
COMMENT ON COLUMN raw.obo__efo."pred" IS 'Edge predicate: ''is_a'' verbatim (the only relation OBO Graphs JSON ever states unqualified), otherwise the relation''s own IRI. NULL on a node row.';
COMMENT ON COLUMN raw.obo__efo."obj" IS 'Edge object IRI. NULL on a node row.';
COMMENT ON COLUMN raw.obo__efo."meta" IS 'The node''s or edge''s ''meta'' object — definition, synonyms, xrefs, basicPropertyValues, deprecated flag — serialized back to JSON text verbatim. Kept whole and unparsed, like the GTF attribute column: interpreting it is a transform concern. NULL where the file carries no meta for that node or edge.';
COMMENT ON COLUMN raw.obo__efo."release_version" IS 'This ontology''s own version, read from graphs[0].meta.version in the file (a version IRI or a date, whichever the ontology publishes). Raw is replaced wholesale per value of this column, so more than one release can coexist, the same as raw.ensembl__gtf per ensembl_release.';
COMMENT ON COLUMN raw.obo__efo."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW raw.obo__hsapdv AS SELECT * FROM read_parquet('./raw/obo__hsapdv.parquet');
COMMENT ON VIEW raw.obo__hsapdv IS 'HSAPDV landed verbatim from its OBO Graphs JSON release: one row per node and one row per edge, the WHOLE file — every imported class or property from another ontology included, not filtered to the HSAPDV namespace. Filtering at land time would make raw a function of what ontology.term happens to derive today (ADR-0002); ontology.term''s node count matches this table''s node-row count exactly for that reason. Licence CC-BY-4.0.';
COMMENT ON COLUMN raw.obo__hsapdv."kind" IS '''node'' or ''edge'': which half of the OBO Graphs JSON this row came from.';
COMMENT ON COLUMN raw.obo__hsapdv."id" IS 'Node IRI. NULL on an edge row.';
COMMENT ON COLUMN raw.obo__hsapdv."lbl" IS 'Node label (rdfs:label). NULL on an edge row, and on the node rows the file itself leaves unlabeled (imported classes mostly).';
COMMENT ON COLUMN raw.obo__hsapdv."sub" IS 'Edge subject IRI. NULL on a node row.';
COMMENT ON COLUMN raw.obo__hsapdv."pred" IS 'Edge predicate: ''is_a'' verbatim (the only relation OBO Graphs JSON ever states unqualified), otherwise the relation''s own IRI. NULL on a node row.';
COMMENT ON COLUMN raw.obo__hsapdv."obj" IS 'Edge object IRI. NULL on a node row.';
COMMENT ON COLUMN raw.obo__hsapdv."meta" IS 'The node''s or edge''s ''meta'' object — definition, synonyms, xrefs, basicPropertyValues, deprecated flag — serialized back to JSON text verbatim. Kept whole and unparsed, like the GTF attribute column: interpreting it is a transform concern. NULL where the file carries no meta for that node or edge.';
COMMENT ON COLUMN raw.obo__hsapdv."release_version" IS 'This ontology''s own version, read from graphs[0].meta.version in the file (a version IRI or a date, whichever the ontology publishes). Raw is replaced wholesale per value of this column, so more than one release can coexist, the same as raw.ensembl__gtf per ensembl_release.';
COMMENT ON COLUMN raw.obo__hsapdv."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW raw.obo__mmusdv AS SELECT * FROM read_parquet('./raw/obo__mmusdv.parquet');
COMMENT ON VIEW raw.obo__mmusdv IS 'MMUSDV landed verbatim from its OBO Graphs JSON release: one row per node and one row per edge, the WHOLE file — every imported class or property from another ontology included, not filtered to the MMUSDV namespace. Filtering at land time would make raw a function of what ontology.term happens to derive today (ADR-0002); ontology.term''s node count matches this table''s node-row count exactly for that reason. Licence CC-BY-4.0.';
COMMENT ON COLUMN raw.obo__mmusdv."kind" IS '''node'' or ''edge'': which half of the OBO Graphs JSON this row came from.';
COMMENT ON COLUMN raw.obo__mmusdv."id" IS 'Node IRI. NULL on an edge row.';
COMMENT ON COLUMN raw.obo__mmusdv."lbl" IS 'Node label (rdfs:label). NULL on an edge row, and on the node rows the file itself leaves unlabeled (imported classes mostly).';
COMMENT ON COLUMN raw.obo__mmusdv."sub" IS 'Edge subject IRI. NULL on a node row.';
COMMENT ON COLUMN raw.obo__mmusdv."pred" IS 'Edge predicate: ''is_a'' verbatim (the only relation OBO Graphs JSON ever states unqualified), otherwise the relation''s own IRI. NULL on a node row.';
COMMENT ON COLUMN raw.obo__mmusdv."obj" IS 'Edge object IRI. NULL on a node row.';
COMMENT ON COLUMN raw.obo__mmusdv."meta" IS 'The node''s or edge''s ''meta'' object — definition, synonyms, xrefs, basicPropertyValues, deprecated flag — serialized back to JSON text verbatim. Kept whole and unparsed, like the GTF attribute column: interpreting it is a transform concern. NULL where the file carries no meta for that node or edge.';
COMMENT ON COLUMN raw.obo__mmusdv."release_version" IS 'This ontology''s own version, read from graphs[0].meta.version in the file (a version IRI or a date, whichever the ontology publishes). Raw is replaced wholesale per value of this column, so more than one release can coexist, the same as raw.ensembl__gtf per ensembl_release.';
COMMENT ON COLUMN raw.obo__mmusdv."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW raw.obo__go AS SELECT * FROM read_parquet('./raw/obo__go.parquet');
COMMENT ON VIEW raw.obo__go IS 'GO landed verbatim from its OBO Graphs JSON release: one row per node and one row per edge, the WHOLE file — every imported class or property from another ontology included, not filtered to the GO namespace. Filtering at land time would make raw a function of what ontology.term happens to derive today (ADR-0002); ontology.term''s node count matches this table''s node-row count exactly for that reason. Licence CC-BY-4.0.';
COMMENT ON COLUMN raw.obo__go."kind" IS '''node'' or ''edge'': which half of the OBO Graphs JSON this row came from.';
COMMENT ON COLUMN raw.obo__go."id" IS 'Node IRI. NULL on an edge row.';
COMMENT ON COLUMN raw.obo__go."lbl" IS 'Node label (rdfs:label). NULL on an edge row, and on the node rows the file itself leaves unlabeled (imported classes mostly).';
COMMENT ON COLUMN raw.obo__go."sub" IS 'Edge subject IRI. NULL on a node row.';
COMMENT ON COLUMN raw.obo__go."pred" IS 'Edge predicate: ''is_a'' verbatim (the only relation OBO Graphs JSON ever states unqualified), otherwise the relation''s own IRI. NULL on a node row.';
COMMENT ON COLUMN raw.obo__go."obj" IS 'Edge object IRI. NULL on a node row.';
COMMENT ON COLUMN raw.obo__go."meta" IS 'The node''s or edge''s ''meta'' object — definition, synonyms, xrefs, basicPropertyValues, deprecated flag — serialized back to JSON text verbatim. Kept whole and unparsed, like the GTF attribute column: interpreting it is a transform concern. NULL where the file carries no meta for that node or edge.';
COMMENT ON COLUMN raw.obo__go."release_version" IS 'This ontology''s own version, read from graphs[0].meta.version in the file (a version IRI or a date, whichever the ontology publishes). Raw is replaced wholesale per value of this column, so more than one release can coexist, the same as raw.ensembl__gtf per ensembl_release.';
COMMENT ON COLUMN raw.obo__go."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW raw.obo__doid AS SELECT * FROM read_parquet('./raw/obo__doid.parquet');
COMMENT ON VIEW raw.obo__doid IS 'DOID landed verbatim from its OBO Graphs JSON release: one row per node and one row per edge, the WHOLE file — every imported class or property from another ontology included, not filtered to the DOID namespace. Filtering at land time would make raw a function of what ontology.term happens to derive today (ADR-0002); ontology.term''s node count matches this table''s node-row count exactly for that reason. Licence CC0-1.0.';
COMMENT ON COLUMN raw.obo__doid."kind" IS '''node'' or ''edge'': which half of the OBO Graphs JSON this row came from.';
COMMENT ON COLUMN raw.obo__doid."id" IS 'Node IRI. NULL on an edge row.';
COMMENT ON COLUMN raw.obo__doid."lbl" IS 'Node label (rdfs:label). NULL on an edge row, and on the node rows the file itself leaves unlabeled (imported classes mostly).';
COMMENT ON COLUMN raw.obo__doid."sub" IS 'Edge subject IRI. NULL on a node row.';
COMMENT ON COLUMN raw.obo__doid."pred" IS 'Edge predicate: ''is_a'' verbatim (the only relation OBO Graphs JSON ever states unqualified), otherwise the relation''s own IRI. NULL on a node row.';
COMMENT ON COLUMN raw.obo__doid."obj" IS 'Edge object IRI. NULL on a node row.';
COMMENT ON COLUMN raw.obo__doid."meta" IS 'The node''s or edge''s ''meta'' object — definition, synonyms, xrefs, basicPropertyValues, deprecated flag — serialized back to JSON text verbatim. Kept whole and unparsed, like the GTF attribute column: interpreting it is a transform concern. NULL where the file carries no meta for that node or edge.';
COMMENT ON COLUMN raw.obo__doid."release_version" IS 'This ontology''s own version, read from graphs[0].meta.version in the file (a version IRI or a date, whichever the ontology publishes). Raw is replaced wholesale per value of this column, so more than one release can coexist, the same as raw.ensembl__gtf per ensembl_release.';
COMMENT ON COLUMN raw.obo__doid."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW ontology.term AS SELECT * FROM read_parquet('./ontology/term.parquet');
COMMENT ON VIEW ontology.term IS 'Ontology terms, stacked across ontologies: one current row per (ontology, term_id), Type 2 on any attribute change. Includes every node the release file carries, imported classes included — see raw.obo__<ontology>.';
COMMENT ON COLUMN ontology.term."ontology" IS 'Short ontology name: cl, uberon, mondo, efo, hsapdv, mmusdv, go, doid. Part of the merge key, so one ontology''s re-ingest never retires another''s terms.';
COMMENT ON COLUMN ontology.term."term_id" IS 'CURIE, e.g. CL:0000624. Converted from the node''s IRI where it follows the OBO PURL convention (.../<PREFIX>_<NUMBER>); kept as the full IRI verbatim otherwise, which happens for terms imported from a namespace that does not follow that convention.';
COMMENT ON COLUMN ontology.term."name" IS 'rdfs:label. NULL for the handful of imported nodes the file itself leaves unlabeled.';
COMMENT ON COLUMN ontology.term."definition" IS 'Textual definition (IAO:0000115), where the ontology gives one.';
COMMENT ON COLUMN ontology.term."namespace" IS 'OBO namespace/aspect (oboInOwl:hasOBONamespace) — this is GO''s biological_process / molecular_function / cellular_component. NULL where the file does not tag it, which most CL/UBERON/MONDO terms do not.';
COMMENT ON COLUMN ontology.term."synonyms" IS 'Every oboInOwl synonym (exact, narrow, broad and related alike — the distinction between them is not kept), ''|''-joined into one string. NULL where the term has none.';
COMMENT ON COLUMN ontology.term."obsolete" IS 'True if the ontology marks this term deprecated. Obsolete terms are kept, never dropped — see replaced_by.';
COMMENT ON COLUMN ontology.term."replaced_by" IS 'CURIE of the successor term (IAO:0100001 ''term replaced by''), where the ontology names exactly one. NULL for a current term, or for an obsolete term the ontology leaves without a single successor — some only list ''consider'' candidates, which are not a replacement and are not carried here.';
COMMENT ON COLUMN ontology.term."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN ontology.term."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW ontology.relationship AS SELECT * FROM read_parquet('./ontology/relationship.parquet');
COMMENT ON VIEW ontology.relationship IS 'Edges between ontology terms: one row per (ontology, subject_id, predicate, object_id). The is_a closure (e.g. CL:0000624 -> CL:0000084 -> CL:0000000) is a recursive CTE over predicate = ''is_a'' here, not precomputed. An edge''s endpoints are not required to resolve to a row in ontology.term — no foreign key is enforced, matching every other table in this catalog.';
COMMENT ON COLUMN ontology.relationship."ontology" IS 'Short ontology name, same vocabulary as ontology.term.ontology. Part of the merge key.';
COMMENT ON COLUMN ontology.relationship."subject_id" IS 'CURIE of the subject term, same normalisation as ontology.term.term_id.';
COMMENT ON COLUMN ontology.relationship."predicate" IS '''is_a'' verbatim; a short name for the handful of BFO/RO relations common to every OBO ontology (part_of, has_part, develops_from, regulates, negatively_regulates, positively_regulates); the relation''s own CURIE for anything else. Nothing is invented: an unmapped relation is exactly the CURIE the file states, never guessed at.';
COMMENT ON COLUMN ontology.relationship."object_id" IS 'CURIE of the object term, same normalisation as ontology.term.term_id.';
COMMENT ON COLUMN ontology.relationship."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN ontology.relationship."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW raw.bedbase__bed AS SELECT * FROM read_parquet('./raw/bedbase__bed.parquet');
COMMENT ON VIEW raw.bedbase__bed IS 'BEDbase''s monthly `bedbase_metadata` Parquet snapshot (the index is api.bedbase.org/v1/exports) landed whole, one row per BED file record: its `bed` table joined with `bed_metadata`. The sample-level columns keep the `annotation_` prefix they had when this table was landed from the listing API. Per-file DETAIL (URIs, checksums, stats) is not in the snapshot and not here (issue #115). Replaced wholesale each ingest; the manifest records the snapshot''s date and sha256.';
COMMENT ON COLUMN raw.bedbase__bed."id" IS 'BEDbase''s own id for this BED file record, e.g. ''0000120fe8c5334bb0ce759dfcf06c3b''. Stable; carried downstream as resource_id.';
COMMENT ON COLUMN raw.bedbase__bed."name" IS 'Record name/title as BEDbase prints it.';
COMMENT ON COLUMN raw.bedbase__bed."description" IS 'Record description as BEDbase prints it. Frequently blank.';
COMMENT ON COLUMN raw.bedbase__bed."genome_alias" IS 'Free-text genome label as submitted, e.g. ''hg38''. NOT a reliable key: BEDbase''s 118 genome labels include mismatched and compound strings — an Arabidopsis (taxon 3702) record was found tagged ''hg18'' (verified live 2026-09-17). genome_digest is the key; this is a display label only.';
COMMENT ON COLUMN raw.bedbase__bed."genome_digest" IS 'Sequence-collection digest identifying the exact assembly. NULL for a meaningful share of records (~5% in a 500-record sample verified live 2026-09-17) where BEDbase could not resolve one. The reliable genome key when present; genome_alias never is.';
COMMENT ON COLUMN raw.bedbase__bed."bed_compliance" IS 'BED-standard compliance class BEDbase assigned, e.g. ''bed6+4''.';
COMMENT ON COLUMN raw.bedbase__bed."data_format" IS 'Upstream data format BEDbase detected, e.g. ''encode_narrowpeak_rs''.';
COMMENT ON COLUMN raw.bedbase__bed."compliant_columns" IS 'Columns conforming to the declared bed_compliance''s core spec.';
COMMENT ON COLUMN raw.bedbase__bed."non_compliant_columns" IS 'Columns beyond bed_compliance''s core spec.';
COMMENT ON COLUMN raw.bedbase__bed."is_universe" IS 'True for BEDbase''s small curated ''universe'' region sets, false for an ordinary submitted BED file.';
COMMENT ON COLUMN raw.bedbase__bed."license_id" IS 'Licence as a DUO (Data Use Ontology) code, e.g. ''DUO:0000042'' (general research use). Carried on every row: we reference these files, we do not redistribute them, so landing the licence is what makes that honest.';
COMMENT ON COLUMN raw.bedbase__bed."processed" IS 'Whether BEDbase''s bedstat/bedboss pipeline finished processing this record; false records may lack stats even at the full-detail endpoint.';
COMMENT ON COLUMN raw.bedbase__bed."submission_date" IS 'Timestamp this record was submitted, as the ISO 8601 UTC text BEDbase''s API prints, e.g. ''2025-05-22T12:02:50.145308Z''.';
COMMENT ON COLUMN raw.bedbase__bed."last_update_date" IS 'Timestamp this record last changed, same text form as submission_date.';
COMMENT ON COLUMN raw.bedbase__bed."annotation_organism" IS 'annotation.organism as BEDbase prints it, e.g. ''Homo sapiens''. Free text; annotation_species_id is the reliable taxon join.';
COMMENT ON COLUMN raw.bedbase__bed."annotation_species_id" IS 'annotation.species_id as BEDbase prints it — usually a single NCBI taxon id as text, e.g. ''9606'', but not always: a co-infection study was found carrying ''9606, 11676'' (verified live 2026-09-17). resource.bedbase__bedfile.taxon_id is a TRY_CAST of this column, NULL where it does not parse as one integer.';
COMMENT ON COLUMN raw.bedbase__bed."annotation_genotype" IS 'annotation.genotype as published.';
COMMENT ON COLUMN raw.bedbase__bed."annotation_phenotype" IS 'annotation.phenotype as published.';
COMMENT ON COLUMN raw.bedbase__bed."annotation_description" IS 'annotation.description from the listing API — distinct from the record''s own top-level `description` above. NULL since landing moved to the Parquet snapshot, which prints one `description` only.';
COMMENT ON COLUMN raw.bedbase__bed."annotation_cell_type" IS 'annotation.cell_type as published.';
COMMENT ON COLUMN raw.bedbase__bed."annotation_cell_line" IS 'annotation.cell_line as published.';
COMMENT ON COLUMN raw.bedbase__bed."annotation_tissue" IS 'annotation.tissue as published.';
COMMENT ON COLUMN raw.bedbase__bed."annotation_library_source" IS 'annotation.library_source as published, e.g. ''genomic''.';
COMMENT ON COLUMN raw.bedbase__bed."annotation_assay" IS 'Assay type, e.g. ''ATAC-seq'', ''DNase-seq'', ''PRO-cap''.';
COMMENT ON COLUMN raw.bedbase__bed."annotation_antibody" IS 'annotation.antibody as published.';
COMMENT ON COLUMN raw.bedbase__bed."annotation_target" IS 'annotation.target as published.';
COMMENT ON COLUMN raw.bedbase__bed."annotation_treatment" IS 'annotation.treatment as published.';
COMMENT ON COLUMN raw.bedbase__bed."annotation_global_sample_id" IS 'GEO/ENCODE sample ids, pipe-separated in one string as BEDbase''s list is joined, e.g. ''geo:gsm4837486''. Pipe-joined per the unsplit-list convention elsewhere in this catalog (ncbi__gene_info.synonyms); a join key into Milestone 3''s experimental metadata.';
COMMENT ON COLUMN raw.bedbase__bed."annotation_global_experiment_id" IS 'GEO/ENCODE experiment ids, pipe-separated, e.g. ''geo:gse159673''. Same convention as annotation_global_sample_id.';
COMMENT ON COLUMN raw.bedbase__bed."annotation_original_file_name" IS 'Original filename as submitted upstream, e.g. ''GSM4837486_Plasma_B2_T1.ATACseq.narrowPeak.gz''.';
COMMENT ON COLUMN raw.bedbase__bed."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
COMMENT ON COLUMN raw.bedbase__bed."header" IS 'The BED file''s own header lines, where it had any. NULL for most.';
COMMENT ON COLUMN raw.bedbase__bed."indexed" IS 'BEDbase''s `indexed` flag: whether the record is in its search index.';
COMMENT ON COLUMN raw.bedbase__bed."file_indexed" IS 'BEDbase''s `file_indexed` flag, as published.';
CREATE OR REPLACE VIEW raw.bedbase__bedset AS SELECT * FROM read_parquet('./raw/bedbase__bedset.parquet');
COMMENT ON VIEW raw.bedbase__bedset IS 'BEDbase''s monthly `bedbase_bedsets` Parquet snapshot landed whole, one row per bedset. Replaced wholesale each ingest; the manifest records the snapshot''s date and sha256.';
COMMENT ON COLUMN raw.bedbase__bedset."id" IS 'BEDbase''s own id for this bedset, e.g. ''gse33600'' — often a GEO series accession, but not guaranteed to be one.';
COMMENT ON COLUMN raw.bedbase__bedset."name" IS 'Bedset name as BEDbase prints it.';
COMMENT ON COLUMN raw.bedbase__bedset."md5sum" IS 'BEDbase''s own MD5 digest of the bedset''s metadata — not a digest of any file.';
COMMENT ON COLUMN raw.bedbase__bedset."submission_date" IS 'ISO 8601 UTC text as BEDbase''s API prints it, e.g. ''2025-06-05T12:03:43.962219Z''.';
COMMENT ON COLUMN raw.bedbase__bedset."last_update_date" IS 'ISO 8601 UTC text, same form as submission_date.';
COMMENT ON COLUMN raw.bedbase__bedset."description" IS 'Bedset description, Markdown text as BEDbase prints it.';
COMMENT ON COLUMN raw.bedbase__bedset."bedfile_count" IS 'Member BED files, per BEDbase''s own count. Membership itself is raw.bedbase__bedset_membership.';
COMMENT ON COLUMN raw.bedbase__bedset."author" IS 'Curator/submitter name as published.';
COMMENT ON COLUMN raw.bedbase__bedset."bedset_source" IS 'BEDbase''s own ''source'' field on a bedset, e.g. ''gse33600'' (frequently identical to `id`). Renamed from upstream''s `source` here and on resource.bedbase__bedset because `source` elsewhere in this catalog names the asserting annotation provider — the same rename BugSigDB''s `source_in_paper` makes, and for the same reason.';
COMMENT ON COLUMN raw.bedbase__bedset."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
COMMENT ON COLUMN raw.bedbase__bedset."summary" IS 'Plain-text summary of the bedset, usually the GEO series summary.';
COMMENT ON COLUMN raw.bedbase__bedset."bedset_means" IS 'JSON object, as published: the mean of each bedstat statistic over the member files, e.g. ''{"number_of_regions": 4363.0, ...}''.';
COMMENT ON COLUMN raw.bedbase__bedset."bedset_standard_deviation" IS 'JSON object, as published: the standard deviation of each bedstat statistic over the member files.';
COMMENT ON COLUMN raw.bedbase__bedset."bedset_stats" IS 'BEDbase''s `bedset_stats`, as published. NULL on every row of the 2026-09-01 snapshot.';
COMMENT ON COLUMN raw.bedbase__bedset."processed" IS 'Whether BEDbase''s pipeline finished processing this bedset.';
CREATE OR REPLACE VIEW raw.bedbase__bedset_membership AS SELECT * FROM read_parquet('./raw/bedbase__bedset_membership.parquet');
COMMENT ON VIEW raw.bedbase__bedset_membership IS 'BEDbase''s monthly `bedbase_bedset_membership` Parquet snapshot landed whole: one row per (bedset, member BED file). The joinable, versioned form is resource.resource_relationship, relationship = ''member_of_bedset''.';
COMMENT ON COLUMN raw.bedbase__bedset_membership."bedset_id" IS 'raw.bedbase__bedset.id.';
COMMENT ON COLUMN raw.bedbase__bedset_membership."bedfile_id" IS 'raw.bedbase__bed.id. A file can belong to several bedsets.';
COMMENT ON COLUMN raw.bedbase__bedset_membership."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW resource.bedbase__bedfile AS SELECT * FROM read_parquet('./resource/bedbase__bedfile.parquet');
COMMENT ON VIEW resource.bedbase__bedfile IS 'One row per BEDbase BED file, Type 2 by resource_id: title, genome, organism/assay-level annotation and licence, from BEDbase''s monthly Parquet snapshot. Objects are REFERENCED here, never ingested: size, checksum and the http/s3/bigbed URIs live at /v1/bed/{id}/metadata?full=true, one request per record (663,721 of them), deferred to a follow-up (issue #115) and to be added by schema evolution when they land — a column that is always NULL advertises a capability this table does not yet have. Key genomes on genome_digest, never genome_alias — see that column''s doc. license_id (a DUO code) is carried on every row because we reference these files rather than redistribute them.';
COMMENT ON COLUMN resource.bedbase__bedfile."resource_id" IS 'BEDbase''s bed id (raw.bedbase__bed.id). Business key — one live row per file, Type 2 on any attribute change.';
COMMENT ON COLUMN resource.bedbase__bedfile."title" IS 'Record name/title, from raw.bedbase__bed.name.';
COMMENT ON COLUMN resource.bedbase__bedfile."description" IS 'Record description, from raw.bedbase__bed.description.';
COMMENT ON COLUMN resource.bedbase__bedfile."genome_digest" IS 'Sequence-collection digest of the assembly this file''s regions are called against — the reliable genome key; NULL where BEDbase could not resolve one. Joins to reference.genome once we compute sequence-collection digests for our own assemblies (currently keyed by INSDC accession only).';
COMMENT ON COLUMN resource.bedbase__bedfile."genome_alias" IS 'Free-text genome label, display only — never a join key. See raw.bedbase__bed.genome_alias for how messy this gets.';
COMMENT ON COLUMN resource.bedbase__bedfile."taxon_id" IS 'NCBI taxon id, a TRY_CAST of raw.bedbase__bed.annotation_species_id; NULL where that text does not parse as a single integer (a co-infection study carrying more than one id as free text is the known case — see that column''s doc).';
COMMENT ON COLUMN resource.bedbase__bedfile."organism" IS 'Free-text organism name as BEDbase prints it; taxon_id is the reliable join.';
COMMENT ON COLUMN resource.bedbase__bedfile."assay" IS 'Assay type, e.g. ''ATAC-seq'', ''DNase-seq''.';
COMMENT ON COLUMN resource.bedbase__bedfile."target" IS 'ChIP/CUT&RUN target, where applicable.';
COMMENT ON COLUMN resource.bedbase__bedfile."antibody" IS 'Antibody used, where applicable.';
COMMENT ON COLUMN resource.bedbase__bedfile."cell_type" IS 'Cell type sampled.';
COMMENT ON COLUMN resource.bedbase__bedfile."cell_line" IS 'Cell line sampled, where applicable.';
COMMENT ON COLUMN resource.bedbase__bedfile."tissue" IS 'Tissue sampled.';
COMMENT ON COLUMN resource.bedbase__bedfile."treatment" IS 'Treatment applied to the sample, free text.';
COMMENT ON COLUMN resource.bedbase__bedfile."sample_id" IS 'GEO/ENCODE sample ids, sorted list, e.g. [''geo:gsm4837486'']. The joinable form is resource.resource_relationship (derived_from_sample); a join key into Milestone 3''s experimental metadata.';
COMMENT ON COLUMN resource.bedbase__bedfile."experiment_id" IS 'GEO/ENCODE experiment ids, sorted list, e.g. [''geo:gse159673'']. Joinable form: resource.resource_relationship (derived_from_experiment).';
COMMENT ON COLUMN resource.bedbase__bedfile."compliance" IS 'BED-standard compliance class, e.g. ''bed6+4''.';
COMMENT ON COLUMN resource.bedbase__bedfile."format" IS 'Upstream data format BEDbase detected.';
COMMENT ON COLUMN resource.bedbase__bedfile."license_id" IS 'Licence as a DUO code, carried on every row — we reference this file, we do not redistribute it, and this is what makes that honest. See raw.bedbase__bed.license_id.';
COMMENT ON COLUMN resource.bedbase__bedfile."provider" IS 'Constant ''BEDbase'': the catalog this resource entry was read from, per SPEC''s Resource Metadata Layer.';
COMMENT ON COLUMN resource.bedbase__bedfile."submitted" IS 'Submission timestamp, ISO 8601 text as published.';
COMMENT ON COLUMN resource.bedbase__bedfile."updated" IS 'Last-update timestamp, ISO 8601 text as published.';
COMMENT ON COLUMN resource.bedbase__bedfile."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN resource.bedbase__bedfile."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW resource.bedbase__bedset AS SELECT * FROM read_parquet('./resource/bedbase__bedset.parquet');
COMMENT ON VIEW resource.bedbase__bedset IS 'One row per BEDbase bedset, Type 2 by resource_id, from BEDbase''s monthly Parquet snapshot. Membership (which BED files belong to a bedset) is resource.resource_relationship: resource_id = the BED file, relationship = ''member_of_bedset'', target_id = this table''s resource_id.';
COMMENT ON COLUMN resource.bedbase__bedset."resource_id" IS 'BEDbase''s bedset id (raw.bedbase__bedset.id). Business key — one live row per bedset, Type 2 on any attribute change.';
COMMENT ON COLUMN resource.bedbase__bedset."title" IS 'Bedset name, from raw.bedbase__bedset.name.';
COMMENT ON COLUMN resource.bedbase__bedset."description" IS 'Bedset description, Markdown text as published.';
COMMENT ON COLUMN resource.bedbase__bedset."bedfile_count" IS 'Member BED files, per BEDbase''s own count.';
COMMENT ON COLUMN resource.bedbase__bedset."author" IS 'Curator/submitter name as published.';
COMMENT ON COLUMN resource.bedbase__bedset."bedset_source" IS 'BEDbase''s own ''source'' field on this bedset — see raw.bedbase__bedset.bedset_source for the rename.';
COMMENT ON COLUMN resource.bedbase__bedset."provider" IS 'Constant ''BEDbase'': the catalog this resource entry was read from, per SPEC''s Resource Metadata Layer.';
COMMENT ON COLUMN resource.bedbase__bedset."submitted" IS 'Submission timestamp, ISO 8601 text as published.';
COMMENT ON COLUMN resource.bedbase__bedset."updated" IS 'Last-update timestamp, ISO 8601 text as published.';
COMMENT ON COLUMN resource.bedbase__bedset."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN resource.bedbase__bedset."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW annotation.icite__citation AS SELECT * FROM read_parquet('./annotation/icite__citation.parquet');
COMMENT ON VIEW annotation.icite__citation IS 'The PubMed citation graph as iCite publishes it: one row per (citing, cited) pair: the NIH Open Citation Collection exactly, via the references lists in raw.icite__metadata (928,458,585 edges in the 2026-08 snapshot, equal to the OCC file). An edge has no attributes, so it is only ever asserted or withdrawn: valid_from is the release it appeared in, valid_to the release it vanished. ''Who cites X'' is WHERE cited_pmid = X AND valid_to IS NULL. Source: NIH iCite / NIH-OCC, CC BY 4.0.';
COMMENT ON COLUMN annotation.icite__citation."citing_pmid" IS 'PubMed id of the paper that cites. Part of the merge key.';
COMMENT ON COLUMN annotation.icite__citation."cited_pmid" IS 'PubMed id of the paper cited. Part of the merge key.';
COMMENT ON COLUMN annotation.icite__citation."shard" IS 'cited_pmid modulo 16: the unit this table is merged and partitioned in, so ~930M edges never sit in memory at once. Implementation detail, safe to ignore; it exists so the table''s write path is honest.';
COMMENT ON COLUMN annotation.icite__citation."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN annotation.icite__citation."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW raw.pubtator3__gene AS SELECT * FROM read_parquet('./raw/pubtator3__gene.parquet');
COMMENT ON VIEW raw.pubtator3__gene IS 'PubTator3''s gene2pubtator3.gz landed verbatim and whole: one row per (PMID, concept) the dump carries, five headerless tab-separated columns. Holds the LATEST dump only — upstream regenerates the file in place about monthly and archives none. Query annotation.pubtator3__mention instead; read this for the mention strings, which are deliberately not derived. NCBI public domain (US Government Work, per the directory README); cite Wei et al. 2024, PubTator 3.0.';
COMMENT ON COLUMN raw.pubtator3__gene."pmid" IS 'PubMed id, as text as upstream prints it.';
COMMENT ON COLUMN raw.pubtator3__gene."type" IS 'Entity type. ''Gene'' on every row of this file.';
COMMENT ON COLUMN raw.pubtator3__gene."concept_id" IS 'Normalised identifier, verbatim: an NCBI Gene id, ''MESH:D…'', an NCBI Taxonomy id, an rs id or a structured ''tmVar:…;HGVS:…'' string. '';''-joined where one mention resolves to several ids. A literal ''-'' is upstream''s own value for ''recognised but not normalised'' (10.7M chemical rows) and is kept as text, not read as NULL.';
COMMENT ON COLUMN raw.pubtator3__gene."mentions" IS 'The surface strings found in the paper for this concept, ''|''-joined, as the tagger saw them (case variants, stray punctuation and quotes included). NULL where upstream leaves it empty: rows asserted by a curated resource with no text hit.';
COMMENT ON COLUMN raw.pubtator3__gene."resource" IS 'Who asserts the row, ''|''-joined in no stable order: ''PubTator3'' for a text-mined hit, otherwise the curated source it was taken from (MESH, gene2pubmed, generifs_basic, CTD, BioGRID, ClinVar, dbSNP, RGD, …).';
COMMENT ON COLUMN raw.pubtator3__gene."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW raw.pubtator3__disease AS SELECT * FROM read_parquet('./raw/pubtator3__disease.parquet');
COMMENT ON VIEW raw.pubtator3__disease IS 'PubTator3''s disease2pubtator3.gz landed verbatim and whole: one row per (PMID, concept) the dump carries, five headerless tab-separated columns. Holds the LATEST dump only — upstream regenerates the file in place about monthly and archives none. Query annotation.pubtator3__mention instead; read this for the mention strings, which are deliberately not derived. NCBI public domain (US Government Work, per the directory README); cite Wei et al. 2024, PubTator 3.0.';
COMMENT ON COLUMN raw.pubtator3__disease."pmid" IS 'PubMed id, as text as upstream prints it.';
COMMENT ON COLUMN raw.pubtator3__disease."type" IS 'Entity type. ''Disease'' on every row of this file.';
COMMENT ON COLUMN raw.pubtator3__disease."concept_id" IS 'Normalised identifier, verbatim: an NCBI Gene id, ''MESH:D…'', an NCBI Taxonomy id, an rs id or a structured ''tmVar:…;HGVS:…'' string. '';''-joined where one mention resolves to several ids. A literal ''-'' is upstream''s own value for ''recognised but not normalised'' (10.7M chemical rows) and is kept as text, not read as NULL.';
COMMENT ON COLUMN raw.pubtator3__disease."mentions" IS 'The surface strings found in the paper for this concept, ''|''-joined, as the tagger saw them (case variants, stray punctuation and quotes included). NULL where upstream leaves it empty: rows asserted by a curated resource with no text hit.';
COMMENT ON COLUMN raw.pubtator3__disease."resource" IS 'Who asserts the row, ''|''-joined in no stable order: ''PubTator3'' for a text-mined hit, otherwise the curated source it was taken from (MESH, gene2pubmed, generifs_basic, CTD, BioGRID, ClinVar, dbSNP, RGD, …).';
COMMENT ON COLUMN raw.pubtator3__disease."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW raw.pubtator3__chemical AS SELECT * FROM read_parquet('./raw/pubtator3__chemical.parquet');
COMMENT ON VIEW raw.pubtator3__chemical IS 'PubTator3''s chemical2pubtator3.gz landed verbatim and whole: one row per (PMID, concept) the dump carries, five headerless tab-separated columns. Holds the LATEST dump only — upstream regenerates the file in place about monthly and archives none. Query annotation.pubtator3__mention instead; read this for the mention strings, which are deliberately not derived. NCBI public domain (US Government Work, per the directory README); cite Wei et al. 2024, PubTator 3.0.';
COMMENT ON COLUMN raw.pubtator3__chemical."pmid" IS 'PubMed id, as text as upstream prints it.';
COMMENT ON COLUMN raw.pubtator3__chemical."type" IS 'Entity type. ''Chemical'' on every row of this file.';
COMMENT ON COLUMN raw.pubtator3__chemical."concept_id" IS 'Normalised identifier, verbatim: an NCBI Gene id, ''MESH:D…'', an NCBI Taxonomy id, an rs id or a structured ''tmVar:…;HGVS:…'' string. '';''-joined where one mention resolves to several ids. A literal ''-'' is upstream''s own value for ''recognised but not normalised'' (10.7M chemical rows) and is kept as text, not read as NULL.';
COMMENT ON COLUMN raw.pubtator3__chemical."mentions" IS 'The surface strings found in the paper for this concept, ''|''-joined, as the tagger saw them (case variants, stray punctuation and quotes included). NULL where upstream leaves it empty: rows asserted by a curated resource with no text hit.';
COMMENT ON COLUMN raw.pubtator3__chemical."resource" IS 'Who asserts the row, ''|''-joined in no stable order: ''PubTator3'' for a text-mined hit, otherwise the curated source it was taken from (MESH, gene2pubmed, generifs_basic, CTD, BioGRID, ClinVar, dbSNP, RGD, …).';
COMMENT ON COLUMN raw.pubtator3__chemical."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW raw.pubtator3__species AS SELECT * FROM read_parquet('./raw/pubtator3__species.parquet');
COMMENT ON VIEW raw.pubtator3__species IS 'PubTator3''s species2pubtator3.gz landed verbatim and whole: one row per (PMID, concept) the dump carries, five headerless tab-separated columns. Holds the LATEST dump only — upstream regenerates the file in place about monthly and archives none. Query annotation.pubtator3__mention instead; read this for the mention strings, which are deliberately not derived. NCBI public domain (US Government Work, per the directory README); cite Wei et al. 2024, PubTator 3.0.';
COMMENT ON COLUMN raw.pubtator3__species."pmid" IS 'PubMed id, as text as upstream prints it.';
COMMENT ON COLUMN raw.pubtator3__species."type" IS 'Entity type. ''Species'' on every row of this file.';
COMMENT ON COLUMN raw.pubtator3__species."concept_id" IS 'Normalised identifier, verbatim: an NCBI Gene id, ''MESH:D…'', an NCBI Taxonomy id, an rs id or a structured ''tmVar:…;HGVS:…'' string. '';''-joined where one mention resolves to several ids. A literal ''-'' is upstream''s own value for ''recognised but not normalised'' (10.7M chemical rows) and is kept as text, not read as NULL.';
COMMENT ON COLUMN raw.pubtator3__species."mentions" IS 'The surface strings found in the paper for this concept, ''|''-joined, as the tagger saw them (case variants, stray punctuation and quotes included). NULL where upstream leaves it empty: rows asserted by a curated resource with no text hit.';
COMMENT ON COLUMN raw.pubtator3__species."resource" IS 'Who asserts the row, ''|''-joined in no stable order: ''PubTator3'' for a text-mined hit, otherwise the curated source it was taken from (MESH, gene2pubmed, generifs_basic, CTD, BioGRID, ClinVar, dbSNP, RGD, …).';
COMMENT ON COLUMN raw.pubtator3__species."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW raw.pubtator3__mutation AS SELECT * FROM read_parquet('./raw/pubtator3__mutation.parquet');
COMMENT ON VIEW raw.pubtator3__mutation IS 'PubTator3''s mutation2pubtator3.gz landed verbatim and whole: one row per (PMID, concept) the dump carries, five headerless tab-separated columns. Holds the LATEST dump only — upstream regenerates the file in place about monthly and archives none. Query annotation.pubtator3__mention instead; read this for the mention strings, which are deliberately not derived. NCBI public domain (US Government Work, per the directory README); cite Wei et al. 2024, PubTator 3.0.';
COMMENT ON COLUMN raw.pubtator3__mutation."pmid" IS 'PubMed id, as text as upstream prints it.';
COMMENT ON COLUMN raw.pubtator3__mutation."type" IS 'Entity type. ''Mutation'' on every row of this file.';
COMMENT ON COLUMN raw.pubtator3__mutation."concept_id" IS 'Normalised identifier, verbatim: an NCBI Gene id, ''MESH:D…'', an NCBI Taxonomy id, an rs id or a structured ''tmVar:…;HGVS:…'' string. '';''-joined where one mention resolves to several ids. A literal ''-'' is upstream''s own value for ''recognised but not normalised'' (10.7M chemical rows) and is kept as text, not read as NULL.';
COMMENT ON COLUMN raw.pubtator3__mutation."mentions" IS 'The surface strings found in the paper for this concept, ''|''-joined, as the tagger saw them (case variants, stray punctuation and quotes included). NULL where upstream leaves it empty: rows asserted by a curated resource with no text hit.';
COMMENT ON COLUMN raw.pubtator3__mutation."resource" IS 'Who asserts the row, ''|''-joined in no stable order: ''PubTator3'' for a text-mined hit, otherwise the curated source it was taken from (MESH, gene2pubmed, generifs_basic, CTD, BioGRID, ClinVar, dbSNP, RGD, …).';
COMMENT ON COLUMN raw.pubtator3__mutation."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW annotation.pubtator3__mention AS SELECT * FROM read_parquet('./annotation/pubtator3__mention.parquet');
COMMENT ON VIEW annotation.pubtator3__mention IS 'Which genes, diseases, chemicals, species and variants each PubMed paper mentions, per PubTator3 (NCBI''s text mining over all of PubMed and PMC open access) and the curated sources it folds in: one row per (paper, concept, asserting resource). Machine annotation — expect false positives, far broader than ncbi__gene_pubmed. No attributes, so a row is only ever asserted or withdrawn. Not derived: rows PubTator3 could not normalise (concept id ''-''), and the mention strings, which churn between dumps; both stay in raw.pubtator3__*. ''Papers about TP53'' is WHERE concept_type = ''Gene'' AND concept_id = ''7157'' AND valid_to IS NULL. NCBI public domain.';
COMMENT ON COLUMN annotation.pubtator3__mention."pmid" IS 'PubMed id of the paper; joins to annotation.icite__publication.pmid and both ends of annotation.icite__citation. Part of the merge key.';
COMMENT ON COLUMN annotation.pubtator3__mention."concept_type" IS '''Gene'', ''Disease'', ''Chemical'', ''Species'' or ''Mutation'', as upstream spells it. In the key because id spaces overlap: ''9606'' is a taxon under Species and a gene under Gene. Part of the merge key.';
COMMENT ON COLUMN annotation.pubtator3__mention."concept_id" IS 'One identifier per row. Gene: NCBI Gene id (joins to annotation.ncbi__gene.gene_id). Species: NCBI Taxonomy id. Disease and Chemical: ''MESH:D…''/''MESH:C…'' (a few OMIM). Mutation: an rs id, or tmVar''s structured string kept whole — its ''VariantGroup:n'' part numbers variants within one paper and is not an identifier. Upstream''s '';''-joined multi-id values are split, except under Mutation where '';'' is part of the id. Part of the merge key.';
COMMENT ON COLUMN annotation.pubtator3__mention."resource" IS 'Who asserts the link, one per row: ''PubTator3'' for a text-mined hit, otherwise a curated source (MESH, gene2pubmed, generifs_basic, CTD, BioGRID, ClinVar, dbSNP, …). Filter resource <> ''PubTator3'' for curated links only. Part of the merge key.';
COMMENT ON COLUMN annotation.pubtator3__mention."shard" IS 'pmid modulo 16: the unit this table is merged and partitioned in, so ~460M rows never sit in one merge. Implementation detail, safe to ignore.';
COMMENT ON COLUMN annotation.pubtator3__mention."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN annotation.pubtator3__mention."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW resource.resource_relationship AS SELECT * FROM read_parquet('./resource/resource_relationship.parquet');
COMMENT ON VIEW resource.resource_relationship IS 'SPEC.md''s resource_relationship: one row per (resource, relationship, target). The joinable form of every multi-valued field on a resource catalog row — the ''which datasets have cell type X in tissue Y'' question is a join here, and an ontology rollup is a join through ontology.relationship. A relationship has no attributes, so a row is only ever asserted or withdrawn.';
COMMENT ON COLUMN resource.resource_relationship."resource_id" IS 'The resource this row is about: resource.cellxgene__dataset.dataset_version_id, resource.bedbase__bedfile.resource_id, ... Part of the merge key.';
COMMENT ON COLUMN resource.resource_relationship."relationship" IS 'What the target is to the resource: has_assay, has_tissue, has_disease, has_cell_type (CELLxGENE; eQTL Catalogue the last two; targets are ontology term ids); derived_from_sample, derived_from_experiment (BEDbase, targets are ''geo:gsm…''-style accessions); member_of_bedset (BEDbase, target is resource.bedbase__bedset.resource_id); part_of_dataset, has_biosample, has_target_gene (ENCODE, targets are ''encode:ENCSR…'', an ontology term id, ''ncbigene:<Entrez id>''). Part of the merge key.';
COMMENT ON COLUMN resource.resource_relationship."target_id" IS 'The related thing, as a CURIE or accession: joins to ontology.term.term_id when it is an ontology term, and through ontology.relationship for rollups. Part of the merge key.';
COMMENT ON COLUMN resource.resource_relationship."source" IS 'The writer that asserted this row (''cellxgene'', ''bedbase'', ''eqtlcatalogue'', ''encode''): its merge scope, so one catalog''s re-ingest never retires another''s rows (ADR-0004). Part of the merge key.';
COMMENT ON COLUMN resource.resource_relationship."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN resource.resource_relationship."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW raw.encode__experiment AS SELECT * FROM read_parquet('./raw/encode__experiment.parquet');
COMMENT ON VIEW raw.encode__experiment IS 'The ENCODE portal''s Experiment inventory landed verbatim from report.tsv: one row per experiment, every status, every assay and organism. All text; list-valued fields are '',''-joined as the portal writes them. The columns are the explicit field list encode.EXPERIMENT_FIELDS, a declared subset of the Experiment object. Holds the LATEST crawl only, as raw.cellxgene__dataset does. ENCODE data are free of use restrictions; the ENCODE Consortium asks to be cited: https://www.encodeproject.org/help/citing-encode/';
COMMENT ON COLUMN raw.encode__experiment."accession" IS 'ENCODE experiment accession, e.g. ''ENCSR000AKS''. Experiments share the ENCSR prefix with every other dataset type (annotations, references, series).';
COMMENT ON COLUMN raw.encode__experiment."uuid" IS 'The portal''s internal UUID for the object.';
COMMENT ON COLUMN raw.encode__experiment."status" IS '''released'', ''archived'' or ''revoked'' — everything an anonymous request can see. Landed whole: not filtered to released.';
COMMENT ON COLUMN raw.encode__experiment."date_created" IS 'ISO 8601 timestamp the object was created on the portal.';
COMMENT ON COLUMN raw.encode__experiment."date_submitted" IS 'YYYY-MM-DD the lab submitted the experiment. NULL where never recorded.';
COMMENT ON COLUMN raw.encode__experiment."date_released" IS 'YYYY-MM-DD of public release.';
COMMENT ON COLUMN raw.encode__experiment."description" IS 'Submitter''s free-text description. Whitespace runs are collapsed to one space by the portal''s TSV writer; quote characters are literal.';
COMMENT ON COLUMN raw.encode__experiment."assay_term_id" IS 'Assay ontology id, e.g. ''OBI:0000716'' (ChIP-seq); ''NTR:…'' is an ENCODE new-term-request placeholder, not a published term.';
COMMENT ON COLUMN raw.encode__experiment."assay_term_name" IS 'Assay ontology label, e.g. ''ChIP-seq''.';
COMMENT ON COLUMN raw.encode__experiment."assay_title" IS 'ENCODE''s display refinement of the assay, e.g. ''TF ChIP-seq'', ''Histone ChIP-seq''.';
COMMENT ON COLUMN raw.encode__experiment."assay_slims" IS 'Assay category slims, '',''-joined, e.g. ''DNA binding''.';
COMMENT ON COLUMN raw.encode__experiment."biosample_ontology_term_id" IS 'Biosample type as an ontology CURIE: UBERON (tissue), CL (cell type), EFO or CLO (cell line), or an ''NTR:'' placeholder.';
COMMENT ON COLUMN raw.encode__experiment."biosample_ontology_term_name" IS 'Label of biosample_ontology_term_id, e.g. ''K562'', ''liver''.';
COMMENT ON COLUMN raw.encode__experiment."biosample_ontology_classification" IS '''tissue'', ''cell line'', ''primary cell'', ''in vitro differentiated cells'', ''organoid'', ''whole organisms'', ...';
COMMENT ON COLUMN raw.encode__experiment."biosample_ontology_organ_slims" IS 'Organ slims of the biosample term, '',''-joined.';
COMMENT ON COLUMN raw.encode__experiment."biosample_ontology_cell_slims" IS 'Cell slims of the biosample term, '',''-joined.';
COMMENT ON COLUMN raw.encode__experiment."biosample_summary" IS 'ENCODE''s generated one-line biosample description, including organism, treatments and modifications.';
COMMENT ON COLUMN raw.encode__experiment."replicates_library_biosample_organism_scientific_name" IS 'Organism of the replicates'' biosamples, e.g. ''Homo sapiens''; '',''-joined if replicates differ. NULL for the experiments with no replicate.';
COMMENT ON COLUMN raw.encode__experiment."replicates_library_biosample_organism_taxon_id" IS 'NCBI taxonomy id of the same, as text; '',''-joined if replicates differ.';
COMMENT ON COLUMN raw.encode__experiment."target_name" IS 'Target as ENCODE names it, ''<label>-<organism>'', e.g. ''CTCF-human''. NULL for assays without a target.';
COMMENT ON COLUMN raw.encode__experiment."target_label" IS 'Target label, e.g. ''CTCF'', ''H3K27ac''.';
COMMENT ON COLUMN raw.encode__experiment."target_investigated_as" IS 'Target categories, '',''-joined, e.g. ''histone,narrow histone mark''.';
COMMENT ON COLUMN raw.encode__experiment."target_genes_geneid" IS 'Entrez GeneIDs of the target''s genes, '',''-joined — three for a histone mark. NULL where the target has no gene (a synthetic tag, say).';
COMMENT ON COLUMN raw.encode__experiment."target_genes_symbol" IS 'Symbols of the same genes, '',''-joined, in the same order.';
COMMENT ON COLUMN raw.encode__experiment."control_type" IS 'Set on control experiments, e.g. ''input library''. NULL otherwise.';
COMMENT ON COLUMN raw.encode__experiment."perturbed" IS '''True'' or ''False'': whether the biosample was treated or genetically modified.';
COMMENT ON COLUMN raw.encode__experiment."lab_title" IS 'Submitting lab, e.g. ''Michael Snyder, Stanford''.';
COMMENT ON COLUMN raw.encode__experiment."award_name" IS 'Grant number, e.g. ''U54HG006996''.';
COMMENT ON COLUMN raw.encode__experiment."award_project" IS 'Funding project: ''ENCODE'', ''Roadmap'', ''modENCODE'', ''modERN'', ''GGR'', ...';
COMMENT ON COLUMN raw.encode__experiment."award_rfa" IS 'Project phase, e.g. ''ENCODE4''.';
COMMENT ON COLUMN raw.encode__experiment."assembly" IS 'Assembly labels of the experiment''s processed files, '',''-joined, as the portal spells them (''GRCh38'', ''hg19'', ''mm10-minimal'').';
COMMENT ON COLUMN raw.encode__experiment."replication_type" IS '''isogenic'', ''anisogenic'', ''unreplicated'', ...';
COMMENT ON COLUMN raw.encode__experiment."bio_replicate_count" IS 'Number of biological replicates, as text.';
COMMENT ON COLUMN raw.encode__experiment."tech_replicate_count" IS 'Number of technical replicates, as text.';
COMMENT ON COLUMN raw.encode__experiment."dbxrefs" IS 'External cross-references, '',''-joined CURIE-like strings, e.g. ''GEO:GSE30263''.';
COMMENT ON COLUMN raw.encode__experiment."doi" IS 'The experiment''s DOI, e.g. ''10.17989/ENCSR000AKS''.';
COMMENT ON COLUMN raw.encode__experiment."internal_tags" IS 'ENCODE collection tags, '',''-joined, e.g. ''ENCYCLOPEDIAv5''.';
COMMENT ON COLUMN raw.encode__experiment."alternate_accessions" IS 'Accessions merged into this one, '',''-joined.';
COMMENT ON COLUMN raw.encode__experiment."supersedes" IS 'Object paths of the experiments this one replaces, '',''-joined.';
COMMENT ON COLUMN raw.encode__experiment."superseded_by" IS 'Object paths of the experiments that replace this one, '',''-joined.';
COMMENT ON COLUMN raw.encode__experiment."possible_controls" IS 'Object paths of this experiment''s control experiments, '',''-joined.';
COMMENT ON COLUMN raw.encode__experiment."retrieval_date" IS 'UTC date this report was downloaded, YYYY-MM-DD. The source''s own version: the portal is a live inventory with no release number.';
COMMENT ON COLUMN raw.encode__experiment."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW raw.encode__file AS SELECT * FROM read_parquet('./raw/encode__file.parquet');
COMMENT ON VIEW raw.encode__file IS 'The ENCODE portal''s File inventory landed verbatim from report.tsv: one row per file, every status, format and dataset type. Metadata only — the files themselves stay in ENCODE''s public bucket. All text; list-valued fields are '',''-joined as the portal writes them. The columns are the explicit field list encode.FILE_FIELDS. Holds the LATEST crawl only. ENCODE data are free of use restrictions; the ENCODE Consortium asks to be cited: https://www.encodeproject.org/help/citing-encode/';
COMMENT ON COLUMN raw.encode__file."accession" IS 'ENCODE file accession, e.g. ''ENCFF002FAS''. NULL for the 1,283 files (2026-09-18) that have only an external_accession.';
COMMENT ON COLUMN raw.encode__file."external_accession" IS 'Another archive''s accession or a name, for a file ENCODE gave no accession: SRA runs (''SRR1270455''), named reference files (''GRCh38_EBV.chrom.sizes''). NULL otherwise.';
COMMENT ON COLUMN raw.encode__file."title" IS 'accession, or external_accession where there is none: what the portal keys the file by (''/files/<title>/''). Never NULL.';
COMMENT ON COLUMN raw.encode__file."uuid" IS 'The portal''s internal UUID for the object.';
COMMENT ON COLUMN raw.encode__file."status" IS '''released'', ''archived'' or ''revoked''. Landed whole: not filtered to released.';
COMMENT ON COLUMN raw.encode__file."dataset" IS 'Object path of the dataset the file belongs to: ''/experiments/ENCSR…/'', ''/annotations/ENCSR…/'', ''/references/ENCSR…/'', ... Only the first kind is in raw.encode__experiment.';
COMMENT ON COLUMN raw.encode__file."file_format" IS '''bed'', ''bigWig'', ''fastq'', ''bam'', ''bigBed'', ''tsv'', ''tar'', ...';
COMMENT ON COLUMN raw.encode__file."file_format_type" IS 'Sub-format, mostly for bed/bigBed: ''narrowPeak'', ''bed3+'', ''idr_thresholded_peak'', ...';
COMMENT ON COLUMN raw.encode__file."file_type" IS 'file_format and file_format_type together, e.g. ''bed narrowPeak''.';
COMMENT ON COLUMN raw.encode__file."output_type" IS 'What the file holds, e.g. ''reads'', ''alignments'', ''IDR thresholded peaks''.';
COMMENT ON COLUMN raw.encode__file."output_category" IS 'Coarse class of output_type: ''raw data'', ''alignment'', ''signal'', ''annotation'', ...';
COMMENT ON COLUMN raw.encode__file."assembly" IS 'Genome assembly label as the portal spells it: ''GRCh38'', ''hg19'', ''mm10'', ''mm10-minimal'', ''dm6'', ''ce11'', ... NULL for unaligned data. A label, not an assembly key.';
COMMENT ON COLUMN raw.encode__file."genome_annotation" IS 'Gene annotation version used, e.g. ''V29'' (GENCODE), ''M21''. NULL where none.';
COMMENT ON COLUMN raw.encode__file."file_size" IS 'Size in bytes, as text.';
COMMENT ON COLUMN raw.encode__file."md5sum" IS 'MD5 of the file as stored (compressed, where it is).';
COMMENT ON COLUMN raw.encode__file."content_md5sum" IS 'MD5 of the uncompressed content, where the portal computed one.';
COMMENT ON COLUMN raw.encode__file."href" IS 'Download path relative to https://www.encodeproject.org, ''/files/<acc>/@@download/<acc>.<ext>''; it redirects to cloud_metadata_url.';
COMMENT ON COLUMN raw.encode__file."cloud_metadata_url" IS 'Direct HTTPS URL of the object in the public encode-public S3 bucket.';
COMMENT ON COLUMN raw.encode__file."s3_uri" IS 'The same object as an s3:// URI.';
COMMENT ON COLUMN raw.encode__file."no_file_available" IS '''True'' where ENCODE holds metadata for a file it does not host.';
COMMENT ON COLUMN raw.encode__file."restricted" IS '''True'' where the file is access-restricted (no public URL). NULL is unrestricted.';
COMMENT ON COLUMN raw.encode__file."derived_from" IS 'Object paths of the files this one was computed from, '',''-joined. Mostly ''/files/ENCFF…/'', occasionally a named reference file.';
COMMENT ON COLUMN raw.encode__file."biological_replicates" IS 'Biological replicate numbers the file covers, '',''-joined.';
COMMENT ON COLUMN raw.encode__file."technical_replicates" IS 'Technical replicates as ''<bio>_<tech>'', '',''-joined.';
COMMENT ON COLUMN raw.encode__file."preferred_default" IS '''True'' where ENCODE marks the file as the default one to use for its dataset.';
COMMENT ON COLUMN raw.encode__file."processed" IS '''True'' for pipeline output, ''False'' for submitted raw data.';
COMMENT ON COLUMN raw.encode__file."run_type" IS 'Sequencing run type for reads: ''single-ended'' or ''paired-ended''.';
COMMENT ON COLUMN raw.encode__file."read_length" IS 'Read length for reads, as text.';
COMMENT ON COLUMN raw.encode__file."paired_end" IS '''1'' or ''2'' for one end of a paired-end fastq.';
COMMENT ON COLUMN raw.encode__file."paired_with" IS 'Object path of the mate fastq.';
COMMENT ON COLUMN raw.encode__file."date_created" IS 'ISO 8601 timestamp the file object was created.';
COMMENT ON COLUMN raw.encode__file."lab_title" IS 'Lab that produced the file; ''ENCODE Processing Pipeline'' for uniform processing.';
COMMENT ON COLUMN raw.encode__file."award_project" IS 'Funding project, as raw.encode__experiment.award_project.';
COMMENT ON COLUMN raw.encode__file."award_rfa" IS 'Project phase, e.g. ''ENCODE4''.';
COMMENT ON COLUMN raw.encode__file."alternate_accessions" IS 'Accessions merged into this one, '',''-joined.';
COMMENT ON COLUMN raw.encode__file."superseded_by" IS 'Object paths of the files that replace this one, '',''-joined.';
COMMENT ON COLUMN raw.encode__file."retrieval_date" IS 'UTC date this report was downloaded, YYYY-MM-DD. The source''s own version.';
COMMENT ON COLUMN raw.encode__file."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW resource.encode__experiment AS SELECT * FROM read_parquet('./resource/encode__experiment.parquet');
COMMENT ON VIEW resource.encode__experiment IS 'One row per ENCODE experiment, Type 2 by resource_id: assay, biosample, target, lab and award. Every status is here — filter status = ''released'' for current data. Its files are resource.encode__file rows with this resource_id as dataset_id. ENCODE data are free of use restrictions; the ENCODE Consortium asks to be cited: https://www.encodeproject.org/help/citing-encode/';
COMMENT ON COLUMN resource.encode__experiment."resource_id" IS '''encode:'' + accession, e.g. ''encode:ENCSR000AKS'' — the spelling BEDbase''s derived_from_experiment rows use as target_id in resource.resource_relationship, so the two join with ''=''. Business key.';
COMMENT ON COLUMN resource.encode__experiment."accession" IS 'Bare ENCODE accession, e.g. ''ENCSR000AKS''.';
COMMENT ON COLUMN resource.encode__experiment."status" IS '''released'', ''archived'' or ''revoked''. Filter on it: archived and revoked experiments are rows here too.';
COMMENT ON COLUMN resource.encode__experiment."description" IS 'Submitter''s free-text description.';
COMMENT ON COLUMN resource.encode__experiment."assay_term_id" IS 'Assay ontology id, mostly OBI; ''NTR:…'' is an ENCODE placeholder.';
COMMENT ON COLUMN resource.encode__experiment."assay_term_name" IS 'Assay label, e.g. ''ChIP-seq''.';
COMMENT ON COLUMN resource.encode__experiment."assay_title" IS 'ENCODE''s finer assay name, e.g. ''TF ChIP-seq''.';
COMMENT ON COLUMN resource.encode__experiment."biosample_term_id" IS 'Biosample type as a CURIE in ontology.term.term_id''s form: UBERON, CL, EFO or CLO; ''NTR:…'' placeholders resolve nowhere. Joinable form: resource.resource_relationship (has_biosample).';
COMMENT ON COLUMN resource.encode__experiment."biosample_term_name" IS 'Label of biosample_term_id, e.g. ''K562''.';
COMMENT ON COLUMN resource.encode__experiment."biosample_classification" IS '''tissue'', ''cell line'', ''primary cell'', ...';
COMMENT ON COLUMN resource.encode__experiment."biosample_summary" IS 'ENCODE''s one-line biosample description.';
COMMENT ON COLUMN resource.encode__experiment."taxon_id" IS 'NCBI taxonomy id. NULL where the experiment has no replicate, or replicates of more than one organism.';
COMMENT ON COLUMN resource.encode__experiment."organism" IS 'Scientific name as published; '',''-joined if more than one.';
COMMENT ON COLUMN resource.encode__experiment."target_label" IS 'Assay target, e.g. ''CTCF'', ''H3K27ac''. NULL for untargeted assays.';
COMMENT ON COLUMN resource.encode__experiment."target_investigated_as" IS 'Target categories as published, '',''-joined.';
COMMENT ON COLUMN resource.encode__experiment."target_gene_ids" IS 'Entrez GeneIDs of the target''s genes, sorted list. Joinable form: resource.resource_relationship (has_target_gene, ''ncbigene:<id>'').';
COMMENT ON COLUMN resource.encode__experiment."control_type" IS 'Set on control experiments, e.g. ''input library''.';
COMMENT ON COLUMN resource.encode__experiment."lab" IS 'Submitting lab.';
COMMENT ON COLUMN resource.encode__experiment."award" IS 'Grant number.';
COMMENT ON COLUMN resource.encode__experiment."project" IS '''ENCODE'', ''Roadmap'', ''modENCODE'', ''modERN'', ''GGR'', ...';
COMMENT ON COLUMN resource.encode__experiment."rfa" IS 'Project phase, e.g. ''ENCODE4''.';
COMMENT ON COLUMN resource.encode__experiment."assemblies" IS 'Assembly labels of the experiment''s processed files, sorted list, as the portal spells them.';
COMMENT ON COLUMN resource.encode__experiment."dbxrefs" IS 'External cross-references, sorted list, e.g. [''GEO:GSE30263''] — upstream''s spelling, not the ''geo:gse…'' one BEDbase writes.';
COMMENT ON COLUMN resource.encode__experiment."doi" IS 'The experiment''s DOI.';
COMMENT ON COLUMN resource.encode__experiment."date_submitted" IS 'YYYY-MM-DD, as published.';
COMMENT ON COLUMN resource.encode__experiment."date_released" IS 'YYYY-MM-DD, as published.';
COMMENT ON COLUMN resource.encode__experiment."portal_uri" IS 'The experiment''s page on encodeproject.org.';
COMMENT ON COLUMN resource.encode__experiment."provider" IS 'Constant ''ENCODE''.';
COMMENT ON COLUMN resource.encode__experiment."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN resource.encode__experiment."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW resource.encode__file AS SELECT * FROM read_parquet('./resource/encode__file.parquet');
COMMENT ON VIEW resource.encode__file IS 'One row per ENCODE file, Type 2 by resource_id. Objects are REFERENCED, never ingested: https_uri / cloud_uri / s3_uri point at ENCODE''s public bucket, with size and md5sum. Every status and every dataset type is here. ENCODE data are free of use restrictions; the ENCODE Consortium asks to be cited: https://www.encodeproject.org/help/citing-encode/';
COMMENT ON COLUMN resource.encode__file."resource_id" IS '''encode:'' + accession, e.g. ''encode:ENCFF002FAS'' — the spelling BEDbase''s derived_from_sample rows use as target_id. Business key.';
COMMENT ON COLUMN resource.encode__file."accession" IS 'Bare ENCODE file accession; for the ~1,300 files that have none, the external accession or name the portal keys them by (raw.encode__file.title).';
COMMENT ON COLUMN resource.encode__file."dataset_id" IS '''encode:'' + the accession of the dataset the file belongs to. Joins resource.encode__experiment.resource_id when dataset_type = ''experiments''.';
COMMENT ON COLUMN resource.encode__file."dataset_type" IS 'Kind of dataset, as the portal''s path segment: ''experiments'', ''annotations'', ''references'', ... Only experiments are landed (encode.py).';
COMMENT ON COLUMN resource.encode__file."status" IS '''released'', ''archived'' or ''revoked''.';
COMMENT ON COLUMN resource.encode__file."file_format" IS '''bed'', ''bigWig'', ''fastq'', ''bam'', ...';
COMMENT ON COLUMN resource.encode__file."file_format_type" IS 'Sub-format, e.g. ''narrowPeak''. NULL for most formats.';
COMMENT ON COLUMN resource.encode__file."file_type" IS 'Format and sub-format together, e.g. ''bed narrowPeak''.';
COMMENT ON COLUMN resource.encode__file."output_type" IS 'What the file holds, e.g. ''IDR thresholded peaks''.';
COMMENT ON COLUMN resource.encode__file."output_category" IS '''raw data'', ''alignment'', ''signal'', ''annotation'', ...';
COMMENT ON COLUMN resource.encode__file."assembly" IS 'Assembly LABEL as published (''GRCh38'', ''hg19'', ''mm10-minimal''), not an assembly key: free of any join until issue #94 defines one. NULL for unaligned data.';
COMMENT ON COLUMN resource.encode__file."genome_annotation" IS 'Gene annotation version, e.g. ''V29''.';
COMMENT ON COLUMN resource.encode__file."size" IS 'Bytes.';
COMMENT ON COLUMN resource.encode__file."md5sum" IS 'MD5 of the file as stored.';
COMMENT ON COLUMN resource.encode__file."content_md5sum" IS 'MD5 of the uncompressed content, where published.';
COMMENT ON COLUMN resource.encode__file."https_uri" IS 'Portal download URL; redirects to cloud_uri. NULL where no file is available.';
COMMENT ON COLUMN resource.encode__file."cloud_uri" IS 'Direct HTTPS URL in the public encode-public bucket.';
COMMENT ON COLUMN resource.encode__file."s3_uri" IS 's3://encode-public/… URI of the same object; anonymous read.';
COMMENT ON COLUMN resource.encode__file."no_file_available" IS 'True where ENCODE holds metadata only.';
COMMENT ON COLUMN resource.encode__file."restricted" IS 'True where access is restricted. NULL means unrestricted.';
COMMENT ON COLUMN resource.encode__file."preferred_default" IS 'True where ENCODE marks this the file to use by default.';
COMMENT ON COLUMN resource.encode__file."derived_from" IS '''encode:''-prefixed ids of the files this was computed from, sorted list; join to resource_id. A few name a reference file rather than an accession.';
COMMENT ON COLUMN resource.encode__file."lab" IS 'Producing lab; ''ENCODE Processing Pipeline'' for uniform processing.';
COMMENT ON COLUMN resource.encode__file."date_created" IS 'ISO 8601 timestamp, as published.';
COMMENT ON COLUMN resource.encode__file."provider" IS 'Constant ''ENCODE''.';
COMMENT ON COLUMN resource.encode__file."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN resource.encode__file."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW raw.hgnc__complete_set AS SELECT * FROM read_parquet('./raw/hgnc__complete_set.parquet');
COMMENT ON VIEW raw.hgnc__complete_set IS 'HGNC''s hgnc_complete_set.txt landed verbatim and whole: one row per approved human gene nomenclature record, every column. Every column is a string and nothing is split — multi-valued cells keep their ''|''. An empty cell is read as NULL. Approved records only: HGNC publishes withdrawn and merged ids in a separate file that is not landed. Licence CC0.';
COMMENT ON COLUMN raw.hgnc__complete_set."hgnc_id" IS 'HGNC id with its prefix, e.g. ''HGNC:11998''. Stable across symbol changes. Unique per row within one hgnc_version, so it is the natural key even though raw declares none.';
COMMENT ON COLUMN raw.hgnc__complete_set."symbol" IS 'Approved gene symbol, e.g. TP53.';
COMMENT ON COLUMN raw.hgnc__complete_set."name" IS 'Approved gene name, e.g. ''tumor protein p53''.';
COMMENT ON COLUMN raw.hgnc__complete_set."locus_group" IS 'Broad locus class: ''protein-coding gene'', ''non-coding RNA'', ''pseudogene'' or ''other''.';
COMMENT ON COLUMN raw.hgnc__complete_set."locus_type" IS 'Specific locus class within locus_group, e.g. ''gene with protein product'', ''RNA, long non-coding'', ''immunoglobulin pseudogene''.';
COMMENT ON COLUMN raw.hgnc__complete_set."status" IS 'Nomenclature status. ''Approved'' on every row of the complete set: withdrawn and merged records are published in a separate file, withdrawn.txt, which is not landed.';
COMMENT ON COLUMN raw.hgnc__complete_set."location" IS 'Cytogenetic location, e.g. 17p13.1. Not a coordinate.';
COMMENT ON COLUMN raw.hgnc__complete_set."alias_symbol" IS 'Other symbols used for this gene, never approved by HGNC, ''|''-separated as published.';
COMMENT ON COLUMN raw.hgnc__complete_set."alias_name" IS 'Other names used for this gene, ''|''-separated as published.';
COMMENT ON COLUMN raw.hgnc__complete_set."prev_symbol" IS 'Symbols HGNC previously approved for this gene, ''|''-separated as published. No dates are attached to the individual symbols.';
COMMENT ON COLUMN raw.hgnc__complete_set."prev_name" IS 'Names HGNC previously approved for this gene, ''|''-separated.';
COMMENT ON COLUMN raw.hgnc__complete_set."gene_group" IS 'Names of the HGNC gene groups (families) the gene belongs to, ''|''-separated, parallel to gene_group_id.';
COMMENT ON COLUMN raw.hgnc__complete_set."gene_group_id" IS 'HGNC gene group ids, ''|''-separated, parallel to gene_group.';
COMMENT ON COLUMN raw.hgnc__complete_set."date_approved_reserved" IS 'Date the symbol was first approved or reserved, YYYY-MM-DD. String, because raw is landed unparsed.';
COMMENT ON COLUMN raw.hgnc__complete_set."date_symbol_changed" IS 'Date of the most recent approved-symbol change, YYYY-MM-DD. NULL if the symbol never changed.';
COMMENT ON COLUMN raw.hgnc__complete_set."date_name_changed" IS 'Date of the most recent approved-name change, YYYY-MM-DD.';
COMMENT ON COLUMN raw.hgnc__complete_set."date_modified" IS 'Date HGNC last edited any field of the record, YYYY-MM-DD.';
COMMENT ON COLUMN raw.hgnc__complete_set."entrez_id" IS 'NCBI Entrez GeneID, curated by HGNC.';
COMMENT ON COLUMN raw.hgnc__complete_set."ensembl_gene_id" IS 'Ensembl stable gene id, curated by HGNC. Unversioned.';
COMMENT ON COLUMN raw.hgnc__complete_set."vega_id" IS 'Vega (Havana) gene id, OTTHUMG...; Vega is archived.';
COMMENT ON COLUMN raw.hgnc__complete_set."ucsc_id" IS 'UCSC Genome Browser gene id, e.g. uc060aur.1.';
COMMENT ON COLUMN raw.hgnc__complete_set."ena" IS 'INSDC (ENA/GenBank/DDBJ) nucleotide accessions, ''|''-separated.';
COMMENT ON COLUMN raw.hgnc__complete_set."refseq_accession" IS 'RefSeq nucleotide accessions without version, ''|''-separated.';
COMMENT ON COLUMN raw.hgnc__complete_set."ccds_id" IS 'Consensus CDS ids, ''|''-separated.';
COMMENT ON COLUMN raw.hgnc__complete_set."uniprot_ids" IS 'UniProtKB accessions, ''|''-separated.';
COMMENT ON COLUMN raw.hgnc__complete_set."pubmed_id" IS 'PubMed ids of publications HGNC cites for the gene, ''|''-separated.';
COMMENT ON COLUMN raw.hgnc__complete_set."mgd_id" IS 'Mouse Genome Informatics ids of mouse orthologs, e.g. ''MGI:98834'', ''|''-separated.';
COMMENT ON COLUMN raw.hgnc__complete_set."rgd_id" IS 'Rat Genome Database ids of rat orthologs, e.g. ''RGD:3889'', ''|''-separated.';
COMMENT ON COLUMN raw.hgnc__complete_set."lsdb" IS 'Locus-specific mutation databases as one flat ''|''-separated list that alternates name and URL: ''name|url|name|url''.';
COMMENT ON COLUMN raw.hgnc__complete_set."cosmic" IS 'Symbol used by COSMIC for the gene.';
COMMENT ON COLUMN raw.hgnc__complete_set."omim_id" IS 'OMIM ids. Usually one; ''|''-separated on the few genes with several.';
COMMENT ON COLUMN raw.hgnc__complete_set."mirbase" IS 'miRBase accession, e.g. MI0000651.';
COMMENT ON COLUMN raw.hgnc__complete_set."homeodb" IS 'Homeobox Database id.';
COMMENT ON COLUMN raw.hgnc__complete_set."snornabase" IS 'snoRNABase id, e.g. SR0000002.';
COMMENT ON COLUMN raw.hgnc__complete_set."bioparadigms_slc" IS 'Symbol used by the Bioparadigms solute carrier (SLC) tables.';
COMMENT ON COLUMN raw.hgnc__complete_set."orphanet" IS 'Orphanet gene id.';
COMMENT ON COLUMN raw.hgnc__complete_set."pseudogene_org" IS 'Pseudogene.org id. Upstream column name ''pseudogene.org''.';
COMMENT ON COLUMN raw.hgnc__complete_set."horde_id" IS 'Symbol used by HORDE, the human olfactory receptor database.';
COMMENT ON COLUMN raw.hgnc__complete_set."merops" IS 'MEROPS peptidase database id, e.g. I43.950.';
COMMENT ON COLUMN raw.hgnc__complete_set."imgt" IS 'Symbol used by IMGT, the immunogenetics information system.';
COMMENT ON COLUMN raw.hgnc__complete_set."iuphar" IS 'IUPHAR/BPS Guide to Pharmacology link. On 2026-09-18 the cell repeats the row''s own HGNC id rather than an IUPHAR object id; landed as published.';
COMMENT ON COLUMN raw.hgnc__complete_set."kznf_gene_catalog" IS 'Human KZNF Gene Catalog id. Empty on every row on 2026-09-18.';
COMMENT ON COLUMN raw.hgnc__complete_set."mamit_trnadb" IS 'Mamit-tRNAdb id. Upstream column name ''mamit-trnadb''.';
COMMENT ON COLUMN raw.hgnc__complete_set."cd" IS 'Cluster-of-differentiation symbol from the HCDM database, e.g. CD243.';
COMMENT ON COLUMN raw.hgnc__complete_set."lncrnadb" IS 'lncRNAdb id.';
COMMENT ON COLUMN raw.hgnc__complete_set."enzyme_id" IS 'Enzyme Commission numbers, ''|''-separated.';
COMMENT ON COLUMN raw.hgnc__complete_set."intermediate_filament_db" IS 'Human Intermediate Filament Database id. Empty on every row on 2026-09-18.';
COMMENT ON COLUMN raw.hgnc__complete_set."rna_central_id" IS 'RNAcentral id, e.g. URS00007E4F6E.';
COMMENT ON COLUMN raw.hgnc__complete_set."lncipedia" IS 'Symbol used by LNCipedia.';
COMMENT ON COLUMN raw.hgnc__complete_set."gtrnadb" IS 'GtRNAdb gene name, e.g. tRNA-Ala-AGC-1-1.';
COMMENT ON COLUMN raw.hgnc__complete_set."agr" IS 'Alliance of Genome Resources id, which for human is the HGNC id itself.';
COMMENT ON COLUMN raw.hgnc__complete_set."mane_select" IS 'The MANE Select transcript as ''Ensembl transcript|RefSeq transcript'', both versioned, e.g. ''ENST00000269305.9|NM_000546.6''.';
COMMENT ON COLUMN raw.hgnc__complete_set."gencc" IS 'Gene Curation Coalition link: the row''s HGNC id where GenCC has a record for the gene, else NULL.';
COMMENT ON COLUMN raw.hgnc__complete_set."hgnc_version" IS 'The date that versions this file: the date in a dated archive''s file name, or the retrieval date for the rolling file, which carries no version of its own. provenance.release says which it was. Raw is replaced wholesale per value of this column.';
COMMENT ON COLUMN raw.hgnc__complete_set."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW annotation.hgnc__gene AS SELECT * FROM read_parquet('./annotation/hgnc__gene.parquet');
COMMENT ON VIEW annotation.hgnc__gene IS 'Human gene nomenclature as HGNC approves it, keyed by HGNC id: symbol, name, locus type, and the symbol and name history HGNC publishes. HGNC is the naming authority, so this is the tie-breaker when Ensembl and NCBI carry different symbols for one gene. Reach Entrez, Ensembl, UCSC and OMIM ids through annotation.identifier_mapping (source = ''HGNC''). Gene groups and the remaining cross-references stay in raw.hgnc__complete_set. Licence CC0.';
COMMENT ON COLUMN annotation.hgnc__gene."hgnc_id" IS 'HGNC id with its prefix, e.g. ''HGNC:11998''. Stable across symbol changes, which is why it and not the symbol is the key.';
COMMENT ON COLUMN annotation.hgnc__gene."taxon_id" IS 'NCBI taxonomy id. Always 9606: HGNC names human genes only.';
COMMENT ON COLUMN annotation.hgnc__gene."symbol" IS 'The approved symbol, e.g. TP53. The authoritative one where annotation.gene (Ensembl) and annotation.ncbi__gene disagree.';
COMMENT ON COLUMN annotation.hgnc__gene."name" IS 'The approved name, e.g. ''tumor protein p53''.';
COMMENT ON COLUMN annotation.hgnc__gene."locus_group" IS 'Broad locus class: ''protein-coding gene'', ''non-coding RNA'', ''pseudogene'' or ''other''.';
COMMENT ON COLUMN annotation.hgnc__gene."locus_type" IS 'Specific locus class, e.g. ''gene with protein product''. HGNC''s own vocabulary, not mapped onto Ensembl biotypes or NCBI gene types.';
COMMENT ON COLUMN annotation.hgnc__gene."status" IS 'Nomenclature status. Currently always ''Approved'': the complete set excludes withdrawn records, so a withdrawn gene shows up as a row closed by valid_to rather than as a status value.';
COMMENT ON COLUMN annotation.hgnc__gene."location" IS 'Cytogenetic location, e.g. 17p13.1. Not a coordinate.';
COMMENT ON COLUMN annotation.hgnc__gene."alias_symbol" IS 'Symbols in use but never approved, ''|''-separated as published.';
COMMENT ON COLUMN annotation.hgnc__gene."alias_name" IS 'Names in use but never approved, ''|''-separated as published.';
COMMENT ON COLUMN annotation.hgnc__gene."prev_symbol" IS 'Previously approved symbols, ''|''-separated as published. With date_symbol_changed this is HGNC''s own symbol history; this table''s valid_from/valid_to record changes seen since biocOnIce began loading it.';
COMMENT ON COLUMN annotation.hgnc__gene."prev_name" IS 'Previously approved names, ''|''-separated as published.';
COMMENT ON COLUMN annotation.hgnc__gene."date_approved_reserved" IS 'Date the symbol was first approved or reserved, YYYY-MM-DD.';
COMMENT ON COLUMN annotation.hgnc__gene."date_symbol_changed" IS 'Date of the most recent symbol change, YYYY-MM-DD. NULL if it never changed.';
COMMENT ON COLUMN annotation.hgnc__gene."date_name_changed" IS 'Date of the most recent name change, YYYY-MM-DD.';
COMMENT ON COLUMN annotation.hgnc__gene."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN annotation.hgnc__gene."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW raw.ncbi__gene_orthologs AS SELECT * FROM read_parquet('./raw/ncbi__gene_orthologs.parquet');
COMMENT ON VIEW raw.ncbi__gene_orthologs IS 'NCBI gene_orthologs landed verbatim and whole: every ortholog pair NCBI publishes, ~19M rows. NOT symmetric: each ortholog set has one primary gene (the first two columns; human for the vertebrates) and its other N-1 members are listed against it once, so two non-primary members are never paired directly. Query annotation.ortholog, which carries each pair in both directions. Regenerated nightly upstream, so the retrieval date is the version.';
COMMENT ON COLUMN raw.ncbi__gene_orthologs."taxon_id" IS 'NCBI taxonomy id of gene_id''s organism. Upstream ''#tax_id''.';
COMMENT ON COLUMN raw.ncbi__gene_orthologs."gene_id" IS 'NCBI Entrez GeneID of the first gene. Upstream ''GeneID''.';
COMMENT ON COLUMN raw.ncbi__gene_orthologs."relationship" IS 'Upstream ''relationship'', read as ''gene_id has this relationship to other_gene_id''. Always ''Ortholog'' in this file.';
COMMENT ON COLUMN raw.ncbi__gene_orthologs."other_taxon_id" IS 'NCBI taxonomy id of other_gene_id''s organism. Upstream ''Other_tax_id''.';
COMMENT ON COLUMN raw.ncbi__gene_orthologs."other_gene_id" IS 'NCBI Entrez GeneID of the second gene. Upstream ''Other_GeneID''.';
COMMENT ON COLUMN raw.ncbi__gene_orthologs."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW raw.ncbi__gene_group AS SELECT * FROM read_parquet('./raw/ncbi__gene_group.parquet');
COMMENT ON VIEW raw.ncbi__gene_group IS 'NCBI gene_group landed verbatim and whole: gene-gene relationships other than orthology, ~51k rows, reported symmetrically where that makes sense (a ''Readthrough parent'' row has its ''Readthrough child'' mirror). NCBI calls the file a non-comprehensive subset. Nothing is derived from it yet. Orthologs are in raw.ncbi__gene_orthologs. Regenerated nightly upstream, so the retrieval date is the version.';
COMMENT ON COLUMN raw.ncbi__gene_group."taxon_id" IS 'NCBI taxonomy id of gene_id''s organism. Upstream ''#tax_id''.';
COMMENT ON COLUMN raw.ncbi__gene_group."gene_id" IS 'NCBI Entrez GeneID of the first gene. Upstream ''GeneID''.';
COMMENT ON COLUMN raw.ncbi__gene_group."relationship" IS 'Upstream ''relationship'', read as ''gene_id has this relationship to other_gene_id''. How gene_id relates to other_gene_id: ''Related functional gene'', ''Related pseudogene'', ''Readthrough parent'', ''Readthrough child'', ''Readthrough sibling'', ''Potential readthrough sibling'', ''Region parent'' or ''Region member''.';
COMMENT ON COLUMN raw.ncbi__gene_group."other_taxon_id" IS 'NCBI taxonomy id of other_gene_id''s organism. Upstream ''Other_tax_id''.';
COMMENT ON COLUMN raw.ncbi__gene_group."other_gene_id" IS 'NCBI Entrez GeneID of the second gene. Upstream ''Other_GeneID''.';
COMMENT ON COLUMN raw.ncbi__gene_group."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW annotation.ortholog AS SELECT * FROM read_parquet('./annotation/ortholog.parquet');
COMMENT ON VIEW annotation.ortholog IS 'Ortholog pairs, stacked across providers: Bioconductor''s Orthology.eg.db. One row per ordered pair per source, and every pair is stored in both directions, so `WHERE gene_id = ''22059'' AND source = ''NCBI''` finds human TP53 as readily as the reverse. Under source NCBI only pairs NCBI itself lists are here: each ortholog set hangs off one primary gene (human, for vertebrates), so mouse-to-rat is two hops through the human gene — join the table to itself on ortholog_gene_id — and is not materialised. The whole tuple is the key: a pair has no attributes, so it is only ever asserted or withdrawn.';
COMMENT ON COLUMN annotation.ortholog."gene_id" IS 'The gene, in the provider''s own id space: an Entrez GeneID such as 7157 under source NCBI. Part of the merge key.';
COMMENT ON COLUMN annotation.ortholog."taxon_id" IS 'NCBI taxonomy id of gene_id''s organism, e.g. 9606. The row belongs to this taxon: it is the merge scope, so filter on it to get one organism''s orthologs. Part of the merge key.';
COMMENT ON COLUMN annotation.ortholog."ortholog_gene_id" IS 'The orthologous gene in another organism, same id space as gene_id, e.g. 22059 (mouse Trp53) for 7157. Part of the merge key.';
COMMENT ON COLUMN annotation.ortholog."ortholog_taxon_id" IS 'NCBI taxonomy id of ortholog_gene_id''s organism, e.g. 10090. Part of the merge key.';
COMMENT ON COLUMN annotation.ortholog."source" IS 'The provider asserting the orthology: ''NCBI'' now (gene_orthologs, from the Eukaryotic Genome Annotation Pipeline''s protein similarity plus local synteny, and curator review); Ensembl Compara when it lands. Part of the business key and of every writer''s merge scope, so providers stack and none can retire another''s rows (ADR-0004).';
COMMENT ON COLUMN annotation.ortholog."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN annotation.ortholog."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW raw.ncbi__mane_summary AS SELECT * FROM read_parquet('./raw/ncbi__mane_summary.parquet');
COMMENT ON VIEW raw.ncbi__mane_summary IS 'The MANE summary file (Matched Annotation from NCBI and EMBL-EBI) landed verbatim and whole, one row per matched RefSeq/Ensembl transcript pair, human GRCh38 only. Every column is the unparsed string; an empty cell is NULL. Query annotation.mane__transcript instead. A joint NCBI / EMBL-EBI product, published on NCBI''s FTP site without a licence file; NCBI places no restrictions on use or distribution of its molecular data.';
COMMENT ON COLUMN raw.ncbi__mane_summary."ncbi_geneid" IS 'Upstream ''#NCBI_GeneID'': the Entrez GeneID with MANE''s own prefix, e.g. ''GeneID:7157'', verbatim.';
COMMENT ON COLUMN raw.ncbi__mane_summary."ensembl_gene" IS 'Upstream ''Ensembl_Gene'': versioned Ensembl gene id, e.g. ENSG00000141510.21.';
COMMENT ON COLUMN raw.ncbi__mane_summary."hgnc_id" IS 'Upstream ''HGNC_ID'', e.g. ''HGNC:11998''. NULL (an empty cell) for the few genes HGNC has not named.';
COMMENT ON COLUMN raw.ncbi__mane_summary."symbol" IS 'Gene symbol: HGNC''s where there is one, else NCBI''s.';
COMMENT ON COLUMN raw.ncbi__mane_summary."name" IS 'Gene name, e.g. ''tumor protein p53''.';
COMMENT ON COLUMN raw.ncbi__mane_summary."refseq_nuc" IS 'Upstream ''RefSeq_nuc'': versioned RefSeq transcript, e.g. NM_000546.6. NR_ for the non-coding transcripts MANE includes.';
COMMENT ON COLUMN raw.ncbi__mane_summary."refseq_prot" IS 'Upstream ''RefSeq_prot'': versioned RefSeq protein, e.g. NP_000537.3. NULL on a non-coding (NR_) row.';
COMMENT ON COLUMN raw.ncbi__mane_summary."ensembl_nuc" IS 'Upstream ''Ensembl_nuc'': versioned Ensembl transcript, e.g. ENST00000269305.9.';
COMMENT ON COLUMN raw.ncbi__mane_summary."ensembl_prot" IS 'Upstream ''Ensembl_prot'': versioned Ensembl protein, e.g. ENSP00000269305.4. NULL on a non-coding row.';
COMMENT ON COLUMN raw.ncbi__mane_summary."mane_status" IS 'Upstream ''MANE_status'': ''MANE Select'' or ''MANE Plus Clinical''.';
COMMENT ON COLUMN raw.ncbi__mane_summary."grch38_chr" IS 'Upstream ''GRCh38_chr'': RefSeq accession of the GRCh38 sequence, e.g. NC_000017.11. Not a chromosome name.';
COMMENT ON COLUMN raw.ncbi__mane_summary."chr_start" IS 'Transcript start on grch38_chr, 1-based, as published (unparsed string).';
COMMENT ON COLUMN raw.ncbi__mane_summary."chr_end" IS 'Transcript end on grch38_chr, inclusive, as published (unparsed string).';
COMMENT ON COLUMN raw.ncbi__mane_summary."chr_strand" IS '''+'' or ''-''. The ''-'' is the minus strand, never a missing marker: this file is read with the empty cell as NULL, unlike the NCBI Gene dumps.';
COMMENT ON COLUMN raw.ncbi__mane_summary."mane_version" IS 'MANE release, from the file name, e.g. ''1.5''. Raw is replaced per value of this column, so several releases can coexist.';
COMMENT ON COLUMN raw.ncbi__mane_summary."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW annotation.mane__transcript AS SELECT * FROM read_parquet('./annotation/mane__transcript.parquet');
COMMENT ON VIEW annotation.mane__transcript IS 'MANE transcripts: for each human gene, the transcript RefSeq and Ensembl annotate identically (MANE Select), plus the MANE Plus Clinical extras. One row per matched pair, carrying both providers'' transcript, protein and gene ids — the bridge between RefSeq- and Ensembl-based annotation. RefSeq accessions are versioned and Ensembl ids are split into id and version, each the way the rest of the catalog writes them. The same pairs are in annotation.identifier_mapping as REFSEQ_RNA -> ENSEMBL_TRANSCRIPT under source = ''MANE''. Gene name and GRCh38 coordinates stay in raw.ncbi__mane_summary.';
COMMENT ON COLUMN annotation.mane__transcript."ensembl_transcript_id" IS 'Ensembl stable transcript id without version, e.g. ENST00000269305. The key, and the join to annotation.transcript.transcript_id (source = ''ENSEMBL'').';
COMMENT ON COLUMN annotation.mane__transcript."taxon_id" IS 'NCBI taxonomy id. Always 9606: MANE is a human product.';
COMMENT ON COLUMN annotation.mane__transcript."ensembl_transcript_version" IS 'Version of the Ensembl transcript MANE matched, e.g. 9. The match is exact to the version: if annotation.transcript.version differs, the two are from different Ensembl releases.';
COMMENT ON COLUMN annotation.mane__transcript."refseq_rna" IS 'The matched RefSeq transcript WITH its version, e.g. NM_000546.6 — the form the REFSEQ_RNA namespace of annotation.identifier_mapping uses. NR_ for a non-coding transcript.';
COMMENT ON COLUMN annotation.mane__transcript."mane_status" IS '''MANE Select'': the one representative transcript of its gene. ''MANE Plus Clinical'': an extra transcript needed to report known pathogenic variants that Select misses; a gene may have more than one. Filter on this before assuming one row per gene.';
COMMENT ON COLUMN annotation.mane__transcript."gene_id" IS 'NCBI Entrez GeneID, e.g. 7157, without MANE''s ''GeneID:'' prefix. Joins annotation.ncbi__gene.';
COMMENT ON COLUMN annotation.mane__transcript."ensembl_gene_id" IS 'Ensembl stable gene id without version, e.g. ENSG00000141510. Joins annotation.gene (source = ''ENSEMBL'').';
COMMENT ON COLUMN annotation.mane__transcript."hgnc_id" IS 'HGNC id with its prefix, e.g. ''HGNC:11998''. NULL where HGNC has not named the gene.';
COMMENT ON COLUMN annotation.mane__transcript."symbol" IS 'Gene symbol as MANE carried it, e.g. TP53.';
COMMENT ON COLUMN annotation.mane__transcript."refseq_protein" IS 'The matched RefSeq protein with its version, e.g. NP_000537.3. NULL for a non-coding transcript.';
COMMENT ON COLUMN annotation.mane__transcript."ensembl_protein_id" IS 'Ensembl stable protein id without version, e.g. ENSP00000269305. NULL for a non-coding transcript.';
COMMENT ON COLUMN annotation.mane__transcript."ensembl_protein_version" IS 'Version of the matched Ensembl protein, e.g. 4.';
COMMENT ON COLUMN annotation.mane__transcript."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN annotation.mane__transcript."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW raw.cellosaurus__release AS SELECT * FROM read_parquet('./raw/cellosaurus__release.parquet');
COMMENT ON VIEW raw.cellosaurus__release IS 'Cellosaurus'' flat file (cellosaurus.txt) landed whole, one row per line in file order, the header included: nothing is filtered and no value is parsed, so comments (CC), STR profiles (ST), references (RX) and web links (WW) are here although nothing derives them yet. Query annotation.cellosaurus__* instead. Cellosaurus (release: provenance.release.source_version where source = ''cellosaurus'') © CALIPHO group, SIB Swiss Institute of Bioinformatics, CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/); reformatted as rows, content unmodified.';
COMMENT ON COLUMN raw.cellosaurus__release."line_number" IS '1-based ordinal of this line in cellosaurus.txt. Ordering by it gives the file back.';
COMMENT ON COLUMN raw.cellosaurus__release."accession" IS 'CVCL_ accession of the entry this line belongs to, taken from the entry''s AC line and repeated on every line of the entry (the ID line precedes AC, the ''//'' terminator follows it). NULL on header lines.';
COMMENT ON COLUMN raw.cellosaurus__release."code" IS 'The two-letter line code: ID, AC, AS, SY, DR, RX, WW, CC, ST, DI, OX, HI, OI, SX, AG, CA, DT, or ''//'' for the entry terminator. The file''s own header documents each. NULL on header lines.';
COMMENT ON COLUMN raw.cellosaurus__release."value" IS 'The line after its code and the three spaces that follow, verbatim and unparsed. On a header line (code IS NULL) the whole line, blank ones included as ''''. NULL on a ''//'' line. The file''s line is therefore code || '' '' || value, ''//'' or value.';
COMMENT ON COLUMN raw.cellosaurus__release."cellosaurus_version" IS 'Cellosaurus'' own release, from the '' Version:'' line of the file header, e.g. ''56.0''. Raw is replaced wholesale per value of this column, so more than one release can coexist.';
COMMENT ON COLUMN raw.cellosaurus__release."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW annotation.cellosaurus__cell_line AS SELECT * FROM read_parquet('./annotation/cellosaurus__cell_line.parquet');
COMMENT ON VIEW annotation.cellosaurus__cell_line IS 'Cell lines as Cellosaurus registers them, one current row per CVCL_ accession: name, synonyms, species, sex, donor age, category and parent line. Reach other databases'' ids (DepMap, ENCODE, CLO, EFO, BTO, Wikidata, GEO) through annotation.cellosaurus__xref and diseases through annotation.cellosaurus__disease. Comments, STR profiles, references and same-individual links stay in raw.cellosaurus__release. Cellosaurus (release: provenance.release.source_version where source = ''cellosaurus'') © CALIPHO group, SIB Swiss Institute of Bioinformatics, CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/); modified (normalised).';
COMMENT ON COLUMN annotation.cellosaurus__cell_line."accession" IS 'Cellosaurus accession, e.g. CVCL_0030 (HeLa). Stable, and the form RRIDs cite (RRID:CVCL_0030).';
COMMENT ON COLUMN annotation.cellosaurus__cell_line."name" IS 'The recommended cell line name (ID line), e.g. ''HeLa''. Not unique: distinct lines do share names, which is why the accession is the key.';
COMMENT ON COLUMN annotation.cellosaurus__cell_line."synonyms" IS 'Other names and spellings in use (SY line), sorted and ''|''-joined. NULL where there are none.';
COMMENT ON COLUMN annotation.cellosaurus__cell_line."secondary_accessions" IS 'Former accessions merged into this one (AS line), sorted and ''|''-joined. Resolve a CVCL_ id that matches no accession here.';
COMMENT ON COLUMN annotation.cellosaurus__cell_line."taxon_ids" IS 'NCBI taxonomy ids of the species of origin (OX lines), sorted. A list because hybrid lines and hybridomas have two or three, e.g. [9606, 10116] for a human x rat hybrid; filter with list_contains().';
COMMENT ON COLUMN annotation.cellosaurus__cell_line."sex" IS 'Sex of the cell (SX line), in Cellosaurus'' words: ''Female'', ''Male'', ''Mixed sex'', ''Sex ambiguous'' or ''Sex unspecified''. NULL where the entry has no SX line, which is not the same as ''Sex unspecified''.';
COMMENT ON COLUMN annotation.cellosaurus__cell_line."age" IS 'Age of the donor at sampling (AG line), as published and unparsed: ''30Y6M'', ''Adult'', ''Fetus'', ''Blastocyst stage'', ''Age unspecified''.';
COMMENT ON COLUMN annotation.cellosaurus__cell_line."category" IS 'Cellosaurus'' cell line category (CA line), e.g. ''Cancer cell line'', ''Transformed cell line'', ''Induced pluripotent stem cell'', ''Hybridoma'', ''Hybrid cell line'', ''Finite cell line''.';
COMMENT ON COLUMN annotation.cellosaurus__cell_line."parent_accessions" IS 'Accessions of the lines this one was derived from (HI lines), sorted and ''|''-joined: usually one, two for a hybrid of two established lines. NULL for a line established directly from a donor.';
COMMENT ON COLUMN annotation.cellosaurus__cell_line."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN annotation.cellosaurus__cell_line."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW annotation.cellosaurus__xref AS SELECT * FROM read_parquet('./annotation/cellosaurus__xref.parquet');
COMMENT ON VIEW annotation.cellosaurus__xref IS 'Cellosaurus'' cross-references (DR lines): which record in another resource is this cell line. Many-to-many in both directions. The whole tuple is the key, so a cross-reference is only ever asserted or withdrawn. Not in annotation.identifier_mapping, which maps gene identifiers within one taxon: a cell line is not a gene and a hybrid line has two taxa. Cellosaurus (release: provenance.release.source_version where source = ''cellosaurus'') © CALIPHO group, SIB Swiss Institute of Bioinformatics, CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/); modified (normalised).';
COMMENT ON COLUMN annotation.cellosaurus__xref."accession" IS 'Cellosaurus accession, e.g. CVCL_0030.';
COMMENT ON COLUMN annotation.cellosaurus__xref."database" IS 'The cross-referenced resource, in Cellosaurus'' abbreviation: ''DepMap'', ''ENCODE'', ''CLO'', ''EFO'', ''BTO'', ''Wikidata'', ''GEO'', ''BioSample'', ''Cell_Model_Passport'', ''ATCC'', ... (117 in release 56.0).';
COMMENT ON COLUMN annotation.cellosaurus__xref."identifier" IS 'The line''s id in that resource, as Cellosaurus prints it: ''ACH-001086'', ''SIDM00846'', ''Q847482'', ''GSM501788''. Ontology ids come with an underscore (''EFO_0001185'', ''CLO_0003684''); replace(identifier, ''_'', '':'') joins them to ontology.term.term_id.';
COMMENT ON COLUMN annotation.cellosaurus__xref."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN annotation.cellosaurus__xref."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW annotation.cellosaurus__disease AS SELECT * FROM read_parquet('./annotation/cellosaurus__disease.parquet');
COMMENT ON VIEW annotation.cellosaurus__disease IS 'Diseases of the donor a cell line was established from (DI lines), one row per (cell line, disease term). Kept apart from annotation.cellosaurus__xref because it says something about the line rather than naming it elsewhere. Not mapped to MONDO: MONDO''s own NCIT and Orphanet xrefs are the bridge. Cellosaurus (release: provenance.release.source_version where source = ''cellosaurus'') © CALIPHO group, SIB Swiss Institute of Bioinformatics, CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/); modified (normalised).';
COMMENT ON COLUMN annotation.cellosaurus__disease."accession" IS 'Cellosaurus accession, e.g. CVCL_0030.';
COMMENT ON COLUMN annotation.cellosaurus__disease."database" IS 'The disease vocabulary: ''NCIt'' (NCI Thesaurus) or ''ORDO'' (Orphanet rare disease ontology). Most lines with a disease carry one of each.';
COMMENT ON COLUMN annotation.cellosaurus__disease."disease_id" IS 'The term''s id as Cellosaurus prints it: ''C27677'' for NCIt (NCIT:C27677 as a CURIE), ''Orphanet_521'' for ORDO (Orphanet:521).';
COMMENT ON COLUMN annotation.cellosaurus__disease."disease_name" IS 'The term''s label as Cellosaurus prints it, e.g. ''Human papillomavirus-related endocervical adenocarcinoma''.';
COMMENT ON COLUMN annotation.cellosaurus__disease."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN annotation.cellosaurus__disease."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW raw.wikipathways__gmt AS SELECT * FROM read_parquet('./raw/wikipathways__gmt.parquet');
COMMENT ON VIEW raw.wikipathways__gmt IS 'WikiPathways'' monthly GMT gene-set export (data.wikipathways.org/current/gmt/), every species file, one row per GMT line. GMT is ragged — name, description, then one field per gene — so the gene fields are kept as one verbatim tab-joined string and the packed set name is left unparsed; annotation.wikipathways__* is the interpreted form. Licence CC0 (wikipathways.org/terms.html).';
COMMENT ON COLUMN raw.wikipathways__gmt."file_name" IS 'The species GMT file this line came from, e.g. ''wikipathways-20260910-gmt-Homo_sapiens.gmt''. Every species file of the release is landed.';
COMMENT ON COLUMN raw.wikipathways__gmt."line_number" IS '1-based line number within file_name. With file_name it identifies a row within one wikipathways_version, though raw declares no key.';
COMMENT ON COLUMN raw.wikipathways__gmt."name" IS 'GMT field 1, the set name, unparsed. WikiPathways packs four ''%''-separated fields into it: pathway name, ''WikiPathways_<release date>'', WP id, species — e.g. ''Glutathione metabolism%WikiPathways_20260910%WP100%Homo sapiens''.';
COMMENT ON COLUMN raw.wikipathways__gmt."description" IS 'GMT field 2, the set description. WikiPathways puts the pathway''s URL here, e.g. https://www.wikipathways.org/instance/WP100.';
COMMENT ON COLUMN raw.wikipathways__gmt."genes" IS 'GMT fields 3 onward, verbatim: the rest of the line, still tab-separated, in file order and with the file''s repeats (a gene drawn twice in a pathway is listed twice). Entrez GeneIDs. Split with str_split(genes, chr(9)). NULL for a set with no genes.';
COMMENT ON COLUMN raw.wikipathways__gmt."species" IS 'The species token of file_name, as spelled there, e.g. ''Homo_sapiens''.';
COMMENT ON COLUMN raw.wikipathways__gmt."wikipathways_version" IS 'WikiPathways release these rows came from: the date in the file names, in WikiPathways'' own form, e.g. ''20260910''. Raw holds every landed version; filter on this to get one.';
COMMENT ON COLUMN raw.wikipathways__gmt."landed_in" IS 'biocOnIce release that fetched these rows.';
CREATE OR REPLACE VIEW annotation.wikipathways__pathway AS SELECT * FROM read_parquet('./annotation/wikipathways__pathway.parquet');
COMMENT ON VIEW annotation.wikipathways__pathway IS 'One row per WikiPathways pathway, every species, from the monthly GMT export. Only what the GMT carries: ontology tags, authors and last-modified dates live in the GPML export, which is not landed. Genes are in annotation.wikipathways__gene_pathway. Licence CC0.';
COMMENT ON COLUMN annotation.wikipathways__pathway."pathway_id" IS 'WikiPathways id, e.g. WP100. Unique across species: a pathway belongs to one organism, and its homologue in another has its own id.';
COMMENT ON COLUMN annotation.wikipathways__pathway."taxon_id" IS 'NCBI taxonomy id of the pathway''s species, e.g. 9606. Species-level, as WikiPathways names it — NCBI Gene files yeast genes under strain S288C (559292), not 4932.';
COMMENT ON COLUMN annotation.wikipathways__pathway."name" IS 'Pathway title, e.g. ''Glutathione metabolism''.';
COMMENT ON COLUMN annotation.wikipathways__pathway."species" IS 'Species name as WikiPathways spells it, e.g. ''Homo sapiens'', ''Canis familiaris''. taxon_id is the joinable form.';
COMMENT ON COLUMN annotation.wikipathways__pathway."url" IS 'The pathway''s page, e.g. https://www.wikipathways.org/instance/WP100 — the GMT description field.';
COMMENT ON COLUMN annotation.wikipathways__pathway."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN annotation.wikipathways__pathway."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW annotation.wikipathways__gene_pathway AS SELECT * FROM read_parquet('./annotation/wikipathways__gene_pathway.parquet');
COMMENT ON VIEW annotation.wikipathways__gene_pathway IS 'Gene-set membership: one row per (pathway, Entrez gene), every species, from WikiPathways'' monthly GMT export. A set, so a gene the GMT line repeats appears once. Membership has no attributes beyond the species, so a row is only ever asserted or withdrawn. (pathway_id, taxon_id, gene_id) is the shape any other gene-set source should take so that they union. Licence CC0.';
COMMENT ON COLUMN annotation.wikipathways__gene_pathway."pathway_id" IS 'WikiPathways id, e.g. WP100; joins to annotation.wikipathways__pathway. Part of the merge key.';
COMMENT ON COLUMN annotation.wikipathways__gene_pathway."taxon_id" IS 'NCBI taxonomy id of the pathway''s species (species-level; see annotation.wikipathways__pathway.taxon_id). Determined by pathway_id, carried so a species filter needs no join.';
COMMENT ON COLUMN annotation.wikipathways__gene_pathway."gene_id" IS 'NCBI Entrez GeneID of a member gene, e.g. 2687; joins to annotation.ncbi__gene.gene_id — on gene_id alone, which is unique across taxa. Part of the merge key.';
COMMENT ON COLUMN annotation.wikipathways__gene_pathway."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN annotation.wikipathways__gene_pathway."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW raw.eqtlcatalogue__dataset AS SELECT * FROM read_parquet('./raw/eqtlcatalogue__dataset.parquet');
COMMENT ON VIEW raw.eqtlcatalogue__dataset IS 'eQTL Catalogue''s per-release dataset metadata (data_tables/dataset_metadata_r<N>.tsv in github.com/eQTL-Catalogue/eQTL-Catalogue-resources), landed verbatim and whole as text. ''NA'' and the empty cell read as NULL. resource.eqtlcatalogue__dataset is the interpreted form. eQTL Catalogue release 7, CC BY 4.0; Kerimov et al. Nat Genet 2021.';
COMMENT ON COLUMN raw.eqtlcatalogue__dataset."study_id" IS 'eQTL Catalogue study accession, e.g. QTS000001.';
COMMENT ON COLUMN raw.eqtlcatalogue__dataset."dataset_id" IS 'eQTL Catalogue dataset accession, e.g. QTD000001: one study x sample group x quantification method. Unique per row within one eqtlcatalogue_release, so it is the natural key even though raw declares none.';
COMMENT ON COLUMN raw.eqtlcatalogue__dataset."study_label" IS 'Study name, e.g. Alasoo_2018, GTEx.';
COMMENT ON COLUMN raw.eqtlcatalogue__dataset."sample_group" IS 'The study''s group of samples the QTLs were mapped in, e.g. macrophage_naive.';
COMMENT ON COLUMN raw.eqtlcatalogue__dataset."tissue_id" IS 'Ontology id of the tissue or cell type, as published with an underscore: CL_0000235, UBERON_0002107, EFO_0005292 (LCL). Not a CURIE here.';
COMMENT ON COLUMN raw.eqtlcatalogue__dataset."tissue_label" IS 'Upstream''s label for tissue_id, e.g. macrophage.';
COMMENT ON COLUMN raw.eqtlcatalogue__dataset."condition_label" IS 'Stimulation or condition, e.g. naive, IFNg.';
COMMENT ON COLUMN raw.eqtlcatalogue__dataset."sample_size" IS 'Number of samples (donors) in the dataset, as text.';
COMMENT ON COLUMN raw.eqtlcatalogue__dataset."quant_method" IS 'Molecular trait quantified: ge (gene expression), exon, tx (transcript usage), txrev (txrevise events), leafcutter (splice junctions), microarray, aptamer.';
COMMENT ON COLUMN raw.eqtlcatalogue__dataset."pmid" IS 'PubMed id of the study''s publication.';
COMMENT ON COLUMN raw.eqtlcatalogue__dataset."study_type" IS '''bulk'' or ''single-cell'' (pseudobulk eQTLs).';
COMMENT ON COLUMN raw.eqtlcatalogue__dataset."eqtlcatalogue_release" IS 'eQTL Catalogue release these rows describe: the N of dataset_metadata_rN.tsv, e.g. ''7''. Raw holds every landed release; filter on this to get one.';
COMMENT ON COLUMN raw.eqtlcatalogue__dataset."landed_in" IS 'biocOnIce release that fetched these rows.';
CREATE OR REPLACE VIEW raw.eqtlcatalogue__tabix_ftp_paths AS SELECT * FROM read_parquet('./raw/eqtlcatalogue__tabix_ftp_paths.parquet');
COMMENT ON VIEW raw.eqtlcatalogue__tabix_ftp_paths IS 'eQTL Catalogue''s table of FTP paths (tabix/tabix_ftp_paths.tsv in github.com/eQTL-Catalogue/eQTL-Catalogue-resources), landed verbatim and whole as text: the only place the per-dataset file URIs are published. Its metadata columns duplicate raw.eqtlcatalogue__dataset and are the staler copy. eQTL Catalogue release 7, CC BY 4.0; Kerimov et al. Nat Genet 2021.';
COMMENT ON COLUMN raw.eqtlcatalogue__tabix_ftp_paths."study_id" IS 'eQTL Catalogue study accession, e.g. QTS000001.';
COMMENT ON COLUMN raw.eqtlcatalogue__tabix_ftp_paths."dataset_id" IS 'eQTL Catalogue dataset accession, e.g. QTD000001; joins to raw.eqtlcatalogue__dataset within one eqtlcatalogue_release.';
COMMENT ON COLUMN raw.eqtlcatalogue__tabix_ftp_paths."study_label" IS 'Study name, e.g. Alasoo_2018, GTEx.';
COMMENT ON COLUMN raw.eqtlcatalogue__tabix_ftp_paths."sample_group" IS 'The study''s group of samples the QTLs were mapped in, e.g. macrophage_naive.';
COMMENT ON COLUMN raw.eqtlcatalogue__tabix_ftp_paths."tissue_id" IS 'Ontology id of the tissue or cell type, with an underscore: CL_0000235.';
COMMENT ON COLUMN raw.eqtlcatalogue__tabix_ftp_paths."tissue_label" IS 'Upstream''s label for tissue_id, e.g. macrophage.';
COMMENT ON COLUMN raw.eqtlcatalogue__tabix_ftp_paths."condition_label" IS 'Stimulation or condition, e.g. naive, IFNg.';
COMMENT ON COLUMN raw.eqtlcatalogue__tabix_ftp_paths."sample_size" IS 'Number of samples, as text. STALE against raw.eqtlcatalogue__dataset, which upstream keeps correcting (120 of 758 differ on 2026-09-18); prefer that one.';
COMMENT ON COLUMN raw.eqtlcatalogue__tabix_ftp_paths."quant_method" IS 'Molecular trait quantified: ge, exon, tx, txrev, leafcutter, microarray, aptamer.';
COMMENT ON COLUMN raw.eqtlcatalogue__tabix_ftp_paths."ftp_path" IS 'FTP URI of the tabix-indexed summary statistics, as published.';
COMMENT ON COLUMN raw.eqtlcatalogue__tabix_ftp_paths."ftp_cs_path" IS 'FTP URI of the SuSiE credible sets file, as published.';
COMMENT ON COLUMN raw.eqtlcatalogue__tabix_ftp_paths."ftp_lbf_path" IS 'FTP URI of the SuSiE log Bayes factors file, as published.';
COMMENT ON COLUMN raw.eqtlcatalogue__tabix_ftp_paths."eqtlcatalogue_release" IS 'eQTL Catalogue release this table was landed with, e.g. ''7''. The file itself carries no release; the transform checks it names exactly that release''s datasets.';
COMMENT ON COLUMN raw.eqtlcatalogue__tabix_ftp_paths."landed_in" IS 'biocOnIce release that fetched these rows.';
CREATE OR REPLACE VIEW resource.eqtlcatalogue__dataset AS SELECT * FROM read_parquet('./resource/eqtlcatalogue__dataset.parquet');
COMMENT ON VIEW resource.eqtlcatalogue__dataset IS 'One row per eQTL Catalogue dataset: what was measured, in which tissue or cell type, from which study, and where its uniformly processed QTL summary statistics and fine-mapping results live on the EBI FTP — never the statistics themselves. A dataset dropped from a later release is closed by the ordinary merge rule. eQTL Catalogue release 7, CC BY 4.0; Kerimov et al. Nat Genet 2021.';
COMMENT ON COLUMN resource.eqtlcatalogue__dataset."dataset_id" IS 'eQTL Catalogue dataset accession, e.g. QTD000001: one study x sample group x quantification method. The business key, and the resource_id of this dataset''s rows in resource.resource_relationship.';
COMMENT ON COLUMN resource.eqtlcatalogue__dataset."study_id" IS 'eQTL Catalogue study accession, e.g. QTS000001. One study has many datasets.';
COMMENT ON COLUMN resource.eqtlcatalogue__dataset."study_label" IS 'Study name, e.g. Alasoo_2018, GTEx.';
COMMENT ON COLUMN resource.eqtlcatalogue__dataset."sample_group" IS 'The study''s group of samples the QTLs were mapped in, e.g. macrophage_naive.';
COMMENT ON COLUMN resource.eqtlcatalogue__dataset."taxon_id" IS 'NCBI taxonomy id. Always 9606: the eQTL Catalogue is human only.';
COMMENT ON COLUMN resource.eqtlcatalogue__dataset."tissue_term_id" IS 'Tissue or cell type as a CURIE, e.g. CL:0000235, UBERON:0002107; joins to ontology.term.term_id for CL, UBERON and EFO (BTO is not landed). Upstream''s tissue_id with its underscore turned into a colon. The joinable form is resource.resource_relationship (has_cell_type for CL, has_tissue otherwise).';
COMMENT ON COLUMN resource.eqtlcatalogue__dataset."tissue_label" IS 'Upstream''s label for the term, e.g. macrophage.';
COMMENT ON COLUMN resource.eqtlcatalogue__dataset."condition_label" IS 'Stimulation or condition, e.g. naive, IFNg.';
COMMENT ON COLUMN resource.eqtlcatalogue__dataset."sample_size" IS 'Number of samples (donors) the QTLs were mapped in.';
COMMENT ON COLUMN resource.eqtlcatalogue__dataset."quant_method" IS 'Molecular trait quantified: ge (gene expression), exon, tx (transcript usage), txrev (txrevise events), leafcutter (splice junctions), microarray, aptamer.';
COMMENT ON COLUMN resource.eqtlcatalogue__dataset."study_type" IS '''bulk'' or ''single-cell'' (pseudobulk eQTLs).';
COMMENT ON COLUMN resource.eqtlcatalogue__dataset."pmid" IS 'PubMed id of the study''s publication; joins to annotation.icite__publication.pmid.';
COMMENT ON COLUMN resource.eqtlcatalogue__dataset."license" IS 'Always ''CC BY 4.0'': the eQTL Catalogue''s uniform licence (ebi.ac.uk/eqtl/License).';
COMMENT ON COLUMN resource.eqtlcatalogue__dataset."sumstats_uri" IS 'FTP URI of the dataset''s tabix-indexed summary statistics, as upstream publishes it; the index is this plus ''.tbi'', and https://ftp.ebi.ac.uk serves the same path. Ends ''.all.tsv.gz'' for ge, microarray and aptamer datasets and ''.cc.tsv.gz'' for exon, tx, txrev and leafcutter ones — upstream''s choice of which file to publish per method. Referenced, never landed (about 2 GB for one ge dataset). EBI''s firewall blacklists bursty tabix clients: pace requests.';
COMMENT ON COLUMN resource.eqtlcatalogue__dataset."credible_sets_uri" IS 'FTP URI of the dataset''s SuSiE fine-mapped credible sets (.credible_sets.tsv.gz). Referenced, not landed.';
COMMENT ON COLUMN resource.eqtlcatalogue__dataset."lbf_uri" IS 'FTP URI of the dataset''s SuSiE log Bayes factors per variant (.lbf_variable.txt.gz). Referenced, not landed.';
COMMENT ON COLUMN resource.eqtlcatalogue__dataset."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN resource.eqtlcatalogue__dataset."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW raw.gwas_catalog__associations AS SELECT * FROM read_parquet('./raw/gwas_catalog__associations.parquet');
COMMENT ON VIEW raw.gwas_catalog__associations IS 'The GWAS Catalog''s ontology-annotated full associations download (gwas-catalog-associations_ontology-annotated-full.zip): one row per curated variant-trait association, with its study''s columns repeated on each. Verbatim and whole: every column as text under a snake_cased name (the column docs give upstream spellings that differ), no row dropped — whole-row duplicates included — and nothing split. The file has no quoting, so a ''"'' is data. An empty cell is read as NULL. NHGRI-EBI GWAS Catalog, release <gwas_catalog_release>, under EMBL-EBI Terms of Use (https://www.ebi.ac.uk/about/terms-of-use/): no additional restrictions on use or redistribution, attribution expected. Not a formal open licence.';
COMMENT ON COLUMN raw.gwas_catalog__associations."date_added_to_catalog" IS 'Date the study was published in the Catalog, YYYY-MM-DD.';
COMMENT ON COLUMN raw.gwas_catalog__associations."pubmed_id" IS 'PubMed id of the publication (''PUBMEDID'' / ''PUBMED ID'' upstream).';
COMMENT ON COLUMN raw.gwas_catalog__associations."first_author" IS 'First author of the publication, e.g. ''Schoeler T''.';
COMMENT ON COLUMN raw.gwas_catalog__associations."date" IS 'Publication date, YYYY-MM-DD (online date where there is one).';
COMMENT ON COLUMN raw.gwas_catalog__associations."journal" IS 'Journal, abbreviated, e.g. ''Am J Hum Genet''.';
COMMENT ON COLUMN raw.gwas_catalog__associations."link" IS 'PubMed URL of the publication, without a scheme: ''www.ncbi.nlm.nih.gov/pubmed/<id>''.';
COMMENT ON COLUMN raw.gwas_catalog__associations."study" IS 'Title of the publication. One publication is usually many studies (one per trait analysed), so this repeats across study accessions.';
COMMENT ON COLUMN raw.gwas_catalog__associations."disease_trait" IS 'The disease or trait examined, as the curator worded it from the paper. Free text; the ontology form is mapped_trait_uri.';
COMMENT ON COLUMN raw.gwas_catalog__associations."initial_sample_size" IS 'Sample size and ancestry of the discovery stage, as prose, e.g. ''43,509 European ancestry individuals''.';
COMMENT ON COLUMN raw.gwas_catalog__associations."replication_sample_size" IS 'Sample size and ancestry of the replication stage, as prose. ''NA'' and ''NR'' are the curators'' "not applicable" and "not reported", kept as published.';
COMMENT ON COLUMN raw.gwas_catalog__associations."region" IS 'Cytogenetic region of the variant, e.g. 17q21.31. NULL where the Catalog could not map the variant.';
COMMENT ON COLUMN raw.gwas_catalog__associations."chr_id" IS 'Chromosome of the variant, GRCh38. One value per SNP on a multi-SNP row, joined the way snps is ('';'' or '' x ''). NULL where unmapped.';
COMMENT ON COLUMN raw.gwas_catalog__associations."chr_pos" IS '1-based GRCh38 position of the variant. Text: a multi-SNP row carries one position per SNP, e.g. ''31157072 x 31272944''. NULL where unmapped.';
COMMENT ON COLUMN raw.gwas_catalog__associations."reported_genes" IS 'Gene(s) the authors reported for the association, '', ''-separated. ''NR'' is not reported; ''intergenic'' (either case) is the authors'' word. NULL on 926,711 of 1,192,604 rows at 2026-09-15.';
COMMENT ON COLUMN raw.gwas_catalog__associations."mapped_gene" IS 'Gene symbol(s) the Catalog''s Ensembl mapping gives the variant: the genes it overlaps, '', ''-separated, or ''UPSTREAM - DOWNSTREAM'' for an intergenic one. On a multi-SNP row each SNP''s entry is joined by '';'' or '' x '', so this is not safely splittable on any one separator (symbols contain ''-'').';
COMMENT ON COLUMN raw.gwas_catalog__associations."upstream_gene_id" IS 'Ensembl gene id of the nearest upstream gene, for an intergenic variant.';
COMMENT ON COLUMN raw.gwas_catalog__associations."downstream_gene_id" IS 'Ensembl gene id of the nearest downstream gene, for an intergenic variant.';
COMMENT ON COLUMN raw.gwas_catalog__associations."snp_gene_ids" IS 'Ensembl gene id(s) of the genes the variant lies within, '', ''-separated.';
COMMENT ON COLUMN raw.gwas_catalog__associations."upstream_gene_distance" IS 'Distance to the nearest upstream gene, in base pairs.';
COMMENT ON COLUMN raw.gwas_catalog__associations."downstream_gene_distance" IS 'Distance to the nearest downstream gene, in base pairs.';
COMMENT ON COLUMN raw.gwas_catalog__associations."strongest_snp_risk_allele" IS 'The variant and its risk or effect allele, ''rs2328895-C''; ''?'' where the allele was not reported. Multi-SNP rows list every SNP, joined as in snps.';
COMMENT ON COLUMN raw.gwas_catalog__associations."snps" IS 'The variant: an rsID on most rows, otherwise whatever the paper gave (''chr19:5831829''; 201,351 rows at 2026-09-15). NOT one SNP per row: a haplotype lists its SNPs joined by ''; '' (1,956 rows) or '', '' (127), and a SNP x SNP interaction joins two with '' x '' (3,288).';
COMMENT ON COLUMN raw.gwas_catalog__associations."merged" IS '''1'' if dbSNP has merged this rsID into another, else ''0''.';
COMMENT ON COLUMN raw.gwas_catalog__associations."snp_id_current" IS 'The current rsID, digits only, no ''rs''. Differs from snps where merged is 1. Text: a few carry a stray trailing character upstream. NULL on multi-SNP and unmapped rows.';
COMMENT ON COLUMN raw.gwas_catalog__associations."context" IS 'Most severe Ensembl VEP consequence of the variant, e.g. intron_variant.';
COMMENT ON COLUMN raw.gwas_catalog__associations."intergenic" IS '''1'' if the variant lies between genes, ''0'' if within one.';
COMMENT ON COLUMN raw.gwas_catalog__associations."risk_allele_frequency" IS 'Reported frequency of the risk allele in controls. Text because it is not always a number: ''NR'' on half the rows, ranges (''0.46-0.52''), annotations (''0.77 (EA)'').';
COMMENT ON COLUMN raw.gwas_catalog__associations."p_value" IS 'Reported p-value, as printed, e.g. ''1E-8''. Text on purpose, in the derived table too: 6,275 rows at 2026-09-15 are below the smallest double (''1E-396'') and would read as 0. Use pvalue_mlog for arithmetic.';
COMMENT ON COLUMN raw.gwas_catalog__associations."pvalue_mlog" IS '-log10 of the p-value.';
COMMENT ON COLUMN raw.gwas_catalog__associations."p_value_text" IS 'What the p-value is conditional on, in parentheses as published: ''(women)'', ''(dominant)'', ''(conditioned on rs123)''. This is what separates most repeats of one SNP within one study.';
COMMENT ON COLUMN raw.gwas_catalog__associations."or_beta" IS 'Reported odds ratio or beta coefficient (''OR or BETA'' upstream) — which one is not flagged; a unit in ci_95_text means a beta. Before 2021 the Catalog inverted every OR < 1, with its allele, so older ORs are all > 1.';
COMMENT ON COLUMN raw.gwas_catalog__associations."ci_95_text" IS 'Reported 95% confidence interval (''95% CI (TEXT)'' upstream), with the unit and direction for a beta: ''[0.015-0.034] unit decrease''. ''NA'' and ''NR'' are the curators'' "not applicable" and "not reported", kept as published.';
COMMENT ON COLUMN raw.gwas_catalog__associations."platform" IS 'Genotyping platform manufacturer and the number of SNPs passing QC (''PLATFORM [SNPS PASSING QC]'' upstream), e.g. ''Affymetrix [509492]''.';
COMMENT ON COLUMN raw.gwas_catalog__associations."cnv" IS 'Whether the study is of copy number variation. ''N'' on every row at 2026-09-15.';
COMMENT ON COLUMN raw.gwas_catalog__associations."mapped_trait" IS 'Label(s) of the ontology term(s) the Catalog mapped the trait to, '', ''-separated — and labels contain commas, so split mapped_trait_uri, not this.';
COMMENT ON COLUMN raw.gwas_catalog__associations."mapped_trait_uri" IS 'IRI(s) of the mapped ontology term(s), '', ''-separated, verbatim: EFO''s own (http://www.ebi.ac.uk/efo/EFO_0007789) and the terms EFO imports from MONDO, OBA, HP, GO, Orphanet and others. On an association row this is the association''s mapping, which can differ from its study''s.';
COMMENT ON COLUMN raw.gwas_catalog__associations."study_accession" IS 'GWAS Catalog study accession, e.g. GCST012020. One per (publication, trait analysed); the join between the two files.';
COMMENT ON COLUMN raw.gwas_catalog__associations."genotyping_technology" IS 'e.g. ''Genome-wide genotyping array'', ''Genome-wide sequencing''; several are '', ''-separated.';
COMMENT ON COLUMN raw.gwas_catalog__associations."gwas_catalog_release" IS 'The Catalog release these rows came from, YYYY-MM-DD: the dated directory under releases/ (the retrieval date if landed from anywhere else). Raw is replaced wholesale per value of this column, so more than one release can coexist.';
COMMENT ON COLUMN raw.gwas_catalog__associations."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW raw.gwas_catalog__studies AS SELECT * FROM read_parquet('./raw/gwas_catalog__studies.parquet');
COMMENT ON VIEW raw.gwas_catalog__studies IS 'The GWAS Catalog''s studies download (gwas-catalog-download-studies-v1.0.3.1.txt): one row per study accession, including the two thirds with no curated association. Verbatim and whole: every column as text under a snake_cased name (the column docs give upstream spellings that differ), no row dropped — whole-row duplicates included — and nothing split. The file has no quoting, so a ''"'' is data. An empty cell is read as NULL. NHGRI-EBI GWAS Catalog, release <gwas_catalog_release>, under EMBL-EBI Terms of Use (https://www.ebi.ac.uk/about/terms-of-use/): no additional restrictions on use or redistribution, attribution expected. Not a formal open licence.';
COMMENT ON COLUMN raw.gwas_catalog__studies."date_added_to_catalog" IS 'Date the study was published in the Catalog, YYYY-MM-DD.';
COMMENT ON COLUMN raw.gwas_catalog__studies."pubmed_id" IS 'PubMed id of the publication (''PUBMEDID'' / ''PUBMED ID'' upstream).';
COMMENT ON COLUMN raw.gwas_catalog__studies."first_author" IS 'First author of the publication, e.g. ''Schoeler T''.';
COMMENT ON COLUMN raw.gwas_catalog__studies."date" IS 'Publication date, YYYY-MM-DD (online date where there is one).';
COMMENT ON COLUMN raw.gwas_catalog__studies."journal" IS 'Journal, abbreviated, e.g. ''Am J Hum Genet''.';
COMMENT ON COLUMN raw.gwas_catalog__studies."link" IS 'PubMed URL of the publication, without a scheme: ''www.ncbi.nlm.nih.gov/pubmed/<id>''.';
COMMENT ON COLUMN raw.gwas_catalog__studies."study" IS 'Title of the publication. One publication is usually many studies (one per trait analysed), so this repeats across study accessions.';
COMMENT ON COLUMN raw.gwas_catalog__studies."disease_trait" IS 'The disease or trait examined, as the curator worded it from the paper. Free text; the ontology form is mapped_trait_uri.';
COMMENT ON COLUMN raw.gwas_catalog__studies."initial_sample_size" IS 'Sample size and ancestry of the discovery stage, as prose, e.g. ''43,509 European ancestry individuals''.';
COMMENT ON COLUMN raw.gwas_catalog__studies."replication_sample_size" IS 'Sample size and ancestry of the replication stage, as prose. ''NA'' and ''NR'' are the curators'' "not applicable" and "not reported", kept as published.';
COMMENT ON COLUMN raw.gwas_catalog__studies."platform" IS 'Genotyping platform manufacturer and the number of SNPs passing QC (''PLATFORM [SNPS PASSING QC]'' upstream), e.g. ''Affymetrix [509492]''.';
COMMENT ON COLUMN raw.gwas_catalog__studies."association_count" IS 'Number of rows this study has in the associations file. 0 for two thirds of studies: most are summary-statistics depositions with no curated top associations.';
COMMENT ON COLUMN raw.gwas_catalog__studies."mapped_trait" IS 'Label(s) of the ontology term(s) the Catalog mapped the trait to, '', ''-separated — and labels contain commas, so split mapped_trait_uri, not this.';
COMMENT ON COLUMN raw.gwas_catalog__studies."mapped_trait_uri" IS 'IRI(s) of the mapped ontology term(s), '', ''-separated, verbatim: EFO''s own (http://www.ebi.ac.uk/efo/EFO_0007789) and the terms EFO imports from MONDO, OBA, HP, GO, Orphanet and others. On an association row this is the association''s mapping, which can differ from its study''s.';
COMMENT ON COLUMN raw.gwas_catalog__studies."study_accession" IS 'GWAS Catalog study accession, e.g. GCST012020. One per (publication, trait analysed); the join between the two files.';
COMMENT ON COLUMN raw.gwas_catalog__studies."genotyping_technology" IS 'e.g. ''Genome-wide genotyping array'', ''Genome-wide sequencing''; several are '', ''-separated.';
COMMENT ON COLUMN raw.gwas_catalog__studies."submission_date" IS 'Declared by the file; empty on every row at 2026-09-15.';
COMMENT ON COLUMN raw.gwas_catalog__studies."statistical_model" IS 'Declared by the file; empty on every row at 2026-09-15.';
COMMENT ON COLUMN raw.gwas_catalog__studies."background_trait" IS 'Declared by the file; empty on every row at 2026-09-15.';
COMMENT ON COLUMN raw.gwas_catalog__studies."mapped_background_trait" IS 'Label(s) of the ontology term(s) for a trait shared by every participant (e.g. a GWAS of nephropathy within diabetics), '', ''-separated. NULL for most studies.';
COMMENT ON COLUMN raw.gwas_catalog__studies."mapped_background_trait_uri" IS 'IRI(s) of the background trait term(s), '', ''-separated, verbatim.';
COMMENT ON COLUMN raw.gwas_catalog__studies."cohort" IS 'Named cohort(s) the samples came from, ''|''-separated, e.g. ''UKB|CHARGE''. ''NA'' and ''NR'' are the curators'' "not applicable" and "not reported", kept as published.';
COMMENT ON COLUMN raw.gwas_catalog__studies."full_summary_statistics" IS '''yes'' if the Catalog hosts full summary statistics for the study.';
COMMENT ON COLUMN raw.gwas_catalog__studies."summary_stats_location" IS 'URL of the study''s summary statistics directory on the EBI FTP site; ''NA'' where there are none. Those files are not landed.';
COMMENT ON COLUMN raw.gwas_catalog__studies."gxe" IS '''yes'' if the study analyses a gene-by-environment interaction.';
COMMENT ON COLUMN raw.gwas_catalog__studies."gwas_catalog_release" IS 'The Catalog release these rows came from, YYYY-MM-DD: the dated directory under releases/ (the retrieval date if landed from anywhere else). Raw is replaced wholesale per value of this column, so more than one release can coexist.';
COMMENT ON COLUMN raw.gwas_catalog__studies."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW clinical.gwas_catalog__study AS SELECT * FROM read_parquet('./clinical/gwas_catalog__study.parquet');
COMMENT ON VIEW clinical.gwas_catalog__study IS 'GWAS Catalog studies, keyed by study accession (GCST…): one per publication and trait analysed, with the publication, the trait as reported and as mapped to EFO, sample descriptions, and where the summary statistics are. Includes studies with no curated association. Three columns the file declares but never fills stay in raw.gwas_catalog__studies; ancestry breakdowns are a separate upstream file, not landed. NHGRI-EBI GWAS Catalog, release <gwas_catalog_release>, under EMBL-EBI Terms of Use (https://www.ebi.ac.uk/about/terms-of-use/): no additional restrictions on use or redistribution, attribution expected. Not a formal open licence.';
COMMENT ON COLUMN clinical.gwas_catalog__study."study_accession" IS 'GWAS Catalog study accession, e.g. GCST012020. One per (publication, trait analysed); the join between the two files.';
COMMENT ON COLUMN clinical.gwas_catalog__study."pubmed_id" IS 'PubMed id of the publication.';
COMMENT ON COLUMN clinical.gwas_catalog__study."first_author" IS 'First author of the publication, e.g. ''Schoeler T''.';
COMMENT ON COLUMN clinical.gwas_catalog__study."publication_date" IS 'Publication date, YYYY-MM-DD (online date where there is one).';
COMMENT ON COLUMN clinical.gwas_catalog__study."journal" IS 'Journal, abbreviated, e.g. ''Am J Hum Genet''.';
COMMENT ON COLUMN clinical.gwas_catalog__study."link" IS 'PubMed URL of the publication, without a scheme: ''www.ncbi.nlm.nih.gov/pubmed/<id>''.';
COMMENT ON COLUMN clinical.gwas_catalog__study."study_title" IS 'Title of the publication. One publication is usually many studies (one per trait analysed), so this repeats across study accessions.';
COMMENT ON COLUMN clinical.gwas_catalog__study."date_added_to_catalog" IS 'Date the study was published in the Catalog, YYYY-MM-DD.';
COMMENT ON COLUMN clinical.gwas_catalog__study."disease_trait" IS 'The disease or trait examined, as the curator worded it from the paper. Free text; the ontology form is mapped_trait_ids.';
COMMENT ON COLUMN clinical.gwas_catalog__study."initial_sample_size" IS 'Sample size and ancestry of the discovery stage, as prose, e.g. ''43,509 European ancestry individuals''.';
COMMENT ON COLUMN clinical.gwas_catalog__study."replication_sample_size" IS 'Sample size and ancestry of the replication stage, as prose. ''NA'' and ''NR'' are the curators'' "not applicable" and "not reported", kept as published.';
COMMENT ON COLUMN clinical.gwas_catalog__study."platform" IS 'Genotyping platform manufacturer and the number of SNPs passing QC (''PLATFORM [SNPS PASSING QC]'' upstream), e.g. ''Affymetrix [509492]''.';
COMMENT ON COLUMN clinical.gwas_catalog__study."genotyping_technology" IS 'e.g. ''Genome-wide genotyping array'', ''Genome-wide sequencing''; several are '', ''-separated.';
COMMENT ON COLUMN clinical.gwas_catalog__study."cohort" IS 'Named cohort(s) the samples came from, ''|''-separated, e.g. ''UKB|CHARGE''. ''NA'' and ''NR'' are the curators'' "not applicable" and "not reported", kept as published.';
COMMENT ON COLUMN clinical.gwas_catalog__study."association_count" IS 'Number of curated associations the Catalog holds for this study, by its own count. 0 for two thirds of studies: most are summary-statistics depositions with no curated top associations. It counts the associations file''s whole-row duplicates, so for 39 studies at 2026-09-15 it exceeds their rows in clinical.gwas_catalog__association.';
COMMENT ON COLUMN clinical.gwas_catalog__study."mapped_trait" IS 'Label(s) of the mapped ontology term(s), '', ''-separated as published. For reading; labels contain commas, so join on mapped_trait_ids.';
COMMENT ON COLUMN clinical.gwas_catalog__study."mapped_trait_ids" IS 'CURIEs of the ontology term(s) the Catalog mapped the trait to, sorted: EFO:0007789, MONDO:0005148, OBA:…, HP:…. Normalised from the IRIs in raw exactly as ontology.term.term_id is, and every one is a term EFO defines or imports, so unnest and join ontology.term on ontology = ''efo''. An id that is not PREFIX_digits (…/OBA_VT0001253, …/NCIT_C95746; 62 distinct at 2026-09-15) stays the full IRI, because that is how ontology.term carries it. NULL where the Catalog mapped nothing.';
COMMENT ON COLUMN clinical.gwas_catalog__study."mapped_background_trait" IS 'Label(s) of the ontology term(s) for a trait shared by every participant (e.g. a GWAS of nephropathy within diabetics), '', ''-separated. NULL for most studies.';
COMMENT ON COLUMN clinical.gwas_catalog__study."mapped_background_trait_ids" IS 'CURIEs of the background trait term(s), sorted; same form and join as mapped_trait_ids. NULL for most studies.';
COMMENT ON COLUMN clinical.gwas_catalog__study."full_summary_statistics" IS 'True if the Catalog hosts full summary statistics for the study.';
COMMENT ON COLUMN clinical.gwas_catalog__study."summary_stats_location" IS 'URL of the study''s summary statistics directory on the EBI FTP site; ''NA'' where there are none. Those files are not landed.';
COMMENT ON COLUMN clinical.gwas_catalog__study."gxe" IS 'True if the study analyses a gene-by-environment interaction.';
COMMENT ON COLUMN clinical.gwas_catalog__study."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN clinical.gwas_catalog__study."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW clinical.gwas_catalog__association AS SELECT * FROM read_parquet('./clinical/gwas_catalog__association.parquet');
COMMENT ON VIEW clinical.gwas_catalog__association IS 'Curated variant-trait associations from the GWAS Catalog (p < 1e-5 in the source paper), one row per association. A row is NOT one SNP: haplotype and SNP x SNP interaction rows name several in snps / snp_ids, and their position and gene columns are joined the same way. One study can report one SNP several times (per sex, model or conditional analysis, see p_value_text), so count rows, not (study, SNP) pairs. Traits are lists of EFO-form CURIEs: unnest mapped_trait_ids and join ontology.term on ontology = ''efo''. Study-level columns are in clinical.gwas_catalog__study, on study_accession. The file''s whole-row duplicates are collapsed here and kept in raw. Human, GRCh38. NHGRI-EBI GWAS Catalog, release <gwas_catalog_release>, under EMBL-EBI Terms of Use (https://www.ebi.ac.uk/about/terms-of-use/): no additional restrictions on use or redistribution, attribution expected. Not a formal open licence.';
COMMENT ON COLUMN clinical.gwas_catalog__association."association_key" IS 'md5 of the nine curated columns — study_accession, snps, strongest_snp_risk_allele, p_value, p_value_text, or_beta, ci_95_text, risk_allele_frequency, reported_genes — joined by U+001F with NULL as empty. The download publishes no association id and no smaller set of columns is unique (one study reports one SNP under several models or strata), so an association is identified by what was curated from the paper. A curation fix to any of the nine therefore reads as one association retired and another opened; a change to the Catalog''s mapping columns is a new version under the same key. Not an upstream identifier.';
COMMENT ON COLUMN clinical.gwas_catalog__association."study_accession" IS 'GWAS Catalog study accession; joins clinical.gwas_catalog__study, which holds the publication, reported trait and sample columns.';
COMMENT ON COLUMN clinical.gwas_catalog__association."snps" IS 'The variant: an rsID on most rows, otherwise whatever the paper gave (''chr19:5831829''; 201,351 rows at 2026-09-15). NOT one SNP per row: a haplotype lists its SNPs joined by ''; '' (1,956 rows) or '', '' (127), and a SNP x SNP interaction joins two with '' x '' (3,288).';
COMMENT ON COLUMN clinical.gwas_catalog__association."snp_ids" IS 'The individual variants in snps, split on its three separators, distinct and sorted: one element on an ordinary row, several for a haplotype or interaction. For list_contains(snp_ids, ''rs7903146''); which separator joined them is only in snps.';
COMMENT ON COLUMN clinical.gwas_catalog__association."strongest_snp_risk_allele" IS 'The variant and its risk or effect allele, ''rs2328895-C''; ''?'' where the allele was not reported. Multi-SNP rows list every SNP, joined as in snps.';
COMMENT ON COLUMN clinical.gwas_catalog__association."p_value" IS 'Reported p-value, as printed, e.g. ''1E-8''. Text on purpose, in the derived table too: 6,275 rows at 2026-09-15 are below the smallest double (''1E-396'') and would read as 0. Use pvalue_mlog for arithmetic.';
COMMENT ON COLUMN clinical.gwas_catalog__association."pvalue_mlog" IS '-log10 of the p-value.';
COMMENT ON COLUMN clinical.gwas_catalog__association."p_value_text" IS 'What the p-value is conditional on, in parentheses as published: ''(women)'', ''(dominant)'', ''(conditioned on rs123)''. This is what separates most repeats of one SNP within one study.';
COMMENT ON COLUMN clinical.gwas_catalog__association."or_beta" IS 'Reported odds ratio or beta coefficient (''OR or BETA'' upstream) — which one is not flagged; a unit in ci_95_text means a beta. Before 2021 the Catalog inverted every OR < 1, with its allele, so older ORs are all > 1.';
COMMENT ON COLUMN clinical.gwas_catalog__association."ci_95_text" IS 'Reported 95% confidence interval (''95% CI (TEXT)'' upstream), with the unit and direction for a beta: ''[0.015-0.034] unit decrease''. ''NA'' and ''NR'' are the curators'' "not applicable" and "not reported", kept as published.';
COMMENT ON COLUMN clinical.gwas_catalog__association."risk_allele_frequency" IS 'Reported frequency of the risk allele in controls. Text because it is not always a number: ''NR'' on half the rows, ranges (''0.46-0.52''), annotations (''0.77 (EA)'').';
COMMENT ON COLUMN clinical.gwas_catalog__association."reported_genes" IS 'Gene(s) the authors reported for the association, '', ''-separated. ''NR'' is not reported; ''intergenic'' (either case) is the authors'' word. NULL on 926,711 of 1,192,604 rows at 2026-09-15.';
COMMENT ON COLUMN clinical.gwas_catalog__association."region" IS 'Cytogenetic region of the variant, e.g. 17q21.31. NULL where the Catalog could not map the variant.';
COMMENT ON COLUMN clinical.gwas_catalog__association."chr_id" IS 'Chromosome of the variant, GRCh38. One value per SNP on a multi-SNP row, joined the way snps is ('';'' or '' x ''). NULL where unmapped.';
COMMENT ON COLUMN clinical.gwas_catalog__association."chr_pos" IS '1-based GRCh38 position of the variant. Text: a multi-SNP row carries one position per SNP, e.g. ''31157072 x 31272944''. NULL where unmapped.';
COMMENT ON COLUMN clinical.gwas_catalog__association."context" IS 'Most severe Ensembl VEP consequence of the variant, e.g. intron_variant.';
COMMENT ON COLUMN clinical.gwas_catalog__association."intergenic" IS 'True if the variant lies between genes. NULL where unmapped.';
COMMENT ON COLUMN clinical.gwas_catalog__association."mapped_gene" IS 'Gene symbol(s) the Catalog''s Ensembl mapping gives the variant: the genes it overlaps, '', ''-separated, or ''UPSTREAM - DOWNSTREAM'' for an intergenic one. On a multi-SNP row each SNP''s entry is joined by '';'' or '' x '', so this is not safely splittable on any one separator (symbols contain ''-'').';
COMMENT ON COLUMN clinical.gwas_catalog__association."snp_gene_ids" IS 'Ensembl gene ids of the genes the variant lies within, in published order; joins annotation.gene. NULL for an intergenic variant — see upstream_gene_id / downstream_gene_id.';
COMMENT ON COLUMN clinical.gwas_catalog__association."upstream_gene_id" IS 'Ensembl gene id of the nearest upstream gene, for an intergenic variant.';
COMMENT ON COLUMN clinical.gwas_catalog__association."upstream_gene_distance" IS 'Distance to the nearest upstream gene, in base pairs.';
COMMENT ON COLUMN clinical.gwas_catalog__association."downstream_gene_id" IS 'Ensembl gene id of the nearest downstream gene, for an intergenic variant.';
COMMENT ON COLUMN clinical.gwas_catalog__association."downstream_gene_distance" IS 'Distance to the nearest downstream gene, in base pairs.';
COMMENT ON COLUMN clinical.gwas_catalog__association."merged" IS 'True if dbSNP has merged this rsID into another; snp_id_current is then the survivor.';
COMMENT ON COLUMN clinical.gwas_catalog__association."snp_id_current" IS 'The current rsID, digits only, no ''rs''. Differs from snps where merged is 1. Text: a few carry a stray trailing character upstream. NULL on multi-SNP and unmapped rows.';
COMMENT ON COLUMN clinical.gwas_catalog__association."mapped_trait" IS 'Label(s) of the mapped ontology term(s), '', ''-separated as published. For reading; labels contain commas, so join on mapped_trait_ids.';
COMMENT ON COLUMN clinical.gwas_catalog__association."mapped_trait_ids" IS 'CURIEs of the ontology term(s) the Catalog mapped this association''s trait to, sorted; same form and join as clinical.gwas_catalog__study.mapped_trait_ids, and usually but not always the same terms as the study''s (196 studies differ at 2026-09-15). NULL on the few rows the Catalog left unmapped.';
COMMENT ON COLUMN clinical.gwas_catalog__association."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN clinical.gwas_catalog__association."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW raw.rnacentral__id_mapping AS SELECT * FROM read_parquet('./raw/rnacentral__id_mapping.parquet');
COMMENT ON VIEW raw.rnacentral__id_mapping IS 'RNAcentral''s id_mapping.tsv.gz landed verbatim and whole: one row per cross-reference from an RNAcentral sequence to a member database''s record, every organism and every database (264M rows in release 27, 86% of them ENA), so it lands streamed in batches. Sorted by urs upstream, not by taxon. Holds the LATEST release only, a deliberate narrowing of the raw layer''s per-version rule: older releases stay immutable under RNAcentral''s releases/NN.0/. Licence CC0 from RNAcentral release 20 (https://rnacentral.org/license). Caveat: some member databases (GeneCards, MalaCards) are commercially licensed upstream, so CC0 here rests on RNAcentral''s blanket assertion; this file holds identifiers, taxon, RNA type and gene name only, and its readme carries no carve-out.';
COMMENT ON COLUMN raw.rnacentral__id_mapping."urs" IS 'RNAcentral unique RNA sequence id, e.g. URS0000626831: one per distinct sequence, shared by every organism the sequence occurs in. The species-specific id RNAcentral annotates is urs || ''_'' || taxon_id. File column 1; the file has no header, so the names are ours.';
COMMENT ON COLUMN raw.rnacentral__id_mapping."database" IS 'The member (''Expert'') database asserting the cross-reference, upper-case as published: ENA, RFAM, ENSEMBL, ENSEMBL_GENCODE, REFSEQ, MIRBASE, HGNC, … (56 values in release 27). File column 2.';
COMMENT ON COLUMN raw.rnacentral__id_mapping."external_id" IS 'The sequence''s identifier in `database`, exactly as published, e.g. MI0008195, HGNC:35391, ENST00000408549 (ENSEMBL ids are transcripts), NR_031728 (RefSeq, unversioned), or ENA''s accession:range:feature composite ''GU786683.1:1..200:rRNA''. File column 3.';
COMMENT ON COLUMN raw.rnacentral__id_mapping."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.';
COMMENT ON COLUMN raw.rnacentral__id_mapping."rna_type" IS 'RNAcentral''s RNA type for this sequence in this organism, in the INSDC vocabulary: tRNA, rRNA, lncRNA, pre_miRNA, miRNA, snoRNA, … One value per (urs, taxon_id) in release 27. File column 5.';
COMMENT ON COLUMN raw.rnacentral__id_mapping."gene_name" IS 'What the member database calls the gene, where it says: a symbol (MIR1827), an Ensembl gene id (ENSG00000221476.2), a locus tag, or for Rfam a sequence range. A label of this cross-reference, not of the RNA. NULL where the file''s cell is empty (86% of rows); the literal string ''null'' on two ENA rows is upstream''s and is kept. File column 6.';
COMMENT ON COLUMN raw.rnacentral__id_mapping."rnacentral_release" IS 'RNAcentral release these rows were read from, e.g. ''27''.';
COMMENT ON COLUMN raw.rnacentral__id_mapping."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW annotation.rnacentral__rna AS SELECT * FROM read_parquet('./annotation/rnacentral__rna.parquet');
COMMENT ON VIEW annotation.rnacentral__rna IS 'One row per non-coding RNA sequence per organism, as RNAcentral types it: the ncRNA coverage OrgDb lacks. Reach Ensembl transcripts, RefSeq, miRBase, Rfam, HGNC, MGI, GtRNAdb and the other member databases through annotation.identifier_mapping (source = ''RNACENTRAL''). Gene names stay in raw.rnacentral__id_mapping: they label a cross-reference, not the RNA. Licence CC0, resting on RNAcentral''s blanket assertion (see the raw table''s comment).';
COMMENT ON COLUMN annotation.rnacentral__rna."urs_taxid" IS 'RNAcentral species-specific sequence id, e.g. URS0000626831_9606: the sequence id, an underscore, the taxon. RNAcentral''s unit of annotation, and the source_id of this RNA''s rows in annotation.identifier_mapping (source_namespace = ''RNACENTRAL''). Part of the merge key.';
COMMENT ON COLUMN annotation.rnacentral__rna."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.';
COMMENT ON COLUMN annotation.rnacentral__rna."rna_type" IS 'RNAcentral''s RNA type, in the INSDC vocabulary: tRNA, rRNA, lncRNA, pre_miRNA, miRNA, snoRNA, snRNA, piRNA, circRNA, … (''other'' and ''misc_RNA'' are upstream''s catch-alls).';
COMMENT ON COLUMN annotation.rnacentral__rna."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN annotation.rnacentral__rna."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW raw.biogrid__interactions AS SELECT * FROM read_parquet('./raw/biogrid__interactions.parquet');
COMMENT ON VIEW raw.biogrid__interactions IS 'BioGRID''s BIOGRID-ALL tab3 file landed verbatim and whole: every organism, every column as text, one row per curated interaction evidence. ''-'' upstream reads as NULL; nothing is split. Holds the LATEST release only, the narrowing raw.icite__metadata makes: every release stays citable under BioGRID''s Release-Archive. BioGRID data: The MIT License (MIT). Copyright © 2005 Mike Tyers Lab. Permission is hereby granted, free of charge, to any person obtaining a copy of this software, download files, and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.';
COMMENT ON COLUMN raw.biogrid__interactions."biogrid_interaction_id" IS '''#BioGRID Interaction ID'', e.g. 253053. One per curated interaction evidence; unique on every row of a release and stable across releases (checked 5.0.255 -> 5.0.261), so it is the natural key.';
COMMENT ON COLUMN raw.biogrid__interactions."entrez_gene_a" IS '''Entrez Gene Interactor A'', e.g. 7157. NULL (''-'' upstream) for the interactors BioGRID has no Entrez gene for (7,076 rows in 5.0.261).';
COMMENT ON COLUMN raw.biogrid__interactions."entrez_gene_b" IS '''Entrez Gene Interactor B''. As entrez_gene_a.';
COMMENT ON COLUMN raw.biogrid__interactions."biogrid_id_a" IS '''BioGRID ID Interactor A'': BioGRID''s own interactor id, e.g. 113010. Always present.';
COMMENT ON COLUMN raw.biogrid__interactions."biogrid_id_b" IS '''BioGRID ID Interactor B''.';
COMMENT ON COLUMN raw.biogrid__interactions."systematic_name_a" IS '''Systematic Name Interactor A'': the organism database''s locus name, e.g. YFL039C.';
COMMENT ON COLUMN raw.biogrid__interactions."systematic_name_b" IS '''Systematic Name Interactor B''.';
COMMENT ON COLUMN raw.biogrid__interactions."official_symbol_a" IS '''Official Symbol Interactor A'', e.g. TP53.';
COMMENT ON COLUMN raw.biogrid__interactions."official_symbol_b" IS '''Official Symbol Interactor B'', e.g. MDM2.';
COMMENT ON COLUMN raw.biogrid__interactions."synonyms_a" IS '''Synonyms Interactor A'', ''|''-separated as published.';
COMMENT ON COLUMN raw.biogrid__interactions."synonyms_b" IS '''Synonyms Interactor B'', ''|''-separated as published.';
COMMENT ON COLUMN raw.biogrid__interactions."experimental_system" IS '''Experimental System'': BioGRID''s own evidence vocabulary, e.g. ''Affinity Capture-Western'', ''Two-hybrid'', ''Synthetic Lethality''. Not a PSI-MI term.';
COMMENT ON COLUMN raw.biogrid__interactions."experimental_system_type" IS '''Experimental System Type'': ''physical'' or ''genetic''.';
COMMENT ON COLUMN raw.biogrid__interactions."author" IS '''Author'': first author and year, e.g. ''Zhang Y (2003)''.';
COMMENT ON COLUMN raw.biogrid__interactions."publication_source" IS '''Publication Source'': ''PUBMED:<pmid>'', or ''DOI:<doi>'' for preprints.';
COMMENT ON COLUMN raw.biogrid__interactions."organism_id_a" IS '''Organism ID Interactor A'': NCBI taxonomy id, as text.';
COMMENT ON COLUMN raw.biogrid__interactions."organism_id_b" IS '''Organism ID Interactor B'': NCBI taxonomy id, as text.';
COMMENT ON COLUMN raw.biogrid__interactions."throughput" IS '''Throughput'': ''Low Throughput'', ''High Throughput'', or both ''|''-separated.';
COMMENT ON COLUMN raw.biogrid__interactions."score" IS '''Score'': the study''s own confidence score, where it published one. The scale is per study, not comparable across rows.';
COMMENT ON COLUMN raw.biogrid__interactions."modification" IS '''Modification'': the post-translational modification for Biochemical Activity rows, e.g. Phosphorylation.';
COMMENT ON COLUMN raw.biogrid__interactions."qualifications" IS '''Qualifications'': curator free-text notes on the evidence.';
COMMENT ON COLUMN raw.biogrid__interactions."tags" IS '''Tags'': BioGRID curation-project tags, ''|''-separated.';
COMMENT ON COLUMN raw.biogrid__interactions."source_database" IS '''Source Database'': who curated the record — BIOGRID, or a partner (FLYBASE, WORMBASE, POMBASE, BAR).';
COMMENT ON COLUMN raw.biogrid__interactions."swissprot_a" IS '''SWISS-PROT Accessions Interactor A'', ''|''-separated.';
COMMENT ON COLUMN raw.biogrid__interactions."trembl_a" IS '''TREMBL Accessions Interactor A'', ''|''-separated.';
COMMENT ON COLUMN raw.biogrid__interactions."refseq_a" IS '''REFSEQ Accessions Interactor A'' (proteins), ''|''-separated.';
COMMENT ON COLUMN raw.biogrid__interactions."swissprot_b" IS '''SWISS-PROT Accessions Interactor B'', ''|''-separated.';
COMMENT ON COLUMN raw.biogrid__interactions."trembl_b" IS '''TREMBL Accessions Interactor B'', ''|''-separated.';
COMMENT ON COLUMN raw.biogrid__interactions."refseq_b" IS '''REFSEQ Accessions Interactor B'' (proteins), ''|''-separated.';
COMMENT ON COLUMN raw.biogrid__interactions."ontology_term_ids" IS '''Ontology Term IDs'': phenotype/cell-line terms qualifying the evidence, ''|''-separated.';
COMMENT ON COLUMN raw.biogrid__interactions."ontology_term_names" IS '''Ontology Term Names'', parallel to ontology_term_ids.';
COMMENT ON COLUMN raw.biogrid__interactions."ontology_term_categories" IS '''Ontology Term Categories'', parallel to ontology_term_ids.';
COMMENT ON COLUMN raw.biogrid__interactions."ontology_term_qualifier_ids" IS '''Ontology Term Qualifier IDs'', parallel to ontology_term_ids.';
COMMENT ON COLUMN raw.biogrid__interactions."ontology_term_qualifier_names" IS '''Ontology Term Qualifier Names'', parallel to ontology_term_ids.';
COMMENT ON COLUMN raw.biogrid__interactions."ontology_term_types" IS '''Ontology Term Types'', parallel to ontology_term_ids.';
COMMENT ON COLUMN raw.biogrid__interactions."organism_name_a" IS '''Organism Name Interactor A'', e.g. Homo sapiens.';
COMMENT ON COLUMN raw.biogrid__interactions."organism_name_b" IS '''Organism Name Interactor B''.';
COMMENT ON COLUMN raw.biogrid__interactions."biogrid_version" IS 'BioGRID release the file came from, e.g. ''5.0.261'', from the file name.';
COMMENT ON COLUMN raw.biogrid__interactions."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW raw.intact__mitab AS SELECT * FROM read_parquet('./raw/intact__mitab.parquet');
COMMENT ON VIEW raw.intact__mitab IS 'IntAct''s PSI-MI MITAB 2.7 export (psimitab/intact.zip: intact.txt and intact_negative.txt) landed verbatim and whole: every organism and molecule type, all 42 columns as text, one row per binary interaction evidence — n-ary interactions arrive spoke-expanded, several rows under one interaction AC. Cells are MITAB ''db:id(text)'' entries, ''|''-separated, and stay unsplit; ''-'' upstream reads as NULL. Holds the LATEST release only, like raw.biogrid__interactions: dated releases stay frozen on the EBI FTP. Attribution: IntAct (EMBL-EBI), CC BY 4.0; del Toro et al. NAR 2022.';
COMMENT ON COLUMN raw.intact__mitab."id_a" IS '''#ID(s) interactor A'': the primary identifier as ''db:id'', e.g. uniprotkb:P04637, chebi:"CHEBI:15422", intact:EBI-123. One value per row in practice.';
COMMENT ON COLUMN raw.intact__mitab."id_b" IS '''ID(s) interactor B''. NULL (''-'' upstream) for a single-participant interaction such as autophosphorylation (324 rows on 2026-01-09).';
COMMENT ON COLUMN raw.intact__mitab."alt_ids_a" IS '''Alt. ID(s) interactor A'': secondary accessions and other databases'' ids for A, ''|''-separated ''db:id''.';
COMMENT ON COLUMN raw.intact__mitab."alt_ids_b" IS '''Alt. ID(s) interactor B''. As alt_ids_a.';
COMMENT ON COLUMN raw.intact__mitab."aliases_a" IS '''Alias(es) interactor A'': names as ''db:name(name type)'', e.g. uniprotkb:TP53(gene name), ''|''-separated.';
COMMENT ON COLUMN raw.intact__mitab."aliases_b" IS '''Alias(es) interactor B''. As aliases_a.';
COMMENT ON COLUMN raw.intact__mitab."detection_methods" IS '''Interaction detection method(s)'': PSI-MI term, e.g. psi-mi:"MI:0018"(two hybrid).';
COMMENT ON COLUMN raw.intact__mitab."first_authors" IS '''Publication 1st author(s)'', e.g. ''Puthalakath et al. (1999)''.';
COMMENT ON COLUMN raw.intact__mitab."publication_ids" IS '''Publication Identifier(s)'': ''pubmed:<pmid>'', ''imex:IM-…'', ''doi:…'', ''mint:…'', ''|''-separated. ''pubmed:unassigned…'' marks a paper with no PMID yet.';
COMMENT ON COLUMN raw.intact__mitab."taxid_a" IS '''Taxid interactor A'': ''taxid:9606(human)|taxid:9606(Homo sapiens)'' — one id, short and full label. -1 is ''in vitro'', -2 ''chemical synthesis''. NULL for small molecules.';
COMMENT ON COLUMN raw.intact__mitab."taxid_b" IS '''Taxid interactor B''. As taxid_a.';
COMMENT ON COLUMN raw.intact__mitab."interaction_types" IS '''Interaction type(s)'': PSI-MI term, e.g. psi-mi:"MI:0915"(physical association).';
COMMENT ON COLUMN raw.intact__mitab."source_databases" IS '''Source database(s)'': the curating IMEx member as a PSI-MI term — IntAct, MINT, UniProt, DIP, MatrixDB and others.';
COMMENT ON COLUMN raw.intact__mitab."interaction_ids" IS '''Interaction identifier(s)'': ''intact:EBI-…'' always, then ''imex:IM-…'', ''mint:…'', ''dip:…'' where assigned. The intact: AC is shared by every binary row expanded from one n-ary interaction.';
COMMENT ON COLUMN raw.intact__mitab."confidence_values" IS '''Confidence value(s)'': ''intact-miscore:0.51'' and any author scores, ''|''-separated.';
COMMENT ON COLUMN raw.intact__mitab."expansion_methods" IS '''Expansion method(s)'': psi-mi:"MI:1060"(spoke expansion) when the row was generated from an n-ary interaction; NULL for a true binary one.';
COMMENT ON COLUMN raw.intact__mitab."biological_roles_a" IS '''Biological role(s) interactor A'': PSI-MI term, e.g. enzyme, enzyme target, unspecified role.';
COMMENT ON COLUMN raw.intact__mitab."biological_roles_b" IS '''Biological role(s) interactor B''.';
COMMENT ON COLUMN raw.intact__mitab."experimental_roles_a" IS '''Experimental role(s) interactor A'': PSI-MI term — bait, prey, neutral component.';
COMMENT ON COLUMN raw.intact__mitab."experimental_roles_b" IS '''Experimental role(s) interactor B''.';
COMMENT ON COLUMN raw.intact__mitab."interactor_types_a" IS '''Type(s) interactor A'': PSI-MI term — protein, small molecule, messenger rna, deoxyribonucleic acid, gene, molecule set and others.';
COMMENT ON COLUMN raw.intact__mitab."interactor_types_b" IS '''Type(s) interactor B''.';
COMMENT ON COLUMN raw.intact__mitab."xrefs_a" IS '''Xref(s) interactor A'': GO, Ensembl, InterPro and other cross-references, ''|''-separated.';
COMMENT ON COLUMN raw.intact__mitab."xrefs_b" IS '''Xref(s) interactor B''.';
COMMENT ON COLUMN raw.intact__mitab."interaction_xrefs" IS '''Interaction Xref(s)'': cross-references of the interaction itself, e.g. GO or PDB.';
COMMENT ON COLUMN raw.intact__mitab."annotations_a" IS '''Annotation(s) interactor A'': ''topic:text'' curator annotations.';
COMMENT ON COLUMN raw.intact__mitab."annotations_b" IS '''Annotation(s) interactor B''.';
COMMENT ON COLUMN raw.intact__mitab."interaction_annotations" IS '''Interaction annotation(s)'': ''topic:text'' — figure legend, dataset, comment, curation depth.';
COMMENT ON COLUMN raw.intact__mitab."host_organisms" IS '''Host organism(s)'': taxid of the organism the experiment was performed in.';
COMMENT ON COLUMN raw.intact__mitab."interaction_parameters" IS '''Interaction parameter(s)'': kinetic or affinity measurements, e.g. kd.';
COMMENT ON COLUMN raw.intact__mitab."creation_date" IS '''Creation date'' of the record at IntAct, YYYY/MM/DD.';
COMMENT ON COLUMN raw.intact__mitab."update_date" IS '''Update date'' of the record at IntAct, YYYY/MM/DD.';
COMMENT ON COLUMN raw.intact__mitab."checksums_a" IS '''Checksum(s) interactor A'': rogid and crc64 of the sequence.';
COMMENT ON COLUMN raw.intact__mitab."checksums_b" IS '''Checksum(s) interactor B''.';
COMMENT ON COLUMN raw.intact__mitab."interaction_checksums" IS '''Interaction Checksum(s)'': intact-crc and rigid.';
COMMENT ON COLUMN raw.intact__mitab."negative" IS '''Negative'': ''true'' for an interaction shown NOT to occur (the rows of intact_negative.txt), ''false'' otherwise.';
COMMENT ON COLUMN raw.intact__mitab."features_a" IS '''Feature(s) interactor A'': binding sites, tags, mutations with their ranges.';
COMMENT ON COLUMN raw.intact__mitab."features_b" IS '''Feature(s) interactor B''.';
COMMENT ON COLUMN raw.intact__mitab."stoichiometry_a" IS '''Stoichiometry(s) interactor A''.';
COMMENT ON COLUMN raw.intact__mitab."stoichiometry_b" IS '''Stoichiometry(s) interactor B''.';
COMMENT ON COLUMN raw.intact__mitab."identification_methods_a" IS '''Identification method participant A'': PSI-MI term for how the participant was identified.';
COMMENT ON COLUMN raw.intact__mitab."identification_methods_b" IS '''Identification method participant B''.';
COMMENT ON COLUMN raw.intact__mitab."intact_version" IS 'IntAct release the files came from: the dated FTP directory, e.g. ''2026-01-09''.';
COMMENT ON COLUMN raw.intact__mitab."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW annotation.interaction AS SELECT * FROM read_parquet('./annotation/interaction.parquet');
COMMENT ON VIEW annotation.interaction IS 'Molecular interaction evidence, stacked across interaction databases: one row per evidence (one experiment in one publication) per pair, each in its source''s own identifier space — Entrez genes for BIOGRID, mostly UniProtKB proteins for INTACT. The same pair recurs once per paper, method and direction; count distinct pairs, not rows. A/B order is as published, so search both orders. Genetic (BIOGRID) and negative (INTACT) rows are included and flagged. IntAct rows: IntAct (EMBL-EBI), CC BY 4.0; del Toro et al. NAR 2022. BioGRID data: The MIT License (MIT). Copyright © 2005 Mike Tyers Lab. Permission is hereby granted, free of charge, to any person obtaining a copy of this software, download files, and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.';
COMMENT ON COLUMN annotation.interaction."source" IS 'The asserting interaction database, from the controlled writer vocabulary: ''BIOGRID'' or ''INTACT''. Part of the business key and of every writer''s merge scope, so the databases stack in one table and neither can retire the other''s rows (ADR-0004). An experiment curated by both appears once per source; nothing is de-duplicated across them.';
COMMENT ON COLUMN annotation.interaction."interaction_id" IS 'The source''s own id for the interaction evidence: the BioGRID Interaction ID, e.g. ''253053'', or the IntAct interaction AC, e.g. ''EBI-526131''. Stable across releases in both. One row per id under BIOGRID; under INTACT an n-ary interaction is several rows sharing one id (see expansion_method).';
COMMENT ON COLUMN annotation.interaction."interactor_a_namespace" IS 'Identifier authority of interactor_a_id, in the SOURCE''s native space — nothing is mapped. BIOGRID: ''ENTREZ'', or ''BIOGRID'' for the few interactors with no Entrez gene. INTACT: ''UNIPROT'' (95%), ''INTACT'', ''CHEBI'', ''ENSEMBL'' and a tail of others, upstream''s database name upper-cased. To compare sources, map through annotation.identifier_mapping.';
COMMENT ON COLUMN annotation.interaction."interactor_a_id" IS 'Interactor A, e.g. ''7157'' (ENTREZ) or ''P04637'' (UNIPROT; isoform and chain suffixes such as ''P04637-2'' kept). A/B order is as published and is meaningful — for bait-prey methods BioGRID puts the bait in A — so a symmetric lookup must test both orders.';
COMMENT ON COLUMN annotation.interaction."interactor_b_namespace" IS 'Identifier authority of interactor_b_id. As interactor_a_namespace.';
COMMENT ON COLUMN annotation.interaction."interactor_b_id" IS 'Interactor B. Equal to A for a self-interaction, including IntAct''s single-participant interactions (autophosphorylation), which upstream publishes with an empty B.';
COMMENT ON COLUMN annotation.interaction."taxon_id_a" IS 'NCBI taxonomy id of interactor A. NULL for small molecules and for IntAct''s pseudo-taxa (''in vitro'', ''chemical synthesis'').';
COMMENT ON COLUMN annotation.interaction."taxon_id_b" IS 'NCBI taxonomy id of interactor B; differs from taxon_id_a for a cross-species (e.g. host-pathogen) interaction.';
COMMENT ON COLUMN annotation.interaction."detection_method_id" IS 'PSI-MI id of the detection method, e.g. ''MI:0018''. NULL under BIOGRID, whose tab3 file carries its own vocabulary instead.';
COMMENT ON COLUMN annotation.interaction."detection_method" IS 'Detection method label: the PSI-MI term name under INTACT (''two hybrid''), BioGRID''s Experimental System under BIOGRID (''Two-hybrid'', ''Affinity Capture-Western''). The two vocabularies are not aligned.';
COMMENT ON COLUMN annotation.interaction."interaction_type_id" IS 'PSI-MI id of the interaction type, e.g. ''MI:0915''. NULL under BIOGRID.';
COMMENT ON COLUMN annotation.interaction."interaction_type" IS 'Interaction type label: a PSI-MI term under INTACT (''physical association'', ''direct interaction'', ''phosphorylation reaction''); ''physical'' or ''genetic'' under BIOGRID. A genetic interaction is not evidence of physical contact.';
COMMENT ON COLUMN annotation.interaction."expansion_method" IS '''spoke expansion'' when the row was generated from an n-ary interaction (bait paired with each prey), so the pair was co-purified rather than shown to bind directly; NULL for a binary interaction as reported. Always NULL under BIOGRID, which does not flag it.';
COMMENT ON COLUMN annotation.interaction."negative" IS 'True when the evidence is that the interaction does NOT occur (IntAct''s negative file, ~1,000 rows). Filter on it before counting a row as an interaction. Always false under BIOGRID.';
COMMENT ON COLUMN annotation.interaction."pubmed_id" IS 'PubMed id of the publication reporting the evidence. NULL where the source has none (preprints; IntAct''s ''unassigned'' papers).';
COMMENT ON COLUMN annotation.interaction."doi" IS 'DOI of the publication, lower-cased, where the source gives one: BioGRID only when there is no PMID, IntAct alongside it.';
COMMENT ON COLUMN annotation.interaction."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN annotation.interaction."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW raw.complexportal__complex AS SELECT * FROM read_parquet('./raw/complexportal__complex.parquet');
COMMENT ON VIEW raw.complexportal__complex IS 'Every Complex Portal ComplexTab file of a release — one per species, plus the predicted human complexes — landed verbatim and whole: all 19 columns as text, one row per complex, nothing split. ''-'' upstream reads as NULL. Replaced per complexportal_version, so versions accumulate. Licence CC0.';
COMMENT ON COLUMN raw.complexportal__complex."complex_ac" IS '''#Complex ac'', e.g. CPX-663. Unique across every file of a release, so it is the natural key even though raw declares none.';
COMMENT ON COLUMN raw.complexportal__complex."recommended_name" IS '''Recommended name'' of the complex.';
COMMENT ON COLUMN raw.complexportal__complex."aliases" IS '''Aliases for complex'', ''|''-separated.';
COMMENT ON COLUMN raw.complexportal__complex."taxonomy_identifier" IS '''Taxonomy identifier'': NCBI taxonomy id, as text. For a host-pathogen complex this is the pathogen''s.';
COMMENT ON COLUMN raw.complexportal__complex."participants" IS '''Identifiers (and stoichiometry) of molecules in complex'': ''ac(n)'' entries, ''|''-separated — UniProtKB, ChEBI, RNAcentral or CPX- (a sub-complex) accessions; (0) means stoichiometry unknown; ''[P02400,P05319](1)'' is a molecule set, alternatives for one position.';
COMMENT ON COLUMN raw.complexportal__complex."evidence_code" IS '''Evidence Code'': one ECO term as ''ECO:0000353(label)''.';
COMMENT ON COLUMN raw.complexportal__complex."experimental_evidence" IS '''Experimental evidence'': the supporting IntAct interaction, EMDB or PDB entry, e.g. intact:EBI-8000888.';
COMMENT ON COLUMN raw.complexportal__complex."go_annotations" IS '''Go Annotations'': ''GO:0045892(label)'' entries, ''|''-separated.';
COMMENT ON COLUMN raw.complexportal__complex."cross_references" IS '''Cross references'': ''db:id(qualifier)'' entries, ''|''-separated — PubMed, wwPDB, EMDB, Reactome, the complex''s own primary AC.';
COMMENT ON COLUMN raw.complexportal__complex."description" IS '''Description'': curated function summary.';
COMMENT ON COLUMN raw.complexportal__complex."complex_properties" IS '''Complex properties'': curated structural and biophysical notes.';
COMMENT ON COLUMN raw.complexportal__complex."complex_assembly" IS '''Complex assembly'', e.g. Heterodimer, Homotetramer.';
COMMENT ON COLUMN raw.complexportal__complex."ligand" IS '''Ligand'': bound ligands, as published.';
COMMENT ON COLUMN raw.complexportal__complex."disease" IS '''Disease'': associated diseases with their xrefs, as published.';
COMMENT ON COLUMN raw.complexportal__complex."agonist" IS '''Agonist'', as published.';
COMMENT ON COLUMN raw.complexportal__complex."antagonist" IS '''Antagonist'', as published.';
COMMENT ON COLUMN raw.complexportal__complex."comment" IS '''Comment'': curator free text.';
COMMENT ON COLUMN raw.complexportal__complex."source" IS '''Source'': the curating database as a PSI-MI term, e.g. psi-mi:"MI:0469"(IntAct), psi-mi:"MI:2424"(HuMap).';
COMMENT ON COLUMN raw.complexportal__complex."expanded_participants" IS '''Expanded participant list'': participants with every sub-complex flattened into its members. Same ''ac(n)'' form as participants.';
COMMENT ON COLUMN raw.complexportal__complex."file" IS 'The complextab file the row came from, e.g. ''9606.tsv''. ''9606_predicted.tsv'' is the only marker of a predicted complex.';
COMMENT ON COLUMN raw.complexportal__complex."complexportal_version" IS 'Complex Portal release: the dated FTP directory, e.g. ''2026-01-09''.';
COMMENT ON COLUMN raw.complexportal__complex."landed_in" IS 'The biocOnIce release whose ingest landed these rows.';
CREATE OR REPLACE VIEW annotation.complexportal__complex AS SELECT * FROM read_parquet('./annotation/complexportal__complex.parquet');
COMMENT ON VIEW annotation.complexportal__complex IS 'Macromolecular complexes from Complex Portal (EMBL-EBI), one row per complex across 28 species: name, evidence, GO annotation and function. Manually curated complexes and hu.MAP predictions share the table; `predicted` tells them apart. Members are in annotation.complexportal__participant. Licence CC0.';
COMMENT ON COLUMN annotation.complexportal__complex."complex_ac" IS 'Complex Portal accession, e.g. ''CPX-663''. Stable; the key.';
COMMENT ON COLUMN annotation.complexportal__complex."taxon_id" IS 'NCBI taxonomy id of the complex. For a host-pathogen complex this is the pathogen''s, so it is not necessarily every participant''s.';
COMMENT ON COLUMN annotation.complexportal__complex."name" IS 'Recommended name, e.g. ''TP53-MDM4 transcription regulation complex''. NULL for nearly every predicted complex, which upstream leaves unnamed.';
COMMENT ON COLUMN annotation.complexportal__complex."aliases" IS 'Other names, ''|''-separated as published.';
COMMENT ON COLUMN annotation.complexportal__complex."predicted" IS 'True for a machine-learning prediction (hu.MAP, human only; 15,284 of 20,579 in 2026-01-09), false for a manually curated complex. Filter on it: the two are not the same kind of evidence.';
COMMENT ON COLUMN annotation.complexportal__complex."evidence_code" IS 'ECO id of the evidence for the complex, e.g. ''ECO:0000353'' (physical interaction evidence), ''ECO:0005544'' (inferred by orthology), ''ECO:0008004'' (machine learning).';
COMMENT ON COLUMN annotation.complexportal__complex."evidence" IS 'The ECO term''s label.';
COMMENT ON COLUMN annotation.complexportal__complex."experimental_evidence" IS 'The supporting experimental record as ''db:id'', e.g. ''intact:EBI-8000888''. NULL for inferred and predicted complexes.';
COMMENT ON COLUMN annotation.complexportal__complex."assembly" IS 'Assembly type, e.g. Heterodimer. NULL where not curated.';
COMMENT ON COLUMN annotation.complexportal__complex."go_annotations" IS 'GO terms as ''GO:0045892(label)'', ''|''-separated as published. Not yet exploded.';
COMMENT ON COLUMN annotation.complexportal__complex."cross_references" IS 'Cross-references as ''db:id(qualifier)'', ''|''-separated as published: PubMed, wwPDB, EMDB, Reactome.';
COMMENT ON COLUMN annotation.complexportal__complex."description" IS 'Curated summary of the complex''s function.';
COMMENT ON COLUMN annotation.complexportal__complex."properties" IS 'Curated structural and biophysical notes.';
COMMENT ON COLUMN annotation.complexportal__complex."ligand" IS 'Bound ligands, as published.';
COMMENT ON COLUMN annotation.complexportal__complex."disease" IS 'Associated diseases with their xrefs, as published.';
COMMENT ON COLUMN annotation.complexportal__complex."agonist" IS 'Agonists, as published.';
COMMENT ON COLUMN annotation.complexportal__complex."antagonist" IS 'Antagonists, as published.';
COMMENT ON COLUMN annotation.complexportal__complex."comment" IS 'Curator free text.';
COMMENT ON COLUMN annotation.complexportal__complex."curated_by" IS 'The database that curated (or predicted) the complex, e.g. IntAct, UniProt, Saccharomyces Genome Database, HuMap.';
COMMENT ON COLUMN annotation.complexportal__complex."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN annotation.complexportal__complex."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW annotation.complexportal__participant AS SELECT * FROM read_parquet('./annotation/complexportal__participant.parquet');
COMMENT ON VIEW annotation.complexportal__participant IS 'Members of each Complex Portal complex, one row per (complex, molecule), in Complex Portal''s identifier space — nothing is mapped to genes. Find the complexes a protein belongs to by UniProt accession; a complex with N members is N rows, not N*(N-1)/2 pairs. Licence CC0.';
COMMENT ON COLUMN annotation.complexportal__participant."complex_ac" IS 'Complex Portal accession; join to annotation.complexportal__complex.';
COMMENT ON COLUMN annotation.complexportal__participant."participant_id" IS 'The member molecule in Complex Portal''s own identifier space: a UniProtKB accession (''P04637''; isoform ''P04637-2'' and processed-chain ''-PRO_…'' suffixes kept), ''CHEBI:29105'', an RNAcentral ''URS…_9606'', or ''CPX-…'' for a sub-complex, which is NOT flattened into its members.';
COMMENT ON COLUMN annotation.complexportal__participant."participant_namespace" IS 'Authority of participant_id, read off its form: ''UNIPROT'' (98%), ''CHEBI'', ''COMPLEXPORTAL'', ''RNACENTRAL'', ''INTACT''. NULL for the handful of ids that match none (GenBank nucleotide accessions).';
COMMENT ON COLUMN annotation.complexportal__participant."stoichiometry" IS 'Copies of the participant in the complex. NULL where unknown, which upstream prints as (0) — most rows, and every predicted complex.';
COMMENT ON COLUMN annotation.complexportal__participant."molecule_set" IS 'The set as published, e.g. ''[P02400,P05319]'', when this participant is one of several interchangeable molecules filling a single position: each member is its own row carrying the same set and the position''s stoichiometry. NULL for an ordinary participant.';
COMMENT ON COLUMN annotation.complexportal__participant."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.';
COMMENT ON COLUMN annotation.complexportal__participant."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.';
CREATE OR REPLACE VIEW annotation.signature_taxon AS SELECT * FROM read_parquet('./annotation/signature_taxon.parquet');
COMMENT ON VIEW annotation.signature_taxon IS 'BugSigDB signature <-> NCBI taxon bridge: one row per taxon member of a curated signature, exploded from the two positionally-matched member-list columns of the BugSigDB full dump. Each member is reported at the rank the curators asserted (taxon_rank), with no rollup to a fixed rank; join ncbitaxon_id to a taxonomy for that. Study, experiment and contrast attributes are not in this table. Licence CC BY 4.0 (BugSigDB).';
COMMENT ON COLUMN annotation.signature_taxon."bsdb_id" IS 'BugSigDB signature id, e.g. ''bsdb:83/1/1'' (the ''bsdb:'' prefix is part of the value). Part of the key; recurs once per member of the signature.';
COMMENT ON COLUMN annotation.signature_taxon."member_index" IS '1-based position of this member in the signature''s curated member list. Part of the key: (bsdb_id, member_index) is the grain. Not stable across BugSigDB versions if curators reorder a signature.';
COMMENT ON COLUMN annotation.signature_taxon."taxon_rank" IS 'MetaPhlAn rank letter of the asserted taxon: k (kingdom), p, c, o, f, g, s (species), or t (strain). The rank the curators reported the member at, not rolled up to a fixed rank; a signature mixes ranks.';
COMMENT ON COLUMN annotation.signature_taxon."taxon_name" IS 'Name of the asserted taxon with its rank prefix stripped, e.g. ''Anaerostipes caccae'' from ''s__Anaerostipes caccae''. MetaPhlAn''s spelling, which may lag NCBI''s current name.';
COMMENT ON COLUMN annotation.signature_taxon."ncbitaxon_id" IS 'NCBI Taxonomy id of the asserted taxon: the last element of the member''s lineage ids. Bare local id (bioregistry prefix ncbitaxon). Not part of the key: two members of one signature may resolve to the same taxon.';
COMMENT ON COLUMN annotation.signature_taxon."taxon_lineage" IS 'The member''s full MetaPhlAn lineage verbatim, ''|''-separated with k__/p__/.../s__ prefixes. Kept for provenance; taxon_name/taxon_rank are its leaf.';
COMMENT ON COLUMN annotation.signature_taxon."taxon_lineage_ids" IS 'The member''s NCBI Taxonomy ids up its lineage, ''|''-separated, in the same rank order as taxon_lineage. Kept verbatim; ncbitaxon_id is its last element.';
CREATE OR REPLACE VIEW raw.metadata AS SELECT * FROM read_parquet('./raw/metadata.parquet');
CREATE OR REPLACE VIEW annotation.pubmed__article AS SELECT * FROM read_parquet('./annotation/pubmed__article.parquet');
COMMENT ON VIEW annotation.pubmed__article IS 'PubMed citations, one row per PMID: title, abstract, journal, authors, MeSH terms, references and grants, from the cdsci-lake table lake.omicidx.pubmed_article. Join on pmid with ncbi__gene_pubmed, icite__publication and pubtator3__mention.';
COMMENT ON COLUMN annotation.pubmed__article."pmid" IS 'PubMed id, e.g. ''35000000''; the key.';
COMMENT ON COLUMN annotation.pubmed__article."title" IS 'Article title (English, or translated to English).';
COMMENT ON COLUMN annotation.pubmed__article."issue" IS 'Volume and issue as ''volume(issue)'', e.g. ''54(4)''.';
COMMENT ON COLUMN annotation.pubmed__article."pages" IS 'Pagination as printed, e.g. ''501-511''.';
COMMENT ON COLUMN annotation.pubmed__article."abstract" IS 'Abstract text.';
COMMENT ON COLUMN annotation.pubmed__article."journal" IS 'Full journal title.';
COMMENT ON COLUMN annotation.pubmed__article."authors" IS 'Authors in byline order; identifier is an ORCID URL where given.';
COMMENT ON COLUMN annotation.pubmed__article."pubdate" IS 'Publication date as precise as the record gives: ''YYYY'', ''YYYY-MM'' or ''YYYY-MM-DD''.';
COMMENT ON COLUMN annotation.pubmed__article."mesh_terms" IS 'MeSH headings, ''; ''-separated, each ''Dnnnnnn:Heading'' followed by '' / Qnnnnnn:Qualifier'' pairs; ''*'' marks a major topic.';
COMMENT ON COLUMN annotation.pubmed__article."publication_types" IS 'Publication types, ''; ''-separated ''Dnnnnnn:Type''.';
COMMENT ON COLUMN annotation.pubmed__article."chemical_list" IS 'Substances, ''; ''-separated ''Dnnnnnn:Name''.';
COMMENT ON COLUMN annotation.pubmed__article."keywords" IS 'Author keywords, ''; ''-separated.';
COMMENT ON COLUMN annotation.pubmed__article."doi" IS 'DOI, without the ''https://doi.org/'' prefix.';
COMMENT ON COLUMN annotation.pubmed__article."references" IS 'Cited works as listed; pmid where PubMed resolved one.';
COMMENT ON COLUMN annotation.pubmed__article."languages" IS 'Article language code(s), e.g. ''eng''.';
COMMENT ON COLUMN annotation.pubmed__article."vernacular_title" IS 'Title in the original language.';
COMMENT ON COLUMN annotation.pubmed__article."date_completed" IS 'Date MEDLINE indexing was completed, ''YYYY-MM-DD''.';
COMMENT ON COLUMN annotation.pubmed__article."date_revised" IS 'Date the record was last revised, ''YYYY-MM-DD''.';
COMMENT ON COLUMN annotation.pubmed__article."pmc" IS 'PubMed Central id.';
COMMENT ON COLUMN annotation.pubmed__article."other_id" IS 'Other ids the record carries.';
COMMENT ON COLUMN annotation.pubmed__article."medline_ta" IS 'NLM title abbreviation of the journal, e.g. ''Amino Acids''.';
COMMENT ON COLUMN annotation.pubmed__article."nlm_unique_id" IS 'NLM catalog id of the journal.';
COMMENT ON COLUMN annotation.pubmed__article."issn_linking" IS 'Linking ISSN of the journal.';
COMMENT ON COLUMN annotation.pubmed__article."country" IS 'Country of the journal''s publisher.';
COMMENT ON COLUMN annotation.pubmed__article."grant_ids" IS 'Funding: grant number, acronym, agency and its country.';
|