# Create map of allele

### Creating a map of allele distribution in Finland

From Sandbox v10.3 onwards the Map of allele distribution in Finland is provided automatically within [Genotype Browser's Interactive Filters](/working-in-the-sandbox/working-with-genotype-data/genotype-browser.md#interactive-filters) view. It can also be loaded on a separate internet browser page in Sandbox.

Alternatively, you can also use ready-made R code by Sini Kerminen (developer of [Changes in Genetic Ancestry within Finland during 1900s](https://geneviz.aalto.fi/genetic_ancestry_finland/)) to produce the Map of Allele with R/RStudio. Drawing the map in R/RStudio will allow you to change colors and make other modifications. To draw the map with R/RStudio follow [the steps below](#generating-a-map).

Due to the population history of Finland, alleles often have a unique distribution, e.g. this LGR5 variant is more common in Ostrobothnia.

![](/files/-MhYMdFVETMH_GBhpmuA)

### Generating a map

#### Step 1:

Search for your variant in the [Genotype Browser](/working-in-the-sandbox/working-with-genotype-data/genotype-browser.md) (imputed or raw data is fine)

#### Step 2:

Save all the genotypes to a file (it will appear in your Downloads folder, /home/ivm/Downloads)

![](/files/xZvPsxwdpPUpkLPlFsVb)

#### Step 3:

The filenames from GenotypeBrowser have a lot of information in them and are very long, so it is best to rename the file to the rsID you are looking at, e.g. rs1305153461.tsv

#### Step 4:

Copy the map code and accessory files to your IVM from the shared directory: /finngen/shared/map\_of\_alleles/20210531\_194847/

#### Step 5:

In RStudio, open the file Plot\_map\_example.R

#### Step 6:

Edit the path to the variant data to be the location of the file you renamed in Step 3. The location in setwd will determine where your files are written to.

![](https://lh5.googleusercontent.com/PLSD8zBfXx1z6GNgtxWVquoTCm5ryz4rC5Z8SbSjNE1DdOt10i9ahdkBKAO8mx3IScBEHU4Jebkqa9W9ZyiuZVETw5Gn39QmvNUhC_pixRHstgaMYPBH-Lp4UjjihnsUhllLZ7Zd)

#### Step 7:

You can also add labels to the different regions by uncommenting one of the following options:

![](https://lh6.googleusercontent.com/b7GAvlWyXJ36pQrqQSUEK_BWwTiT0XF_2AuhF7iJSnSNo5Bur7K-eiuvPQDA8-B8mIC95JxWYHQoIpHl7OiAQknMQ5Fj3WQgt8rNfdxMe-4lhhcOgRrF4-ZpdUrDt2NttGm1zKex)

#### Step 8:

Select Source in RStudio to run the whole script

![](https://lh5.googleusercontent.com/oG-G3-v-1aRusp0WscqYMJYXECW-YLPv7aCE8jwkKP1RSdxDPq7Lk4Fg7Sb325Upxil4beVwIIlxnOn4WmVe7ixV0dlMRz5XFXYZqTSQVNxB_wP4jbApoegSL11vOyKuA-EjqeQd)

#### Step 9:

The pdf map file will then be available where you have indicated in “setwd”

NB: If you get a map that is only one color then most likely you have not downloaded the “All” option in the GenotypeBrowser

#### Step 10:

You can open the pdf by double-clicking on it in the File Browser, or you can open it at the command line using the command “xpdf \<yourfilename.pdf>”

#### Step 11:

To extract the map from the sandbox you will then need to copy it to /finngen/red/… and [request a download](/working-in-the-sandbox/quirks-and-features/how-to-download-results-from-your-ivm.md).

#### Step 12:

When data security has approved your download you will then be able to download it from [FinnGen green downloads bucket](/working-in-the-sandbox/quirks-and-features/how-to-download-results-from-your-ivm.md).


---

# 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/working-with-genotype-data/untitled.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.
