Long Running Queries

In some cases when using Sequence Miner, an ad hoc query or report may take a long time to finish running. This can be due to the complexity of the query or the number of samples involved in the report. In these cases, it can be useful to set the query as “long running” and save the output to a file. A cut-off period can be set for long running queries, which sets a limit on the length of time a query can run.

Queries can be set as long-running from the Query Editor and from reports. A monitor dialog is available for managing long running queries, which provides an overview of all queries that have been added to the long running job service.

Note

The maximum number of hours to run a query is a configuration in the backend of the GOR server. By default, this is set to 4 hours.

Adding long running queries

Long running queries in the Query Editor

Any query can be set to run as a long running query. After you have entered your query in the Query Editor, click the menu icon in the top right-hand corner and select Run as a long query to submit the query to the long running job service.

_images/lord_menu.png

Selecting the Run as a long query option from the menu

A dialog opens where you can supply additional information about the query, select the output file, set the maximum runtime of the job, and submit the job.

Reports as long-running queries

To run a report as a long running query, click More to expand the Advanced parameters in the input parameters section of the selected report builder. In the long_running_query field, select Yes, and run the report.

_images/lord_reports_01.png

An example of advanced parameters in the Gene Ontology to Genes report builder

A dialog opens where you can supply additional information about the query, select the output file, set the maximum runtime of the job, and submit the job.

Submitting jobs

When submitting a query to the long running job service, it is possible to have a descriptive text associated with the query. It is also possible to change the maximum runtime (in hours) for the query. However, note that the maximum timeout on queries is set on the server and, by default, this is set to 4 hours.

_images/lord_submit_query_to_job.png

Submitting queries to the Long Running Job system

You must select the file location where the results of the query will be stored. Click Select file to open the File Explorer and select the file location. Note that query results can be saved the user_data or user folders only.

Long running queries monitor

Sequence Miner has a monitor tab for long running queries that can be opened from the toolbar on the left-hand side. Click the Long Running Query icon to open the long running query monitor. When a query is set as long-running, an entry is added to the table with information about the job.

_images/lord_monitor.png

Submitting queries to the Long Running Job system

Job status

The status of a job can be Pending or Done in the list if they are queued or finished. The following table shows a full list of statuses that can occur in the long running job monitor.

Long running query statuses
Status Color Description
Pending Yellow The job has been added to the queue and is waiting for processing.
Running Orange The job is currently running (duration is shown in table).
Cancelled Blue The job has been cancelled.
Done Green The job completed successfully.
Failed Red The job did not finish successfully.

Toolbar actions

The toolbar at the top of the monitor provides access to actions that can be performed on long running queries. These are numbered in the figure below and explained in the table that follows.

_images/lord_toolbar.png
Long running query toolbar
# Description
1 Save the contents of this table to a file
2 Copy the selected cells with header
3 Reload the list
4 Search the table and select rows where found
5 Cancel the selected query
6 View details about the query
7 Expand the result location in the file tree

Example: SKAT and Single Point Regression

Any report can be set to run as a long running query, but is especially useful for Sequence Kernel Association Test (SKAT) and Single point regression and, if no VEP filtering is done, Variant association.

Note

If you are running SKAT analysis and want to have the Gene Carrier option available in the Using drill in reports menu from your resulting SKAT report, you should NOT select a long-running query.

To use the long-running query option for SKAT and Single point regression

  1. Select a report builder and open the Phenogrid you wish to use. Set up the report builder as usual by selecting your Phenogrid and any filtering options.
  2. Click the More link, which shows more options for filtering and the long-running query option.
  3. Select Yes for long-running query and keep the default value of 1 hour for its completion.
  4. Click Create Report to open the Long Running Job Service window.
_images/lord_01.png
  1. In the Description of Query text box, enter a description for the long-running query. This text will appear in the last column in the long-running query monitor, so it can be as long and as helpfully descriptive as you want.
  2. Click Select file and enter the file name and location in the user_data folder – this is a .gorz file which will be defaulted to. Click OK. The file location will appear next to the Select file button in the Long Running Job Service window.
  3. To start the query, click Submit Query.

In the toolbar, click the Clock icon to show all long-running queries and their status. In the example below, “RUNNING” is displayed in the Status column of the query that was just sent.

_images/lord_02.png

When the query’s status shows as “DONE”, double-click the file in the File Explorer or right-click for more options.

_images/lord_03.png