-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.imaging_level4_HMS_orion_r4`
(
  CellID INT64 OPTIONS(description="Unique cell identifier in a specific image"),
  Hoechst FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  AF1 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  CD31 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  Ki_67 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  CD68 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  CD163 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  CD20 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  CD4 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  CD8a FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  CD45RO FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  PD_L1 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  CD3e FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  E_Cadherin FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  PD_1 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  FOXP3 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  CD45 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  Pan_CK FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  Blank FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  SMA FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  X_centroid FLOAT64 OPTIONS(description="X-position of the centroid calculated as the center of mass of the cell."),
  Y_centroid FLOAT64 OPTIONS(description="Y-position of the centroid calculated as the center of mass of the cell."),
  Area INT64 OPTIONS(description="Actual number of pixels in the region, returned as a scalar."),
  MajorAxisLength FLOAT64 OPTIONS(description="Length (in pixels) of the major axis of the ellipse that has the same normalized second central moments as the region, returned as a scalar."),
  MinorAxisLength FLOAT64 OPTIONS(description="Length (in pixels) of the minor axis of the ellipse that has the same normalized second central moments as the region, returned as a scalar."),
  Eccentricity FLOAT64 OPTIONS(description="Eccentricity of the ellipse that has the same second-moments as the region, returned as a scalar. The eccentricity is the ratio of the distance between the foci of the ellipse and its major axis length. The value is between 0 and 1. (0 and 1 are degenerate cases. An ellipse whose eccentricity is 0 is actually a circle, while an ellipse whose eccentricity is 1 is a line segment.)"),
  Solidity FLOAT64 OPTIONS(description="Proportion of the pixels in the convex hull that are also in the region, returned as a scalar. Computed as Area/ConvexArea."),
  Extent FLOAT64 OPTIONS(description="Ratio of pixels in the region to pixels in the total bounding box, returned as a scalar. Computed as the Area divided by the area of the bounding box."),
  Orientation FLOAT64 OPTIONS(description="Angle between the x-axis and the major axis of the ellipse that has the same second-moments as the region, returned as a scalar. The value is in degrees, ranging from −90 degrees to 90 degrees."),
  Source_filename STRING OPTIONS(description="Name of file record was derived from"),
  Source_entityId STRING OPTIONS(description="Synapse ID of source file"),
  HTAN_Center STRING OPTIONS(description="Name of HTAN Center e.g. HTAN HTAPP"),
  HTAN_Data_File_ID STRING OPTIONS(description="Self-identifier for this data file - HTAN ID of this file HTAN ID SOP (eg HTANx_yyy_zzz)"),
  HTAN_Biospecimen_ID STRING OPTIONS(description="HTAN ID associated with a biosample based on HTAN ID SOP (eg HTANx_yyy_zzz)"),
  Argo550 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker")
)
OPTIONS(
  friendly_name="HTAN HMS IMAGING LEVEL 4 DATA - ORION R4 VERSIONED",
  description="Data was derived in October 2023 from 75 RareCyte Orion Imaging Level 4 csv files submitted by the HMS HTAN center. For more information see: https://www.cell.com/cell/fulltext/S0092-8674(22)01571-9",
  labels=[("access", "open"), ("data_type", "cell_spatial_characterization"), ("program", "htan"), ("source", "htan-hms"), ("category", "processed_-omics_data"), ("status", "current")]
);

INSERT INTO `isb-cgc-bq.HTAN_versioned.imaging_level4_HMS_orion_r4` (CellID, Hoechst, AF1, CD31, Ki_67, CD68, CD163, CD20, CD4, CD8a, CD45RO, PD_L1, CD3e, E_Cadherin, PD_1, FOXP3, CD45, Pan_CK, Blank, SMA, X_centroid, Y_centroid, Area, MajorAxisLength, MinorAxisLength, Eccentricity, Solidity, Extent, Orientation, Source_filename, Source_entityId, HTAN_Center, HTAN_Data_File_ID, HTAN_Biospecimen_ID, Argo550) VALUES (1462992, 2137.1484375, 386.67578125, 220.91015625, 376.7890625, 292.8203125, 181.37109375, 229.6640625, 270.21875, 233.64453125, 472.375, 336.8203125, 293.14453125, 703.68359375, 291.7109375, 216.55859375, 269.70703125, 3659.02734375, nan, 185.7890625, 9272.91015625, 53094.03125, 256, 25.088105420054564, 13.351205602551548, 0.8466358032213521, 0.927536231884058, 0.7032967032967034, 0.0109059537401925, 'P37_S82-CRC39.csv', 'syn51613872', 'HTAN HMS', 'HTA7_917_1006', 'HTA7_917_6', 217.09375), (1463182, 3273.6171875, 375.09765625, 221.81640625, 564.81640625, 319.41796875, 145.59375, 224.41015625, 266.3359375, 229.4375, 440.58203125, 288.86328125, 351.8671875, 1076.52734375, 343.671875, 218.6875, 245.37890625, 1528.796875, nan, 199.81640625, 4866.96484375, 53095.625, 256, 24.10476980146608, 14.769150193145984, 0.7903105030529111, 0.8533333333333334, 0.5925925925925926, -1.5092669612364251, 'P37_S82-CRC39.csv', 'syn51613872', 'HTAN HMS', 'HTA7_917_1006', 'HTA7_917_6', 215.6953125), (1463633, 5843.4453125, 311.3984375, 237.8984375, 394.03125, 261.86328125, 167.0546875, 230.78125, 257.30859375, 221.16796875, 368.43359375, 262.09765625, 314.328125, 911.90625, 306.18359375, 210.2421875, 256.1875, 765.4921875, nan, 206.96484375, 2714.1484375, 53117.125, 256, 32.27347934460037, 10.341421175600244, 0.9472718805215422, 0.8767123287671232, 0.5019607843137255, -0.4161104262522436, 'P37_S82-CRC39.csv', 'syn51613872', 'HTAN HMS', 'HTA7_917_1006', 'HTA7_917_6', 211.83203125), (1463643, 5437.609375, 342.09375, 244.73046875, 404.65625, 303.92578125, 211.13671875, 233.41015625, 283.36328125, 615.23046875, 607.9375, 348.79296875, 930.27734375, 767.16796875, 645.09375, 207.3515625, 1487.48828125, 1357.60546875, nan, 177.0625, 9966.125, 53111.16796875, 256, 27.747779584864944, 12.680568287506969, 0.8894697860551912, 0.839344262295082, 0.5182186234817814, -1.0869574826098145, 'P37_S82-CRC39.csv', 'syn51613872', 'HTAN HMS', 'HTA7_917_1006', 'HTA7_917_6', 232.546875), (1463782, 3701.03125, 345.78515625, 235.92578125, 238.390625, 456.90625, 232.6015625, 241.33203125, 269.47265625, 225.4453125, 407.69921875, 468.1796875, 240.0390625, 221.0390625, 239.078125, 211.4140625, 868.515625, 266.5, nan, 165.48828125, 14522.69921875, 53115.81640625, 256, 21.372876916664648, 15.591289744561015, 0.683991987332744, 0.9552238805970148, 0.7111111111111111, -0.6156756877686341, 'P37_S82-CRC39.csv', 'syn51613872', 'HTAN HMS', 'HTA7_917_1006', 'HTA7_917_6', 215.9375);