# LifeTrack

LifeTrack is a GUI tool to visualize all health register data for a person in a single view. A typical use case for LifeTrack is to explore an interesting cohort member for example to explore medical history of rare variant cases or cohort outliers.

See a tutorial on how to use LifeTrack from the [FinnGen Data Users' Meeting on 28th Feb 2023](https://www.finngen.fi/en/members/recordings/finngen-data-users-meeting-28th-feb-2023).

See also a [presentation of New FinGen tools and their application to example diseases from User's meeting 28th March 2023 recording ](https://www.finngen.fi/en/members/recordings/finngen-data-users-meeting-28th-march-2023)(at 25min 23sec) including usage of LifeTrack tool.

### Design of the data presented in the LifeTrack

LifeTrack reads the data from [Detailed Longitudinal Data](https://docs.finngen.fi/finngen-data-specifics/red-library-data-individual-level-data/what-phenotype-files-are-available-in-sandbox-1/detailed-longitudinal-data) through the BigQuery database and is complemented with the [Service sector data](https://docs.finngen.fi/finngen-data-specifics/red-library-data-individual-level-data/what-phenotype-files-are-available-in-sandbox-1/service-sector-data) and English translations of the medical codes.

The LifeTrack shows a person's health register data grouped into [five classification groups](#viewing-all-health-register-data-for-a-person): Procedures, Conclusions, Diagnoses, Medications, and Unclassified. In each classification group, register entries are presented as a dot plot.

<figure><img src="https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-64537c74ddad31b36ba6c3fa2281c4bad7b81fb2%2Fimage%20(315).png?alt=media" alt=""><figcaption><p>Design of the data presented in the FifeTrack</p></figcaption></figure>

### Input file format

The LifeTrack works well together with [Cohort Operations](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/cohort-operations-tool-co), [Trajectory Visualization Tool](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/trajectory-visualization-tool-tvt), and [Genotype Browser](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/genotype-browser). The output file from these programs can be read directly into the LifeTrack. LifeTrack reads text files with the following formatting. To view [Atlas ](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/atlas)cohorts in LifeTrack, [you should first download the cohort through Cohort Operations tool.](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/cohort-operations-tool-co/export-finngen-ids-using-co)

The input file for the LifeTrack is a tab-separated text file with one mandatory column, FINNGENID. There might others, such as SEX in the example below – they are just ignored.

| FINNGENID  | SEX    |
| ---------- | ------ |
| FG00000001 | male   |
| FG00000002 | male   |
| FG00000003 | female |
| FG00000004 | female |
| FG00000005 | male   |

### Running LifeTrack

Open the LifeTrack from the `Applications -> FinnGen -> LifeTrack` in Sandbox.

<figure><img src="https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-59742f08a391b2b9f9b40cb51967f6c089415c4f%2Fimage%20(113).png?alt=media" alt=""><figcaption></figcaption></figure>

Upload cohort to the LifeTrack. Click `Browse...` and select a cohort from the opening window. LifeTrack can [read output files from other FinnGen tools directly and from text files](#input-file-format). After uploading is completed select a person's ID from the drop-down menu to view medical recordings.

<figure><img src="https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-9b3bc56a1930e6382699b6ba3ab220b273a3289e%2F2023-04-20_12-14-38.png?alt=media" alt=""><figcaption></figcaption></figure>

You may hide the sidebar from the ![](https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-e44a67df0b1054c4b9ad129992de16e2c3e924e8%2Fimage%20\(126\).png?alt=media) icon.

![](https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-7451ec12182d7583b9203fd658548cd72748d86a%2Fimage%20\(296\).png?alt=media)

### Viewing all health register data for a person

On the top of the page person's ID, gender, year of birth, height, smoking status, home region/province, and the number of entries in the data are shown. The grid area shows register entries as a dot plot. Each dot is a register entry. Multiple entries at the same location are shown on top of each other. Time is presented on the x-axis and classification is on the y-axis.

Register entries are grouped into six categories: Procedures, Certified Diagnoses, Diagnoses (ICD8 and ICD9), Diagnoses (ICD10), Medications, and Unclassifieds. Diagnose category contain[ ICD10 codes](https://docs.finngen.fi/finngen-data-specifics/finnish-health-registers-and-medical-coding/international-and-finnish-health-code-sets) while medication category contains [ATC code](https://docs.finngen.fi/finngen-data-specifics/finnish-health-registers-and-medical-coding/international-and-finnish-health-code-sets) top-level items. Procedures category includes multiple vocabularies like [SPAT, ](https://docs.finngen.fi/finngen-data-specifics/finnish-health-registers-and-medical-coding/more-information-on-health-code-sets)NCSP (also known as [Nomesco](https://docs.finngen.fi/finngen-data-specifics/finnish-health-registers-and-medical-coding/more-information-on-health-code-sets))[, and ICPC](https://docs.finngen.fi/finngen-data-specifics/finnish-health-registers-and-medical-coding/more-information-on-health-code-sets). The Certified Diagnoses category contains the most reliable diagnoses coming from [the cancer registry, the KELA reimbursement registry, or the death registry](https://docs.finngen.fi/finngen-data-specifics/red-library-data-individual-level-data/what-phenotype-files-are-available-in-sandbox-1/detailed-longitudinal-data). Unclassifieds category includes items that can't be mapped. Usually, these are [VNR codes](https://docs.finngen.fi/finngen-data-specifics/finnish-health-registers-and-medical-coding/international-and-finnish-health-code-sets) not having equivalent in the standard [ATC code](https://docs.finngen.fi/finngen-data-specifics/finnish-health-registers-and-medical-coding/international-and-finnish-health-code-sets).

The entries are color-coded based on the register where entries are recorded (see key at right). The SOURCE registers are described in the [Detailed Longitudinal Data](https://docs.finngen.fi/finngen-data-specifics/red-library-data-individual-level-data/what-phenotype-files-are-available-in-sandbox-1/detailed-longitudinal-data) section.

<figure><img src="https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-a67bfdbf9f4970869d371efa4eb0e748c8c58ec8%2F2023-04-20_12-13-17.png?alt=media" alt=""><figcaption></figcaption></figure>

Hovering the mouse over a plot will show details about the selected data points.

<figure><img src="https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-bb55b75fa9f75e1fac7c664a679f083115491f2f%2F2023-03-30_12-26-05.png?alt=media" alt=""><figcaption></figcaption></figure>

### Filter the data

To view only part of the patient's data use the filtering options in the left side menu. The data can be filtered according to the data range (x-axis) and by regular expressions that match the Category (y-axis) or the data point's code and translation (Entry), including service sector description.

If you'd like to highlight events related to emergency services, you could write "emergency" into "Entry highlight filter", and you would get the following result where the non-matching events are faded into the background.

<figure><img src="https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-72210c5258695a785c990d2385a2e9307754f636%2F2023-04-20_12-05-35.png?alt=media" alt=""><figcaption></figcaption></figure>

If you want to constrain the visible date range, you can set it by dragging the beginning and end of the green bar.

<figure><img src="https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-6ec156b8924822417d7c47c32b253bb5c48a7cbc%2F2023-04-20_11-59-18.png?alt=media" alt=""><figcaption></figcaption></figure>

Suppose you are interested to see diagnoses and drug purchases related to the respiratory system. If you enter the word "respiratory" into `Category filter`, you get the following view.

<figure><img src="https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-982be81af71424c2a2f63a4a75594ac6d5e62e61%2F2023-04-20_11-58-02.png?alt=media" alt=""><figcaption></figcaption></figure>

Since the `Category` and `Entry` are matched both to code and translation, you could also enter "^R03|^J4" into the `Entry` field and get "chronic lower respiratory system diseases (J4)" and "drugs for obstructive airway diseases (R03)" highlighted. The caret symbol "^" forces the regular expression to match only to the beginning of the entry.

<figure><img src="https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-d052bea6c57002647dea9c9b55aecddfe975ce96%2F2023-04-20_11-58-47.png?alt=media" alt=""><figcaption></figcaption></figure>

To conduct the search click `Filter data`. To clear filtering settings click `Reset filters`. When you load another person's data, the filter settings are not reset, except the date range (as it is person-specific).

### Plot Settings

LifeTrack tries to adapt the dot plot settings in such a way that the result is readable. If it fails, then you can use the Plot Settings menu to alter the settings.

Adjust the plot settings by dragging the green bars in the Plot Settings menu. You may customize the plot height, dot size, stack ratio, and bin width to improve the readability of the visualization. To fit data into the screen you may also restrict the data using the [filtering option](#filter-the-data).

![](https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-dd201502906d513f0fa840ff89e8eb6127d7671f%2Fimage%20\(723\).png?alt=media)

### Viewing details of entries from the data

Hovering the mouse over a plot will show details about the selected data points. If you are hovering over a date that has multiple entries, they will be highlighted as well. To get even more details at once use the lasso tool to select several points. From the top right corner click lasso select ![](https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-7d519676787382e315f7be6a853ca6aaf28f1d27%2Fimage%20\(539\).png?alt=media) and draw a circle around the entries of your choice. Details for the selected points will appear in the popup table view. You can filter the table by entering a string into the Search field, and you can also reorder the table by clicking one of the column names.

<figure><img src="https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-cc56960da55192d66cf264c42b78742e1064d4c6%2Fmarquee-to-table.png?alt=media" alt=""><figcaption></figcaption></figure>

Selecting a single point will also open the table view for the point, essentially showing the same information as the mouse hover operation. There is a slider "Click extension" that will expand the selection with events for the number of selected months, both before and after the selected event. With this vertical selection feature, you can easily check what happened around your event of interest.

<figure><img src="https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-e4ec0ce18857da18d2b62a0fc99f1ce3fc8ea2da%2F2023-04-11_11-49-12.png?alt=media" alt=""><figcaption></figcaption></figure>
