# 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). &#x20;

## How to submit your job

### Using Pipelines

See [How to use the Pipelines area](https://docs.finngen.fi/working-in-the-sandbox/running-analyses-in-sandbox/pipelines-tool-instructions/how-to-use-the-pipelines-area) 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](https://docs.finngen.fi/working-in-the-sandbox/running-analyses-in-sandbox/pipelines-tool-instructions/pipelines-is-based-on-cromwell-and-wdl).

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*/`.
