Document toolboxDocument toolbox

Details Page In depth Example

This page provides an in-depth explanation of the details page by using an example from the amp-ad knowledge portal.

Looking at this specific link, that page is driven off this row. Note the query was generated by adding a clause from the URL parameter Study=syn5550419 to the studies table - SELECT * FROM syn17083367 where Study = 'syn5550419'

To see the actual portals code which configures this page, see here.

Study Description

This section is driven by the Study column whose value is the ownerId of a wiki page

Access Requirements

This uses a wiki page thats hard coded across all the detail pages, so it has no corresponding column.

Methods

This is driven by the Methods column which is a comma delimited list of ownerIds corresponding to wiki pages which are then rendered out sequentially in that section

Study Metadata

This one is a bit mind bending.. the Study column is again being used, but this time the value is being resolved as an entity whose name is then being matched against the 'study' (note - the spelling of 'study' here is intentional) column in syn11346063 to drive the metadata table. It doesn't end there though, syn11346063, already has an existing sql query to subset to 'metadata' which the entity's name is being added too, see below.

The ingredients for this section of the specific page I linked above look like - 

  1. Grab value from Study column: syn5550419

  2. Resolve the value as a synId and grab entity name: rnaSeqSampleSwap

  3. Make a LIKE clause (could also be an equal's clause if desired) using the above value against the study column: study LIKE '%rnaSeqSampleSwap%'

  4. Add this clause to the existing metadata table for amp-ad which has the default query 

    "SELECT id, metadataType, dataType, assay FROM syn11346063 WHERE `dataSubtype` = 'metadata'"
  5. The end result then becomes

    "SELECT id, metadataType, dataType, assay FROM syn11346063 WHERE `dataSubtype` = 'metadata' AND `study` LIKE '%rnaSeqSampleSwap%'"

Study Data

This section works exactly as Study Metadata, except step 4 from above has a different sql being used to insert the clause into:

"SELECT `resourceType`,`dataType`, `assay`, COUNT(`id`) AS `Files` FROM syn11346063 WHERE  (`dataSubtype` <> 'metadata' OR `dataSubtype` IS NULL) GROUP BY 1, 2,3 ORDER BY 4 DESC"

The end result is 

Data Updates

Wiki page used across all detail pages, no corresponding column.

Related Studies

Driven by the Related_Studies column whose value is a comma delimited list of  synIds that have a corresponding row in https://www.synapse.org/#!Synapse:syn17083367/tables/ which then render into cards.

Â