## MLST

`rule mlst`

```{r mlst, echo = F, message = F, warning = F, error = T}



col_names = c("file_long", "scheme", "sequence_type", paste0("allele_", 1:100))

mlst_df = read_tsv(glob_list$mlst, col_names = col_names) %>% 
    mutate(file = basename(file_long)) 
    #select(file, scheme, sequence_type, starts_with("allele_"))

#mlst_df %>% view()


metadata_translate %>% 
    select(sample, file) %>% 
    left_join(mlst_df, by = "file") %>% 
    select(sample, scheme, sequence_type, starts_with("allele_")) %>% 
    custom_dt("mlst")

```


*Table `r tableno()`: Table of MLST (Multi Locus Sequence Typing) results. Called with [mlst](https://github.com/tseemann/mlst#mlst) which incorporates components of the [PubMLST](https://pubmlst.org/) database.*

#### How to customize the mlst-analysis

Mlst automatically detects the best scheme for typing, one sample at a time. If you don't agree with the automatic detection, you can enforce a single scheme across all samples by (re)running comparem2 with the added command-line argument: `--config mlst_scheme=hpylori --forcerun mlst`. Replace *hpylori* with the mlst scheme you wish to use. You can find a full list of available schemes in the "results_comparem2/mlst/mlst_schemes.txt".


---
