making OTUs from genomes, and stats on them. and even core-genomes
Project description
mOTUlizer
DISCLAIMER, there is an other tool out there called mOTUs that creates OTU-tables directly from reads, if you are looking for that tool, this is the wrong page, you want to go 'here', but while you on my page, why don't you check out mOTUlizer, it's cool, I swear
Utility to analyse a group of closely related MAGs/Genomes/bins/SUBs of more or less dubious origin. Right now it is composed of a number of programs:
-
mOTUlize.py
takes a set of genomes (I will use the term genome as a short hand for set of nucleotide sequences that presumably come from the same organism/population, can be incomplete, redundant or contaminated) and cluster them in to metagenomic Operational Taxonomic Units (mOTUs). Using similarity scores (by default ANI as computed by fastANI, but user can provide other similarities) a network is built based on (user defined) better quality genomes (for historical reasons called MAGs) by thresholding the similarities at a specific value (95% by default). The connected components of this graph are the mOTUs. Additionally lower quality genomes (SUBs, ) are recruited to the mOTU of whichever MAG they are most similar too if the similarity is above the threshold. -
mOTUpan.py
computes the likelihood of gene-encoded traits to be expected in all of a set of genomes, e.g. of a trait to be in the core genome of a set of genomes (of possibly varying quality). Basically you provide tomOTUpan
the set of proteomes of your genomes of interest (for example from the same mOTU or Genus) as well as a completeness prior of these genomes (for examplecheckm
output or a fixed value) and it computes gene clusters usingmmseqs2
, you can also provide your own genome encoded traits either as aJSON
-file, orTAB
-separated file (see example files). For each of these gene-clusters it will then compute the likelihood of it being in the core vs the likelihood of it not being, the ratio of these likelihoods will determine if a trait is considered core or not. This new partitioning can be used to update our completeness prior, and recomputed iteratively until convergence. -
mOTUconvert.py
converts the output of diverse programs into input files formOTUpan.py
, currently includes methods formmseqs2
,roary
,PPanGGOLiN
,eggNOGmapper
, [anvio
][https://merenlab.org/software/anvio/] pangenome databases. -
experimental
anvi-run-motupan.py
a anvi'o compatible version ofmOTUpan.py
a bit less options right now, but runs directly on anvi'o pangenome database
a number of example files are to be found in the example_files
-folder, the fasta
- and gff
-files are the ones used for all the other files, these are generated by the always fantastic prokka
. Also there is some reading material in the mOTUlizer/doc
(a poster, a presentation and a very early paper draft, but at least it has the maths in it), the paper will eventually be available there!
INSTALL
With conda:
conda install -c bioconda motulizer
With pip:
pip install mOTUlizer
manually:
git clone https://github.com/moritzbuck/mOTUlizer.git
cd mOTUlizer
python setup.py install
USAGE
mOTUlize
To make OTUs and get some stats, needs fastANI
in the PATH
if you do not provide a file for --similarities
. To bypass fastANIs memory greedy nature, it runs it in blocks if needed.
simply run with:
mOTUlize.py --fnas example_files/fnas/*.fna -o output.tsv
Loads of little options if you do : mOTUlize.py -h
Key options:
-
--checkm
: provide a file containing completenesses and contaminations, seemOTUpan
-section for detail, this time though, contamination is used... also, if not provided all genomes are assumed 'MAGs' e.g. high quality. -
--similarities
: provide a file that contains pairwise similarities of genomes. The parser will ignore any lines containting the work query (yeah I know, dodgy, but that is it for now, it's based on the output of fastANI), and need at least three columns separated byTAB
s. The first two columns are the two genome names, the third a similarity value between 0 and 100. As of now, the similarities are assumed to be asymetrical, only pairs where both pass the similarity threshold a kept for the network. -
--keep-simi-file
: saves the similarity file generated byfastANI
, can be used directly with--similarities
. Good to use if you have a lot of genomes as thefastANI
part is the slowest part, you can then use the same file with different cutoffs to tailor your clustering. -
--MAG-completeness
/--MAG-contamination
: controls which genomes are considered high quality, used for creating the mOTU-network -
--SUB-completeness
/--SUB-completeness
: controls which genomes are satelite unclassified bins (SUBs), lower quality bins that could be recruted to the MAGs (e.g. satelite around mOTUs, ok, not sure the acronym is really good, fine) -
--similarity-cutoff
: similarity cutoff used to generate the mOTU network. By default 95, as in 95% ANI cutoff which has been recorded as a weirdly universal cutoff that separates species. This number is reported at a number of places [I will cite them soon, I promise, I will fill this with citations], and freaks me out. I thought it was an artefact, but if the completeness threshold is high enough, it is weirdly universal, found very very few exceptions... anyhow, you can change it.
mOTUpan
An intro video here:
mOTUpan.py -h
Simplest command to run (needs mmseqs2 installed), but many options:
mOTUpan.py --faas *.faa -o output.tsv
Key options:
Check all flags in with --help
, but here are some keys ones a bit more explained
-
--boots BOOTS
: runsBOOTS
bootstraps, where artificial genomes are generated using the gene-partitioning obtained withmOTUpan
(e.g. the core genes are in all artificial genomes, the others are a gene-pool with their frequency conserved), these genomes are then rarefied according to the posterioir completeness estimates. The bootstrap will provide an estimate of the false positive rate (e.g. fraction of core genes that might not be), the recall (fraction of core genes that have been classified as such in the bootstrap), and 'lowest false', the lowest frequency of any false positive found (e.g. should be high, meaning that your possible false positive are actually highly prevalent in your genome-set). Higher number of bootstraps give you a standard deviation for these numbers. -
--cog_file
: can be used as an alternative to--faas
, you can use it to provide you own gene-clusters (or other genetically encoded traits). The file should either be aJSON
-file encoding a dictionary where the keys are the genome names and the values are lists of traits/genes (example inexample_files/example_genome2cog.json
). Or aTAB
-separated file, where the first column is the genome name and followed byTAB
-separated trait/gene-names (example inexample_files/example_genome2cog.tsv
). -
--genome2cog_only
: only runs the gene-clustering (mmseqs east_cluster
), returns aJSON
-datastructure compatible with--cog_file
-
--checkm
: provide a file with Completenesses and Contaminations (Redundancy), it accepts the output ofcheckm
or any otherTAB
-separated file with at least three columns:Bin Id
,Completeness
, andContamination
.Bin Id
should be the genome names (e.g. file name minus extension),Completeness
andContamination
values between 0 and 100. Note thatContamination
is not actually used yet... A normalcheck
output file is available atexample_files/example_checkm.txt
and a more generic completeness file that also works atexample_files/example_generic_completeness.tsv
. -
--max_iter
: maximum number of iterations for the recursive aspect of motupan. You might want to put that to1
if you have only few traits that would not be sufficient to estimate completeness.
anvi-run-motupan
You need an anvi'o pangenome-database, and if you have it the genome-storage (for completenesses), great otherwise simply:
# if you want just a tsv :
anvi-run-motupan.py -p MYPANGENOME-PAN.db -g MYGENOMES.db -o MY_OUTPUT.tsv
# if you want to update the db, so it show up in anvi-display-pan
anvi-run-motupan.py -p MYPANGENOME-PAN.db -g MYGENOMES.db --store-in-db
mOTUconvert
A small program generating appropriate input files for mOTUpan.py
from the output of some of my favorite, or the public's favorite programs. It assumes the IDs in your protein fasta
-file to be ${genome_name}_[0-9]*
so genome-name separated from a number by an underscore. The gene name could have an underscore in it... But it might be risky, I did not code this very cleanly...
Runs as :
# check possible input file-types within
mOTUconvert.py --list
# running it
mOTUconvert.py --in_type INFILE_TYPE INFILE > OUTPUT
# or
mOTUconvert.py --in_type INFILE_TYPE -o OUTPUT INFILE
# you can then run mOTUpan as
mOTUpan.py --cog_file OUTPUT
In the example_files
-folder a number of example input and output file are available.
Citing and additional doc
Preprint for mOTUpan available on bioRxiv:
mOTUpan: a robust Bayesian approach to leverage metagenome assembled genomes for core-genome estimation Moritz Buck, Maliheh Mehrshad, and Stefan Bertilsson bioRxiv 2021.06.25.449606; doi: https://doi.org/10.1101/2021.06.25.449606
A draft of a release note
for mOTUlize is in the doc-folder, as well as the source of the previously mentioned mOTUpan paper and some slides
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mOTUlizer-0.3.2.tar.gz
.
File metadata
- Download URL: mOTUlizer-0.3.2.tar.gz
- Upload date:
- Size: 52.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/0.0.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e489889766f556f99c3199de9da92a1374e81fdf182ac5e4ec90d4fe890445a1 |
|
MD5 | 01073d09574e9b45cc4c0fe7940b3d3d |
|
BLAKE2b-256 | ab73858918afeebb96748775d9c05ac94f69f1c27ad221ec654f63a8c688ded0 |
File details
Details for the file mOTUlizer-0.3.2-py3-none-any.whl
.
File metadata
- Download URL: mOTUlizer-0.3.2-py3-none-any.whl
- Upload date:
- Size: 67.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/0.0.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86bc63a17ede3c5296e302d892ebe36d31e4b3e8e46ce55d2567d1b2648d1752 |
|
MD5 | d9d07bc8237d719b4522476008a91066 |
|
BLAKE2b-256 | e95860562e7058c093fe484be4e8e6492a018b3d19e050f5696bca143bfbbeaa |