DiscoverySpace Template Primer
Introduction
For example, a Query might return all the Tag Sequences of all the Experimental Tags for the Library named "GSM1", with certain constraints on the quality of the tags and the data of the sequence. Currently the user needs to recreate that Query for each new SAGE Library ("GSM2", "GSM3", etc), or at least duplicate the original and change the library name. This can be a time-consuming process, especially when one has to construct tag sets for over 100 libraries.
By constrast, a Template allows the user to specify the form and constraints of a basic query tree and set one particular property as a "Variable" property which is to be supplied later. In the SAGE Query above the Library name would be the perfect candidate for a "Variable" property, leaving the remainder of the Query as it is. When the user needs to generate her tag sets, she merely needs to supply values for the variable property and the Template will use the query tree to generate Queries from those variables ("GSM2", "GSM3", etc). These new Queries will then be added as separate entries into the Databank.
If you are wishing to create a Template and are not yet acquainted with DiscoverySpace Queries then please read the Query Primer before continuing any further. Available datatypes differ for each user, so you might not have access to the specific datatypes given in the examples. None-the-less, the general usage remains the same regardless of the specific datatypes available.
Creating Templates
Templates are created from the DiscoverySpace Databank by selecting the "New Template" button. This will create a new Template definition in the Databank and will launch the Template's Properties window.
The Query Panel
The user first needs to construct the Query tree, specifying the path and supplying all the constraints except for those constraints on the "Variable" property. By default the "Variable" marker is placed on the Accession of the starting set but, though this is the anticipated use case, it is possible to change the location of the "Variable" via the Template panel. For more information about how to specify a Query Tree please refer to the Query Primer.
The General Panel
Once the user has specified the contents of the Query panel she needs to move on to the other panels of the Template. As with all DiscoverySpace definitions it is vital to name and describe the Template correctly in the definition's General panel. However, this is especially important in the case of the Template because the Template can be set to copy the Description and Annotation fields into any generated Queries.
The Template Panel
In the Template panel the user gets to set the Template-specific qualities of the definition. Here the user decides whether the Description and Annotation fields should be copied into generated Queries. Here too the user decides upon the naming convention of any generated Queries by specifying a Name Prefix and a Name Suffix. In figure 4 (below) one can see the prefix and suffix values entered. When queries are generated the prefix and suffix are applied to the supplied variable value for a given Query. For example, if the Library Name (the "Variable") value supplied for a given Query is "GSM01" then the name of that Query will be the combination of the prefix, "GSM01" and the suffix (in that order). In the case of Figure 4 that name would be "Tags from GSM01 with 0.99 cutoff".
Optionally the user can change the location of the "Variable" property, though in most cases this is not necessary. By default the "Variable" marker is placed on the accession of the starting set. In the example Template the "Variable" marker is placed on the "Name" property because "Name" is the Accession property of datatype "GSC SAGE Libraries".
Once a Template has been created it can either be used immediately or saved into the Databank for future use. As with all Databank definitions, Templates can be exported and shared with other users.
Using Templates
By default when a Template definition is opened up the Template panel is displayed. To use the Template the user needs to supply values for the "Variable" property. These values can be entered directly into the table of the Template panel or can be pasted from the clipboard or imported from file. Once values are present in the table the "Create Queries" button is enabled. The user simply has to click this button and one new Query will be generated for each value entered. Each Query will be added directly to the Databank.
Figures 6 and 7 (below) show the results of Template execution. Each generated Query is added to the Databank in a modified (unsaved) form. Notice how closely the Query Tree of each Query matches the Query Tree from the originating Template. Also notice that the "Origin" property of each generated Query documents the name of that Template.
N. R. ROBERTSON 05 APR 2005