fetchMGs 2 for Python 3
fetchMGs (1.0 - 1.2) is copyright (c) 2019 Shinichi Sunagawa and Daniel R Mende.
fetchMGs (1.3) - written by Chris Field
fetchMGs (>=2.0) - written by Hans-Joachim Ruscheweyh
Introduction
Phylogenetic markers are genes (and proteins) which can be used to reconstruct the phylogenetic history of different organisms. One classical phylogenetic marker is the 16S ribosomal RNA gene, which is often-used but is also known to be a sub-optimal phylogenetic marker for some organisms. Efforts to find a good set of protein coding phylogenetic marker genes (Ciccarelli et al., Science, 2006; Sorek et al., Science, 2007) lead to the identification of 40 universal single copy marker genes (MGs). These 40 marker genes occur in single copy in the vast majority of known organisms and they were used to successfully reconstruct a three domain phylogenetic tree (Ciccarelli et al., Science, 2006).
What the software does
The program fetchMGs was written to extract the 40 MGs from genomes and metagenomes in an easy and accurate manner. This is done by utilizing Hidden Markov Models (HMMs) trained on protein alignments of known members of the 40 MGs as well as calibrated cutoffs for each of the 40 MGs. Please note that these cutoffs are only accurate when using complete protein sequences as input files. The output of the program are the protein sequences of the identified proteins, as well as their nucleotide sequences, if the nucleotide sequences of all complete genes are given as an additional input.
Installation
FetchMGs and all its dependencies can be installed via pip and have been tested with Python 3.10-3.14.
$pip install fetchMGs
Input
Users can submit genes in protein space or (from v2.0 on) genomes/metagenomes in nucleotide space.
Output
Per input sample (SAMPLE), fetchMGs will produce 3 output file:
SAMPLE.fetchMGs.faa--> the marker genes in protein spaceSAMPLE.fetchMGs.fna--> the marker genes in nucleotide spaceSAMPLE.fetchMGs.scores--> A link between marker genes and their bitscores
Full program help
$fetchMGs
Program: FetchMGs extracts the 40
single copy universal marker genes (decribed in Ciccarelli et al.,
Science, 2006 and Sorek et al., Science, 2007) from genomes and metagenomes
in an easy and accurate manner.
fetchMGs <command> [options]
extraction extract marker genes from sequences
Type fetchMGs <command> to print the help menu for a specific command
Extraction
$fetchMGs extraction
Program: FetchMGs extracts the 40
single copy universal marker genes (decribed in Ciccarelli et al.,
Science, 2006 and Sorek et al., Science, 2007) from genomes and metagenomes
in an easy and accurate manner.
fetchMGs extraction input_file mode output_folder[options]
Positional arguments:
FILE Input file - plain or gzipped. Can be either:
- A genome assembly file (NT), requires -m genome. Will
call genes before marker gene extraction.
- A metagenome assembly file (NT), requires -m metagenome. Will
call genes before marker gene extraction.
- A gene file in protein space (AA), requires -m gene. nucleotide
sequences can be provided with -d parameter
- A text file with one line per input file. Requires
-m parameter to enable "metagenome", "genome" or "gene" mode.
In "gene" mode another text file with samples in the
same order can be provided with -d parameter.
STR Mode of extraction Values: [gene, genome, metagenome]
FOLDER Output folder for marker genes
Input options:
-d FILE Nucleotide file/Text file. Enabled only in the "gene" mode.
Requires same order of sequence files if submitted as
text file.
Algorithm options:
-t INT Number of threads, for gene calling and the marker gene
search. Default=[1]
-b INT Number of protein sequences searched at a time, across
input files. Memory grows with it. Default=[500000]
-v Report only the very best hit per COG and input file. Only useful
if input files contain genes from genomes or are genomes.
Changelog
2.2.0
- Same marker genes as 2.1.3; faster, and memory no longer grows with the input. On 6 threads:
- 1M genes (gene mode): 140s, 1.2 GB
- 60 genomes (genome mode): 24s
- 150Mbp metagenome (metagenome mode): 90s
- Marker gene search: switching to pyhmmer
parallel="targets". - Proteins are searched
-bat a time (default 500,000) to reduce memory spikes. - Gene calling uses the
-tthreads: genomes are called in parallel, each with its own Prodigal model, and the contigs of a metagenome are called in parallel. - Bug fixes:
- Genomes and nucleotide gene files with IUPAC ambiguity codes (R, Y, K, M, S, W, B, D, H, V) were rejected as amino acids or unknown. They are accepted now; pyrodigal reads them as unknown bases, so called genes show N there and their proteins X.
- An input file without sequences gives empty outputs and exit code 0, instead of "No valid input files found".
2.1.3
- Updated
pyhmmerto~0.12.0; fixed API compatibility (sequence name fields now returnstrinstead ofbytes) - Loosened
pyrodigalpin from== 3.6.3.post1to>= 3.6.3.post1 - Memory optimisation: protein sequences are now searched in chunks of 50,000 instead of loading entire files into memory at once
- Bug fixes:
- Map files with empty or trailing blank lines no longer trigger false "file not found" errors
- Build system migrated to
pyproject.tomlonly (removedsetup.py,setup.cfg,MANIFEST.in) - Regression test suite added (pytest + tox, GitHub Actions CI for Python 3.10–3.14)
2.1.0
- No functional updates = produces the same output
- Commandline interface refactored.
- fetchMGs expects 3 positional arguments,
input_file,modeandoutput_folderinput_file: can be either a sequence file (genes in protein space, a genome or a metagenome) or a text file with one filepath per line to a genome/metagenome/protein filemode: chose betweengene(input file(s) are proteins),genome(input file(s) are genomes) ormetagenome(input file(s) are metagenomes).output_folder: The output folder
- fetchMGs expects 3 positional arguments,
- Features:
- Checks if the input file is a map file or a sequence file now based on file content instead of file endings
- Checks if the input (and nucleotide) file(s) are in the right format. E.g. a nucleotide file is represented by a different alphabet compared to amino acid sequences.
2.0.1
- Changed automatic detection of input files to
aminofor pyhmmer - allow users to submit a file with a list of input files for positional and -d parameters
2.0.0
- Calibration mode was removed
hmmerandprodigalwere replaced withpyhmmerandpyrodigal- Input is more flexible. Users can now submit multiple files and use different input formats:
- Genes (
-m gene) - Genomes (
-m genome) - Metagenomes (
-m metagenome)
- Genes (
- Output folder was cleaned up. Only one nucleotide and one protein file are generated compared to 40 in previous versions
1.3.0
- FetchMGs was ported from Perl to Python 3
Metadata
Release files for fetchMGs 2.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fetchmgs-2.2.0.tar.gz | 1.8 MB | Without provenance | Details for fetchmgs-2.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fetchmgs-2.2.0-py3-none-any.whl | Python 3 | none | any | Details for fetchmgs-2.2.0-py3-none-any.whl |
Total release size: 3.6 MB
Release files / fetchmgs-2.2.0.tar.gz
| Download URL | fetchmgs-2.2.0.tar.gz |
|---|---|
| Size | 1.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
88df0e64c90fd7b886902970d01ae88b8eaf5921ddd626ce7cb8c81057a6c0ba
|
|
BLAKE2b-256 checksum How to use checksums |
8ae95609a3fcc0aedfabc5521c2b3fadb86c6dee10d229eaadf05a81e9565723
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.0
|
Release files / fetchmgs-2.2.0-py3-none-any.whl
| Download URL | fetchmgs-2.2.0-py3-none-any.whl |
|---|---|
| Size | 1.8 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9bdc771d5d75955f30a524f3b929147804ea2527e58e90449ef1ae24df702d45
|
|
BLAKE2b-256 checksum How to use checksums |
3b1b7f9eb2ec7449086c6e956f3375014ea8fd796bb56cb8a2ba0b8fe7460f18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.0
|
Security for fetchMGs 2.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.