Skip to content

GUDMAP example

Hongsuda edited this page Jan 8, 2019 · 1 revision
"tables": {
  "Common.Gene": {
    "annotations": {
      "tag:isrd.isi.edu,2019:environments":{
        "definitions": {
          "columns": true,
          "fkeys": true,
          "sources": [
      	    {
              "Imaging_Data" : [
                { "inbound" : ["Gene_Expression", "Specimen_Gene_Association_NCBI_GeneID_fkey" ] },
                { "outbound" : ["Gene_Expression", "Specimen_Gene_Association_Specimen_RID_fkey" ] },
                { "outbound" : ["Gene_Expression", "Specimen_Representative_Image_fkey" ] },			
                "RID"
	      ],
	      "entity": true,
	      "markdown_name": "Imaging Data",
	      "aggregate": "array_d"
	    },
      	    {
              "Min_Stage" : [
                { "inbound" : ["Gene_Expression", "Specimen_Gene_Association_NCBI_GeneID_fkey" ] },
                { "outbound" : ["Gene_Expression", "Specimen_Gene_Association_Specimen_RID_fkey" ] },
                { "outbound" : ["Gene_Expression", "Specimen_Stage_ID_fkey" ] },			
                "RID"
	      ],
	      "entity": true,
	      "markdown_name": "Min Stage",
	      "aggregate": "array_d",
	      "display": {
		"row_order" : [{"column": "Ordinal"}, "descending":true],
		"page_size" : 1
	      }
	    },
      	    {
              "Max_Stage" : [
                { "inbound" : ["Gene_Expression", "Specimen_Gene_Association_NCBI_GeneID_fkey" ] },
                { "outbound" : ["Gene_Expression", "Specimen_Gene_Association_Specimen_RID_fkey" ] },
                { "outbound" : ["Gene_Expression", "Specimen_Stage_ID_fkey" ] },			
                "RID"
	      ],
	      "entity": true,
	      "markdown_name": "Max Stage",
	      "aggregate": "array_d",
	      "display": {
		"row_order" : [{"column": "Ordinal"}, "descending":false],
		"page_size" : 1
	      }
	    }
          ]
        },
        "active": {
          "compact" : {
            "columns": true, // all columns defined in the env? 
            "fkeys": true, // all fks defined in the env?
            ]
          },
          "compact" : {
            "columns": true, 
            "fkeys": true, 
            "sourcekeys": [ 
	      "Imaging_Data", "Min_Stage", "Max_Stage"
            ]
          }
      }, //env
      
      "tag:isrd.isi.edu,2016:visible-columns" : {      
        "compact" : [
          "NCBI_Symbol",
          [ "Common", "Gene_Species_fkey"],
          "Description",
	  "Specimen_Expression_Data",
	  "Array_Data",
      	  {
            "sourcekey" : "Imaging_Data",
	    "required_sourcekeys" : ["Imaging_Data"]
	    "display" : {
	      "template_engine": "handlebars",
	      "markdown_pattern" : "{{#each Imaging_Data}} [:span:{{{this.values.Stage}}} :/span:{.pseudo-column-rowname-thumbnail-title}![{{{this.values.Specimen_RID}}}]({{{this.values.Thumbnail_URL}}}){height=75}](/chaise/record/#{{{$catalog.snapshot}}}/Gene_Expression:Specimen/RID={{{this.values.Specimen_RID}}}){.pseudo-column-rowname-thumbnail-link} {{/each}}",
	      "row_markdown_pattern" : "[:span:{{{Stage}}} :/span:{.pseudo-column-rowname-thumbnail-title}![{{{Specimen_RID}}}]({{{Thumbnail_URL}}}){height=75}](/chaise/record/#{{{$catalog.snapshot}}}/Gene_Expression:Specimen/RID={{{Specimen_RID}}}){.pseudo-column-rowname-thumbnail-link}"
	      "Page_Size" : 25,
	      "Row_Order" : [{"column": "Stage"}, {"descending": true}] // can't do this based on ordinal ranking
	    }
	  }
        ],
        "compact/brief" : [
          "NCBI_Symbol",
          [ "Common", "Gene_Species_fkey"],
          "External_Links",
          "Description",
          "Synonyms",
          [ "Common", "Gene_Chromosome_fkey" ]
        ],
        "detailed" : [
          "NCBI_GeneID",
          "NCBI_Symbol",
          "MGI_Symbol",
          [ "Common", "Gene_Species_fkey" ],
          "External_Links",
          "Description",
          "Synonyms",
          [ "Common", "Gene_Chromosome_fkey" ],
          "Location",
          "NCBI_Date"
        ],
        "filter" : {
          "and" : [
            {
	      "source" : "NCBI_Symbol",
	      "hide_not_null_choice": true,
	      "hide_null_choice": true		      
            },
            {
              "source" : "MGI_Symbol"
            },
            {
	      "source" : "Species",
	      "hide_not_null_choice": true,
	      "hide_null_choice": true		      		       
	    },
            {
	      "source" : "Synonyms"
	    },
            { "source" : "Any_Data",
	      "choices": [true],
	      "hide_not_null_choice": true,
	      "hide_null_choice": true,		      
	      "markdown_name" : "Any Data"
	    },
            { "source" : "Imaging_Data",
	      "hide_not_null_choice": true,
	      "hide_null_choice": true,		      		      
	      "markdown_name" : "Imaging Data"		      		      
	    },
            { "source" : "Array_Data",
	      "hide_not_null_choice": true,
	      "hide_null_choice": true,		      		      
	      "markdown_name" : "Array Data"		      
	    },
            { "source" : "Specimen_Expression_Data",
	      "hide_not_null_choice": true,
	      "hide_null_choice": true,		      		      
	      "markdown_name" : "Scored Expression Data"
	    },
	    {
              "markdown_name" : "Scored Expression Region",
              "source" : [
                { "inbound" : ["Gene_Expression", "Specimen_Gene_Association_NCBI_GeneID_fkey" ] },
                { "outbound" : ["Gene_Expression", "Specimen_Gene_Association_Specimen_RID_fkey" ] },
                { "inbound" : ["Gene_Expression", "Specimen_Expression_Specimen_fkey" ] },
                { "outbound" : ["Gene_Expression", "Specimen_Expression_Region_fkey" ] },		  
                "RID"
              ]
	    },
	    {
	      "markdown_name" : "Assay Type",
	      "source" : [
                { "inbound" : ["Gene_Expression", "Specimen_Gene_Association_NCBI_GeneID_fkey" ] },
                { "outbound" : ["Gene_Expression", "Specimen_Gene_Association_Specimen_RID_fkey" ] },
                "Assay_Type"
              ]
	    },
	    {
              "markdown_name" : "Anchor Gene Anatomy",
	      "ux_mode" : "choices",		       
              "source" : [
                { "inbound" : ["Gene_Expression", "Anchor_Gene_NCBI_GeneID_fkey" ] },
                { "outbound" : ["Gene_Expression", "Anchor_Gene_Anatomy_fkey" ] },
		"ID"
              ]
	    },		  
	    {
              "markdown_name" : "Marker Gene Anatomy",
	      "ux_mode" : "choices",		       		       
              "source" : [
                { "inbound" : ["Gene_Expression", "Marker_Gene_NCBI_GeneID_fkey" ] },
                { "outbound" : ["Gene_Expression", "Marker_Gene_Anatomy_fkey" ] },
		"ID"
              ]
	    },
	    {
              "markdown_name" : "Antibody Tests",
	      "ux_mode" : "choice",		       
              "source" : [
                { "inbound" : ["Antibody", "Antibody_Tests_Related_Gene_fkey" ] },			
                "RID"
              ]
	    }
          ]
        }
      }
    },

    "tag:isrd.isi.edu,2016:visible-foreign-keys" : {
      "*" : [
        [ "Gene_Expression", "Specimen_Gene_Association_NCBI_GeneID_fkey" ],
        {
	  "markdown_name" : "Array Data",
	  "ux_mode" : "check_presence",
	  "source" : [
            { "inbound" : ["Gene_Expression", "Array_Data_NCBI_GeneID_fkey" ] },
	    "RID"
          ]
	  "display" : {
	    "markdown_pattern" : ":::iframe [Microarray Data (full screen)](/deriva-webapps/heatmap/#2/Gene_Expression:Array_Data_view/NCBI_GeneID={{{NCBI_GeneID}}}){width=1230 height=800 link=/deriva-webapps/heatmap/#2/Gene_Expression:Array_Data_view/NCBI_GeneID={{{NCBI_GeneID}}}} \n:::",
	    "page_size" : 25
	  }
        },
	
        [ "Gene_Expression", "Allele_NCBI_GeneID_fkey" ],
        [ "Gene_Expression", "Probe_NCBI_GeneID_fkey" ],
        [ "Antibody", "Antibody_Tests_Related_Gene_fkey" ],
        [ "", "Antibody_Gene_Association_NCBI_GeneID_fkey" ],
        [ "Histological_Images", "HE_Slide_Gene_fkey" ],
        [ "Immunofluorescence", "Slide_Gene_NCBI_GeneID_fkey" ],
        [ "Cell_Line", "Mouse_Strain_NCBI_GeneID_fkey" ],
        [ "Cell_Line", "Reporter_Cell_Line_Reporter_Gene_fkey" ],
        [ "Cell_Line", "Reporter_cell_Line_NCBI_GeneID_fkey" ]
      ]
    }
    
  }
}