Metadata-Version: 2.4
Name: plot-plasmids
Version: 0.2.0
Summary: A tool to generate PCoA or NMDS plots for plasmids.
Home-page: https://github.com/example/plot_plasmids
Author: Jules
Author-email: jules@example.com
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas
Requires-Dist: numpy
Requires-Dist: scikit-bio
Requires-Dist: scikit-learn
Requires-Dist: matplotlib
Requires-Dist: seaborn
Requires-Dist: adjusttext
Dynamic: author
Dynamic: author-email
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-dist
Dynamic: summary

# plot_plasmids

[![PyPI version](https://badge.fury.io/py/plot-plasmids.svg)](https://badge.fury.io/py/plot-plasmids)
[![codecov](https://codecov.io/gh/jules-corp/plot_plasmids/branch/main/graph/badge.svg?token=placeholder)](https://codecov.io/gh/jules-corp/plot_plasmids)

A tool to generate PCoA or NMDS plots for plasmids, colored by carbapenemase genes and rep types.

## Installation

You can install `plot_plasmids` from PyPI:

```bash
pip install plot-plasmids
```

Or, for development, you can install it from this repository:

```bash
git clone https://github.com/example/plot_plasmids.git
cd plot_plasmids
pip install -e .
```

## Usage

`plot_plasmids` has two subcommands: `prep` and `plot`.

### `prep`

The `prep` command takes the raw output from `skani`, `mob_typer`, and `amrfinderplus` and prepares the files for the `plot` command.

```bash
plot_plasmids prep --skani <skani_matrix> --mob_dir <mob_dir> --amr_dir <amr_dir> --output_dir <out_dir>
```

#### Arguments

- `--skani`: Path to the `skani triangle` output file.
- `--mob_dir`: Directory containing the `mob_typer` output files.
- `--amr_dir`: Directory containing the `amrfinderplus` output files.
- `--output_dir`: Directory to save the processed files.

### `plot`

The `plot` command generates the PCoA or NMDS plot.

```bash
plot_plasmids plot -d <distance_matrix> -a <amr_results> -m <mob_results> -o <plot.png>
```

![Example plot](tests/expected_output/expected_plot_nmds.png)

#### Arguments

- `-d`, `--dist_matrix`: Path to the plasmid distance matrix (CSV or TSV format), as generated by the `prep` command.
- `-a`, `--amr`: Path to the AMRfinderPlus summary results file (TSV format), as generated by the `prep` command.
- `-m`, `--mob`: Path to the MOB-typer results file (TSV format), as generated by the `prep` command.
- `-o`, `--output`: Path for the output plot file (e.g., plot.png, plot.svg).
- `-p`, `--plot_type`: Type of ordination plot to generate (`pcoa` or `nmds`). Default is `pcoa`.
