# How to run trajGWAS

## What?

Pipeline for running GWAS for longitudinal trajectories (eg. multiple lab measurements per person) using TrajGWAS.

## Introduction

## Example files for running TrajGWAS pipeline

Example files for running trajGWAS pipeline can be found in the sandbox from folder `/finngen/library-green/scripts/trajGWAS/:`

* `trajgwas.wdl`
* `trajgwas_example.json` (example inputs)

Minimally, you need to create your **phenotype-covariate file** (`"trajGWAS.gwas.phenofile"`), which should be tab-separated file, including **phenotype column** (defined in `"trajGWAS.phenoname"`) , all covariate columns (defined in `"trajGWAS.gwas.covarlist"` as a + separated list, NO SPACES).

## How to submit your job

### Using Pipelines

See [How to use the Pipelines area](/working-in-the-sandbox/running-analyses-in-sandbox/pipelines-tool-instructions/how-to-use-the-pipelines-area.md) to see how to submit your job.

If you need further information on the pipeline/job system, see section [Pipelines is based on Cromwell and WDL](/working-in-the-sandbox/running-analyses-in-sandbox/pipelines-tool-instructions/pipelines-is-based-on-cromwell-and-wdl.md).

Once your `.json` file is ready, you can submit your GATE run via the command:

```
finngen-cli request-workflow --wdl /path/to/trajgwas.wdl \
    --input /path/to/trajgwas_example.json
```

After submitting your job successfully, go to `Applications`->`Sandbox`->`Pipelines` to track your job, and **remember to save your jobs' workflow ID** for tracking and checking the results when your run has finished.

## Output

Once your job displays the `Succeeded` state you can see the results in `/finngen/pipeline/cromwell/workflows/trajGWAS/[WORKFLOW_ID]/`.

You can, for example, find the:

* **summary statistics** (`{PHENO}.trajGWAS.gz` ) in `/finngen/pipeline/cromwell/workflows/trajGWAS/[WORKFLOW_ID]/call-gather/shard-0/glob*/` and
* **manhattan and QQ plots for both bet**a and tau p-values in the other glob\* folder: `/finngen/pipeline/cromwell/workflows/trajGWAS/[WORKFLOW_ID]/call-gather/shard-0/glob*/`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.finngen.fi/working-in-the-sandbox/running-analyses-in-sandbox/how-to-run-genome-wide-association-studies-gwas/how-to-run-trajgwas.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
