-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.imaging_level4_TNP_TMA_phase1_r4`
(
  CellID INT64 OPTIONS(description="Unique cell identifier in a specific image"),
  DNA FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  Autofluorescence_488nm FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  Autofluorescence_555nm FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  Autofluorescence_647nm FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  DNA_2 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  Control_488nm FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  Control_555nm FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  Control_647nm FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  DNA_3 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  CD3 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  ERK_1_pT202_pY204 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  hRAD51 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  DNA_4 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  G1_S_specific_cyclin_D1 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  Vimentin FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  Aortic_smooth_muscle_actin FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  DNA_5 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  E_cadherin FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  ER FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  PR FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  DNA_6 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  Epidermal_growth_factor_receptor FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  Rb_pS807_pS811 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  HER2 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  DNA_7 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  Antigen_Ki67 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  CD45 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  p21 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  DNA_8 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  CK_14 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  CK_19 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  CK_17 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  DNA_9 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  Lamin_A_B_C FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  Androgen_Receptor FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  Histone_H2AX FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  DNA_10 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  PCNA FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  Pan_cytokeratin FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  CD31 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)"),
  PD_L1_SP142 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  Granzyme_B FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  CD68 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  CD3d FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  CD8a FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  CD163 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  CD14 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  CD4 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  FOXP3 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  PD_L1_E1L3N FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  CD11b FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  PD_1 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  PD_L1_28_8 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  LAG_3 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  CD20 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  HLA_A FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker"),
  MHC_class_II_antigen_DPB1 FLOAT64 OPTIONS(description="Mean intensity of pixels for specified marker")
)
OPTIONS(
  friendly_name="HTAN TNP TMA IMAGING LEVEL 4 DATA - PHASE 1 R4 VERSIONED",
  description="Data was derived in October 2023 from 352 Imaging Level 4 csv files submitted by the TNP TMA HTAN center.",
  labels=[("access", "open"), ("data_type", "cell_spatial_characterization"), ("program", "htan"), ("source", "htan-tnp-tma"), ("category", "processed_-omics_data"), ("status", "current")]
);

INSERT INTO `isb-cgc-bq.HTAN_versioned.imaging_level4_TNP_TMA_phase1_r4` (CellID, DNA, Autofluorescence_488nm, Autofluorescence_555nm, Autofluorescence_647nm, DNA_2, Control_488nm, Control_555nm, Control_647nm, DNA_3, CD3, ERK_1_pT202_pY204, hRAD51, DNA_4, G1_S_specific_cyclin_D1, Vimentin, Aortic_smooth_muscle_actin, DNA_5, E_cadherin, ER, PR, DNA_6, Epidermal_growth_factor_receptor, Rb_pS807_pS811, HER2, DNA_7, Antigen_Ki67, CD45, p21, DNA_8, CK_14, CK_19, CK_17, DNA_9, Lamin_A_B_C, Androgen_Receptor, Histone_H2AX, DNA_10, PCNA, Pan_cytokeratin, CD31, X_centroid, Y_centroid, Area, MajorAxisLength, MinorAxisLength, Eccentricity, Solidity, Extent, Orientation, Source_filename, Source_entityId, HTAN_Center, HTAN_Data_File_ID, HTAN_Biospecimen_ID, PD_L1_SP142, Granzyme_B, CD68, CD3d, CD8a, CD163, CD14, CD4, FOXP3, PD_L1_E1L3N, CD11b, PD_1, PD_L1_28_8, LAG_3, CD20, HLA_A, MHC_class_II_antigen_DPB1) VALUES (196, 25702.11475409836, 958.344262295082, 151.81147540983608, 455.4590163934426, 13806.82786885246, 1124.450819672131, 196.8852459016393, 465.1967213114754, 33582.57377049181, 1440.4016393442623, nan, nan, 22736.54098360656, nan, nan, 698.311475409836, 16206.868852459016, nan, nan, nan, 23452.467213114756, nan, 454.1147540983607, nan, 11693.745901639344, 960.860655737705, 886.3524590163935, nan, 12493.33606557377, nan, nan, nan, 393.9590163934426, 734.2377049180328, nan, nan, 237.37704918032787, nan, 33609.852459016394, nan, 1119.114754098361, 195.9016393442623, 122, 16.46455969353043, 10.024330759740412, 0.7932907959731468, 0.8905109489051095, 0.6777777777777778, -1.2140951026706708, 'OHSU_TMA1_005-A10_OHSU_TMA1_005-A10-cellRingMask.csv', 'syn52044560', 'HTAN TNP - TMA', 'HTA14_10_1072', 'HTA14_10_13', 505.6147540983607, 892.844262295082, 967.0081967213116, 837.6475409836065, 706.983606557377, 1530.770491803279, 5926.704918032787, 858.0491803278688, 191.89344262295083, 1162.385245901639, 1265.450819672131, 1345.5245901639344, 294.9344262295082, 633.7786885245902, 1411.688524590164, 104.11475409836063, 579.2295081967213), (566, 13153.417475728156, 1214.0, 230.126213592233, 449.2718446601942, 8837.864077669903, 1272.9805825242718, 240.33009708737865, 400.8932038834951, 18272.825242718445, 1812.7087378640776, nan, nan, 12846.26213592233, nan, nan, 11611.941747572817, 10669.029126213592, nan, nan, nan, 15916.504854368932, nan, 538.3592233009708, nan, 10684.990291262136, 1085.1359223300972, 878.9611650485436, nan, 17998.436893203885, nan, nan, nan, 854.5436893203884, 748.0873786407767, nan, nan, 429.1650485436893, nan, 3686.78640776699, nan, 1420.5825242718447, 247.4368932038835, 103, 13.200442299629152, 10.267438810033536, 0.628499224902892, 0.9363636363636364, 0.6602564102564102, 0.5014974798511009, 'OHSU_TMA1_005-A10_OHSU_TMA1_005-A10-cellRingMask.csv', 'syn52044560', 'HTAN TNP - TMA', 'HTA14_10_1072', 'HTA14_10_13', 1254.1941747572816, 875.504854368932, 1032.757281553398, 843.3009708737864, 719.0582524271845, 1727.3106796116506, 8598.533980582524, 1068.252427184466, 379.6990291262136, 1207.9611650485438, 1431.9223300970873, 1380.6990291262136, 285.07766990291265, 636.6407766990292, 1448.5436893203882, 103.09708737864078, 584.8640776699029), (617, 19258.380952380958, 882.7777777777778, 127.92063492063492, 447.25396825396825, 10537.412698412698, 1031.6666666666667, 169.015873015873, 431.6984126984127, 24623.761904761905, 1386.4444444444443, nan, nan, 17364.238095238095, nan, nan, 542.0, 12674.063492063491, nan, nan, nan, 19578.92063492064, nan, 476.07936507936506, nan, 14525.111111111111, 947.2857142857144, 868.9206349206349, nan, 19672.603174603173, nan, nan, nan, 8954.301587301587, 5462.6984126984125, nan, nan, 5076.380952380952, nan, 13606.380952380952, nan, 1299.4920634920634, 253.36507936507937, 63, 10.020607444961971, 8.655299474821796, 0.5039206018537538, 0.84, 0.7, 1.4430920604778217, 'OHSU_TMA1_005-A10_OHSU_TMA1_005-A10-cellRingMask.csv', 'syn52044560', 'HTAN TNP - TMA', 'HTA14_10_1072', 'HTA14_10_13', 451.8412698412698, 861.8253968253969, 918.0793650793652, 765.7142857142857, 655.1587301587301, 1492.079365079365, 6963.9047619047615, 863.2222222222222, 198.7142857142857, 1173.6666666666667, 1319.7936507936508, 1377.2222222222222, 500.8253968253968, 1398.2380952380952, 1901.253968253968, 151.3968253968254, 777.7301587301587), (890, 22280.629032258064, 934.1693548387096, 135.18548387096774, 439.991935483871, 11579.67741935484, 1032.6693548387098, 172.7016129032258, 397.5967741935484, 26539.20967741936, 1351.491935483871, nan, nan, 18434.25, nan, nan, 635.7903225806451, 13663.806451612903, nan, nan, nan, 20289.60483870968, nan, 491.0887096774193, nan, 14213.258064516129, 935.9112903225806, 859.9032258064516, nan, 18106.89516129032, nan, nan, nan, 7032.290322580645, 4802.935483870968, nan, nan, 2864.709677419354, nan, 11184.75, nan, 1251.766129032258, 283.1693548387097, 124, 13.91206789844695, 11.704328578598023, 0.5405566641849194, 0.953846153846154, 0.6358974358974359, -1.32592048553149, 'OHSU_TMA1_005-A10_OHSU_TMA1_005-A10-cellRingMask.csv', 'syn52044560', 'HTAN TNP - TMA', 'HTA14_10_1072', 'HTA14_10_13', 441.3387096774193, 856.741935483871, 938.1370967741937, 799.4596774193549, 660.8145161290323, 1509.975806451613, 6874.895161290323, 872.8709677419355, 198.1935483870968, 1180.9435483870968, 1332.0887096774193, 1402.217741935484, 516.6209677419355, 1545.7903225806451, 1799.1774193548388, 151.83870967741936, 739.2903225806451), (1302, 29418.127118644068, 1005.084745762712, 142.34745762711864, 440.4406779661017, 15294.737288135591, 1157.7118644067796, 189.77966101694915, 328.6949152542373, 33419.08474576271, 1519.3050847457628, nan, nan, 25827.27118644068, nan, nan, 1029.872881355932, 17930.127118644068, nan, nan, nan, 30470.1186440678, nan, 538.2542372881356, nan, 19524.737288135595, 1025.3135593220338, 905.271186440678, nan, 6406.169491525424, nan, nan, nan, 443.3813559322034, 812.0, nan, nan, 250.1864406779661, nan, 335.042372881356, nan, 1445.050847457627, 311.45762711864404, 118, 13.75596432439219, 10.99421858210616, 0.6010215056438221, 0.9076923076923076, 0.6483516483516484, 0.5195361297680456, 'OHSU_TMA1_005-A10_OHSU_TMA1_005-A10-cellRingMask.csv', 'syn52044560', 'HTAN TNP - TMA', 'HTA14_10_1072', 'HTA14_10_13', 658.1864406779661, 858.9322033898305, 1110.3813559322034, 742.4322033898305, 610.6949152542373, 1712.7203389830509, 9147.78813559322, 1082.6949152542372, 219.2457627118644, 1184.6186440677966, 1535.949152542373, 1301.584745762712, 286.0508474576271, 565.4830508474577, 1359.1440677966102, 97.72033898305084, 582.3220338983051);