---
title: "Prioritization of inbred mouse strains for resolving genetic regions"
output: BiocStyle::html_document
author: "Matthias Munz"
vignette: >
    %\VignetteIndexEntry{Prioritization}
    %\VignetteEngine{knitr::rmarkdown}
    %\VignetteEncoding{UTF-8}
---


```{r, include = FALSE}
knitr::opts_chunk$set(
    collapse = TRUE,
    comment = "#>"
)
```

# Introduction
This **R** package provides methods for **genetic finemapping** in **inbred mice** by taking advantage of their **very high homozygosity rate** (>95%).

Method `prio` allows to select strain combinations which best refine a specified genetic region. E.g. if a crossing experiment with two inbred mouse strains 'strain1' and 'strain2' resulted in a QTL, the outputted strain combinations can be used to refine the respective region in further crossing experiments and to select candidate genes.

# Installation
```{r setup, eval=FALSE}
if(!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install("MouseFM")
```

# Loading package
```{r}
library(MouseFM)
```

# Example function calls
Available mouse strains
```{r}
avail_strains()
```

Prioritize additional mouse strains for a given region which was identified in a crossing experiment with strain1 C57BL_6J and strain2 AKR_J.
```{r}
df = prio("chr1", start=5000000, end=6000000, strain1="C57BL_6J", strain2="AKR_J")
```

View meta information
```{r}
comment(df)
```

Extract the combinations with the best refinement
```{r}
get_top(df$reduction, n_top=3)
```

Create plots
```{r}
plots = vis_reduction_factors(df$genotypes, df$reduction, 2)
plots[[1]]
plots[[2]]
```

# Output of Session Info
The output of `sessionInfo()` on the system
on which this document was compiled:
```{r}
sessionInfo()
```