<commit_before>---
layout: post
title: "Anvi'o User Manual"
excerpt: "Sweets for people who managed to install the platform."
modified: 2015-05-02 
tags: []
categories: [anvio]
comments: true
---

{% include _toc.html %}

{: .notice}
This tutorial is tailored for anvi'o versions 1.1.0 or later. Please update your installation first if you have an earlier version installed. You can learn which version you have on your computer by typing `anvi-profile --version` in your terminal.

This tutorial gives a brief overview of anvi'o metagenomic worklow. If you run into any issues, please post a comment down below, or open an <a href="https://github.com/meren/anvio/issues">issue</a>.

If you are here, you must have already installed the platform, and have [run the "mini test"]({% post_url anvio/2015-05-01-installation %}) succesfully.


# Preparation

To run anvi'o, you _at least_ need these files:

* __A FASTA file__ of your contigs. I will call it `contigs.fa` throughout this manual.  
* __BAM files__ for your samples. Let's say, for the sake of brevity, you have two samples in your analysis, `X` and `Y`, and the BAM files for these samples, which were generated by mapping reads in `X` and `Y` to `contigs.fa`, and are named as `X-raw.bam` and `Y-raw.bam`.

It is that simple.

However, **your FASTA file must have simple deflines**, and if it doesn't have simple deflines, **you must fix your FASTA file prior to mapping**. This is necessary, because the names in `contigs.fa` **must** match the names in your BAM files. But ynfortunately, different mapping software behave differently when they find a space character, or say a `|` in your target FASTA file, and they proceed to change those characters. Therefore it is essential to keep the sequence IDs in this file **as simple as possible** before mapping. To avoid any problems later, take a look at your deflines prior to mapping now, and remove anything that is not a digit, an ASCII letter, an underscore, or a dash character. Here are some examples:

{% highlight bash %}
BAD deflines:

>Contig-123 length:4567 
>Another defline 42
>gi|478446819|gb|JN117275.2|
<commit_msg>trying to make sure people go with the stable versions while realizing I just destroyed the stability of the codebase while working on https://github.com/meren/anvio/issues/202<commit_after>---
layout: post
title: "Anvi'o User Manual"
excerpt: "Sweets for people who managed to install the platform."
modified: 2015-05-02 
tags: []
categories: [anvio]
comments: true
---

{% include _toc.html %}

{: .notice}
This tutorial is tailored for anvi'o versions 1.1.0 or later. Please update your installation first if you have an earlier version installed. You can learn which version you have on your computer by typing `anvi-profile --version` in your terminal.

This tutorial gives a brief overview of anvi'o metagenomic worklow. If you run into any issues, please post a comment down below, or open an <a href="https://github.com/meren/anvio/issues">issue</a>. When you post a comment or an issue, please mention the anvi'o version, the operating system you are using.

If you are here, you must have already installed the platform, and have [run the "mini test"]({% post_url anvio/2015-05-01-installation %}) succesfully.

Finally, please stick with stable versions of the platform, unless you like living at the edge, as the snapshots from [the codebase](http://github.com/meren/anvio) can be very unstable and/or broken.


# Preparation

To run anvi'o, you _at least_ need these files:

* __A FASTA file__ of your contigs. I will call it `contigs.fa` throughout this manual.  
* __BAM files__ for your samples. Let's say, for the sake of brevity, you have two samples in your analysis, `X` and `Y`, and the BAM files for these samples, which were generated by mapping reads in `X` and `Y` to `contigs.fa`, and are named as `X-raw.bam` and `Y-raw.bam`.

It is that simple.

However, **your FASTA file must have simple deflines**, and if it doesn't have simple deflines, **you must fix your FASTA file prior to mapping**. This is necessary, because the names in `contigs.fa` **must** match the names in your BAM files. But ynfortunately, different mapping software behave differently when they find a space character, or say a `|` in your target FASTA file, and they proceed to change those characters. Therefore it is essential to keep the sequence IDs in this file **as simple as possible** before mapping. To avoid any problems later, take a look at your deflines prior to mapping now, and remove anything that is not a digit, an ASCII letter, an underscore, or a dash character. Here are some examples:

{% highlight bash %}
BAD deflines:

>Contig-123 length:4567 
>Another defline 42
>gi|478446819|gb|JN117275.2|

{'fraction_non_alphanumeric': 0.08168836623267535, 'fraction_numerical': 0.019109617807643847, 'mean_word_length': 4.3577052868391455, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6258671', 'n_tokens_mistral': 1439, 'n_tokens_neox': 1332, 'n_words': 712}