<commit_before>---
title: 'mlplasmids FAQ'
date: 2018-05-23
permalink: /posts/2018-05-23-blog-post-6
tags:
  - bioinformatics
  - mlplasmids
  - plasmid
  - chromosome
  - machine learning
  - E. coli
  - E. faecium
  - K. pneumoniae
  - R
---

mlplasmids is an R package to predict if assembled short-read contigs from *E. coli*, *K. pneunomiae* or *E. faecium* originated 
from a plasmid or a chromosome. The full description of mlplasmids is available at [bioRxiv]() soon.

# FAQ

## Why does it work?

The k-mer profiles of plasmids are different from the k-mer profiles of chromosomes of bacteria. 
While k-mer profiles of plasmids can be very diverse, the diversity observed in k-mer profiles of chromosomal sequences of a single 
species are usually limited, and can be used to differentiate species.

![Mash Distances](../images/SFigure1.gif)
Computed mash distances between chromosome and plasmid sequences were clustered using t-sne. 

## How does it work?

For each species, we trained machine-learning classifiers with contigs of known origin (plasmid or chromosome).

![Mash Distances](../images/Figure1.png)


## How does it compare to other plasmid prediction methods?

Favorably. However, we do not recommend its usage on metagenomes or other species that the ones currently included.

## How can I use it?

#### For single genomes
Use the [webserver](https://sarredondo.shinyapps.io/mlplasmids)



![The webserver](../images/Figure6.png)

#### For larger batches of genomes

Install and load the R package
```
install.packages("devtools")
devtools::install_git("https://gitlab.com/sirarredondo/mlplasmids")
library(mlplasmids)
```
Load the fasta file containing the sequences into R<commit_msg>Update 2018-05-23-blog-post-6.md<commit_after>---
title: 'mlplasmids FAQ'
date: 2018-05-23
permalink: /posts/2018-05-23-blog-post-6
tags:
  - bioinformatics
  - mlplasmids
  - plasmid
  - chromosome
  - machine learning
  - E. coli
  - E. faecium
  - K. pneumoniae
  - R
---

mlplasmids is an R package to predict if assembled short-read contigs from *E. coli*, *K. pneunomiae* or *E. faecium* originated 
from a plasmid or a chromosome. The full description of mlplasmids is available at [bioRxiv]() soon.

# FAQ

## Why does it work?

The k-mer profiles of plasmids are different from the k-mer profiles of chromosomes of bacteria. 
While k-mer profiles of plasmids can be very diverse, the diversity observed in k-mer profiles of chromosomal sequences of a single 
species are usually limited, and can be used to differentiate species.

![Mash Distances](../images/SFigure1.gif)
Computed mash distances between chromosome and plasmid sequences were clustered using t-sne. 

## How does it work?

For each species, we trained machine-learning classifiers with contigs of known origin (plasmid or chromosome).

![Mash Distances](../images/Figure1.png)


## How does it compare to other plasmid prediction methods?

Favorably. However, I do not recommend its usage on metagenomes or other species than the ones currently included.


## How can I use it?

#### For single genomes
Use the [webserver](https://sarredondo.shinyapps.io/mlplasmids)



![The webserver](../images/Figure6.png)

#### For larger batches of genomes

Install and load the R package
```
install.packages("devtools")
devtools::install_git("https://gitlab.com/sirarredondo/mlplasmids")
library(mlplasmids)
```
Load the fasta file containing the sequences into R
{'fraction_non_alphanumeric': 0.0929962220284801, 'fraction_numerical': 0.014240046498111014, 'mean_word_length': 4.039531478770132, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3495267', 'n_tokens_mistral': 1145, 'n_tokens_neox': 1011, 'n_words': 416}