> For the complete documentation index, see [llms.txt](https://manual.microbial-genomes.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://manual.microbial-genomes.org/master/part6/derep_wf.md).

# Dereplicate

This workflow automates the dereplication of your collection of genomes, Metagenome-Assembled Genomes (MAGs), or Single-Cell Amplified Genomes (SAGs).

To execute the workflow, run:

```bash
miga derep_wf -o my_project path/to/mags/*.fasta
```

For additional options, run:

```bash
miga derep_wf -h
```

Importantly, the dereplication can be performed on ANI (default) or AAI (passing the `--aai` flag) at a given threshold (by default 95%) that can be modified with the flag `--threshold`. Finally, the representative genomes can be selected to reflect the highest genome quality (default) or to be the most "central" genome in the clade in ANI or AAI space (passing the `--medoids` flag).

## Expected output

Once your run is complete, you may expect the [standard summaries](/master/part6/summaries.md) for `cds`, `assembly`, and `essential_genes`, as well as a table (`genomospecies.tsv`) with three columns: (1) a clade name, (2) the name of the representative genome, and (3) the names of all the members in the clade separated by commas. Additionally you can expect the subdirectory `representatives` including assemblies (FastA files, nucleotides) of all representative genomes. This is the dereplicated set of genomes.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://manual.microbial-genomes.org/master/part6/derep_wf.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
