# Unmodifiable Conditional Analysis pipeline

## Summary

Unmodifiable pipelines are predefined workflows that cannot be modified by the user. The advantage of running unmodifiable pipelines compared to modifiable pipelines is that you will get results directly to the green library and the User results PheWeb browser. No download requests are needed, because results of unmodifiable pipeline have been verified not to contain any individual-level data. Running the finemapping unmodifiable pipeline is very similar to running finemapping in the modifiable pipelines, with some small restrictions. The unmodifiable finemapping pipeline can be accessed in the sandbox from The **pipelines app -> unmodifable workflow -> Unmodifiable Conditional DF12/13F13**). For more information about the Pipelines tool, check the [Pipelines tool documentation](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/pipelines).

## How it Works

The pipeline first take the input sumstats and runs the finemap pipeline to extract regions of interest. Then a step filters out regions where hits > `locus_mlogp_threshold` .

Then, regenie is called for each of these regions and rounds of conditional analysis are run until either the top hit is below the `conditioning_mlogp_threshold` or `max_steps` of iterations are reached.

## Summary of inputs

* `regenie_cond_sb.sumstats_root`: path to the sumstats. `PHENO` will be replaced by the `pheno` parameter.
* `regenie_cond_sb.prefix`: the prefix of the output
* `regenie_cond_sb.pheno`: Phenotype name. It needs to match the `sumstats_root` basename
* `regenie_cond_sb.regenie_conditional.null`: Path to Loco of regenie step1.
* `regenie_cond_sb.pheno_file`: Path to pheno file.
* `regenie_cond_sb.cov_file`: Path to cov file.
* `regenie_cond_sb.is_binary`: "true" or "false". it tells regenie whether the pheno is binary or not
* `regenie_cond_sb.covariates`: List of covariates. The pipeline will filter them out to make sure only covaraites with >5 samples are included
* `regenie_cond_sb.chroms`: Comma separated list of chroms to include.
* `regenie_cond_sb.regenie_conditional.max_steps`: Maximum number of iterations in the conditional analysis
* `regenie_cond_sb.locus_mlogp_threshold`: Mlogp threshold for the initial hit
* `regenie_cond_sb.conditioning_mlogp_threshold`: Mlogp threshold for the conditioned hit
* These are options for the region selection algorithm. They can be changed for users are familiar with the [pipeline](/working-in-the-sandbox/running-analyses-in-sandbox/how-to-run-finemapping-pipeline.md), but we recommend not touching them
  * `regenie_cond_sb.finemap_regions.rsid_col`: ""
  * `regenie_cond_sb.finemap_regions.x_chromosome`: "true"
  * `regenie_cond_sb.finemap_regions.window`: "1500000"
  * `regenie_cond_sb.finemap_regions.scale_se_by_pval`: "false"
  * `regenie_cond_sb.finemap_regions.p_threshold`: "0.00000005"
  * `regenie_cond_sb.finemap_regions.max_region_width`: "10000000"
  * `regenie_cond_sb.finemap_regions.window_shrink_ratio`: "0.9"

## Outputs

There are five outputs, the first two of which are of interest for viewing them and the last 3 are for importing the data to userresults pheweb browser.

* `all_hits` . A file that merges all pheno chains. This file contains all the steps done for each chain. In this case the first hits did not cause a chain as the new top hits in turn did not have significat pvalues. E.g.<br>

  <table><thead><tr><th width="232.4444580078125">VARIANT</th><th width="128">BETA</th><th width="128">SE</th><th width="128">MLOG10P</th><th>BETA_cond</th><th>SE_cond</th><th>MLOG10P_cond</th><th width="550.2222900390625">VARIANT_cond</th></tr></thead><tbody><tr><td>chr1_17381854_G_A</td><td>-0.0371</td><td>0.0064</td><td>8.2425</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr2_161145756_T_A</td><td>-0.0429</td><td>0.0073</td><td>8.3533</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr2_196338002_G_A</td><td>0.059</td><td>0.0095</td><td>9.2624</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr3_18633152_A_C</td><td>0.044</td><td>0.0067</td><td>10.3279</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr3_16811234_G_A</td><td>-0.0367</td><td>0.0065</td><td>7.7032</td><td>-0.0328</td><td>0.0066</td><td>6.1828</td><td>chr3_18633152_A_C</td></tr><tr><td>chr3_43656252_G_A</td><td>0.0759</td><td>0.01</td><td>13.5747</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr3_44176307_AAAG_A</td><td>0.7812</td><td>0.1679</td><td>5.4822</td><td>0.9816</td><td>0.1974</td><td>6.1793</td><td>chr3_43656252_G_A</td></tr><tr><td>chr3_158237129_A_G</td><td>0.0388</td><td>0.0065</td><td>8.6487</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr3_177171295_G_A</td><td>0.0843</td><td>0.0133</td><td>9.588</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr4_59388159_A_G</td><td>-0.0403</td><td>0.0071</td><td>7.8402</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr5_104451467_A_C</td><td>0.0383</td><td>0.0066</td><td>8.1869</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr5_120730291_A_G</td><td>-0.0437</td><td>0.0066</td><td>10.5128</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr5_121149217_A_C</td><td>0.6199</td><td>0.1257</td><td>6.086</td><td>0.7808</td><td>0.1422</td><td>7.3998</td><td>chr5_120730291_A_G</td></tr><tr><td>chr5_144466903_T_C</td><td>0.0374</td><td>0.0065</td><td>8.1641</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr5_153777668_A_C</td><td>-0.0381</td><td>0.0065</td><td>8.3132</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr5_153129992_T_G</td><td>-0.0329</td><td>0.0065</td><td>6.3568</td><td>-0.032</td><td>0.0065</td><td>6.0592</td><td>chr5_153777668_A_C</td></tr><tr><td>chr6_51715850_T_C</td><td>-0.0567</td><td>0.0103</td><td>7.4145</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr6_151880872_T_C</td><td>-0.0474</td><td>0.0065</td><td>12.4306</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr6_164751626_G_A</td><td>-0.038</td><td>0.0063</td><td>8.717</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr9_36999372_C_T</td><td>0.0348</td><td>0.0063</td><td>7.419</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr9_95537395_T_A</td><td>0.0565</td><td>0.0102</td><td>7.4833</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr10_21600368_A_AAC</td><td>-0.0515</td><td>0.0085</td><td>8.819</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr10_104842738_C_CT</td><td>-0.0411</td><td>0.007</td><td>8.2919</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr11_28582122_A_G</td><td>-0.0389</td><td>0.0066</td><td>8.3234</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr11_99647795_T_C</td><td>0.0431</td><td>0.0069</td><td>9.5016</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr11_113324873_A_G</td><td>-0.038</td><td>0.0064</td><td>8.5837</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr11_115118275_G_A</td><td>-0.0407</td><td>0.007</td><td>8.312</td><td>-0.0398</td><td>0.007</td><td>7.9104</td><td>chr11_113324873_A_G</td></tr><tr><td>chr11_113050349_C_T</td><td>0.0364</td><td>0.0064</td><td>7.8798</td><td>0.0331</td><td>0.0064</td><td>6.5628</td><td>chr11_113324873_A_G,chr11_115118275_G_A</td></tr><tr><td>chr12_60397384_T_A</td><td>-0.0372</td><td>0.0065</td><td>8.0402</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr14_70749996_T_C</td><td>-0.227</td><td>0.0359</td><td>9.5829</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr15_73812581_C_A</td><td>-0.0584</td><td>0.0105</td><td>7.6144</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr16_21667465_T_C</td><td>0.0434</td><td>0.0073</td><td>8.6185</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr16_65751219_A_G</td><td>0.0357</td><td>0.0064</td><td>7.614</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr16_72134342_T_G</td><td>0.0485</td><td>0.0063</td><td>13.8185</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr16_71324662_TCTGCTAATAGGAGTGA_T</td><td>0.0829</td><td>0.0128</td><td>10.054</td><td>0.0728</td><td>0.0131</td><td>7.582</td><td>chr16_72134342_T_G</td></tr><tr><td>chr18_53199573_T_C</td><td>0.0497</td><td>0.0063</td><td>14.3777</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr18_55212207_T_C</td><td>0.0778</td><td>0.0148</td><td>6.843</td><td>0.0759</td><td>0.015</td><td>6.3537</td><td>chr18_53199573_T_C</td></tr><tr><td>chr18_76052843_T_C</td><td>0.0474</td><td>0.0085</td><td>7.6577</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chr19_49457409_G_T</td><td>0.0795</td><td>0.0136</td><td>8.3038</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chrX_93697357_A_G</td><td>0.4882</td><td>0.0889</td><td>7.3997</td><td>nan</td><td>nan</td><td>nan</td><td>nan</td></tr><tr><td>chrX_93934138_A_G</td><td>0.7061</td><td>0.1479</td><td>5.7454</td><td>1.0262</td><td>0.1883</td><td>7.2998</td><td>chrX_93697357_A_G</td></tr></tbody></table>

  `chr3_18633152_A_C` is the first hit to have a validit conditional chain with the secondary hit `chr3_16811234_G_A`, for which `BETA`, `SE` and `MLOG10P` are provided both for the original (input) sumstats and the conditioned one. In this case, one can see that the values did not change significantly after conditioning, but it can happen that variants go from being non significant to significant or that betas change considerably.
* `all_logs`. This file is simply the collection of all regenie outputs and it's meant for debugging in case something went wrong
* `metadata` : metadata file for identifying an existing already imported result in userresults pheweb browser.
* `sql_import` : File for importing the results to userresults pheweb browser
* `import_conditional_files` : conditional results to be imported into puserresults pheweb browser

<br>


---

# 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/conditional-analysis/unmodifiable-conditional-analysis-pipeline.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.
