NFixPlanet
Python package for detection and quantification of nitrogen-fixing microorganisms (diazotrophs) from genomes and short-read metagenomes.
Description
NFixPlanet provides workflows for identifying nitrogen fixation genes in genomes/contigs and quantifying the abundance and taxonomic composition of diazotrophs in metagenomic datasets. It combines profile Hidden Markov Model (HMM) annotation, genomic context validation, and coverage-based abundance estimation using a curated diazotroph reference database.
The package contains two main workflows:
- Genome annotation (
annotate) — identifies nitrogen fixation genes and operons in genome assemblies using HMMs and genomic context filtering. - Metagenome quantification (
profile) — maps short reads to a diazotroph reference database and computes gene abundance, genome abundance, and taxonomic relative abundance.
The metagenome workflow currently supports short-read sequencing data only, as abundance estimation relies on short-read coverage profiling.
Installation
The recommended method of installation is via bioconda
conda install -c bioconda nfixplanet
Manual installation
Alternatively, Nfixplanet can be installed via pip and the requiements can be installed manually
pip install nfixplanet
Requirements:
- Python 3.11
defopt < 7wget- Prodigal v2.6.3
- HMMER v3.4
- fastp v0.24.0
- hostile v2.0.0
- minimap2 v2.28
- coverm v0.7.0
Local installation
git clone git@git.embl.org:grp-bork/nfixplanet.git
cd nfixplanet
conda create -c bioconda -n nfixdev python=3.11 prodigal=2.6.3 hmmer=3.4 "defopt<7" wget hostile=2.0.0 fastp=0.24.0 minimap2=2.28 coverm=0.7.0
conda activate nfixdev
pip install -e .[dev]
Usage
nfixplanet annotate
Pipeline for identifying nitrogen fixation genes and operons in genome assemblies.
This workflow:
- Predicts open reading frames (ORFs) using Prodigal (optional if ORFs are provided)
- Searches ORFs against curated nitrogen fixation HMM profiles using HMMER
- Retains the best HMM hit per ORF
- Filters results to ensure required genes occur on the same contig
- Performs genomic context validation based on operon structure and gene proximity
- Resolves ambiguous gene assignments (e.g., nifH vs vnfH) using neighboring genes
Output consists of high-confidence nitrogen fixation gene annotations and operon assignments.
This workflow is designed for any nucleotide sequence including genome assemblies, metagenome-assembled genomes (MAGs), or individual contigs.
Basic command:
nfixplanet annotate --input_fasta /path/to/fasta --output_directory /path/to/output
Optional arguments:
--genomic_context_range <int>: Maximum number of genes upstream or downstream to consider for operon context (default: 10).--cpus <int>: Number of CPUs to use for HMMscan (default: 2, max recommended: 4).--verbose: Enable verbose (DEBUG) logging.--version: Print version number and exit.
nfixplanet profile
Pipeline for quantifying diazotroph gene, genome, and taxonomic abundance from short-read metagenomes.
This workflow integrates read mapping, abundance estimation, and taxonomic profiling into a single pipeline.
Steps include:
- Pre-processing quality control on metagenomic reads
- Mapping metagenomic reads to a curated diazotroph reference gene database using CoverM
- Calculating coverage per gene across samples
- Aggregating gene coverage into genome-level abundance estimates
- Normalizing genome abundance by gene count per genome
- Assigning genomes to taxonomy using a reference taxonomy table
- Aggregating genome abundance into taxonomic relative abundance profiles
Outputs include:
- Gene abundance table (coverage per nitrogen fixation gene per sample)
- Genome abundance table (normalized coverage per diazotroph genome per sample)
- Taxonomic relative abundance tables at multiple taxonomic levels (e.g., phylum, class, order, family, genus)
These outputs provide both functional and taxonomic quantification of diazotroph communities across metagenomic samples.
Basic command:
nfixplanet profile \
--sample_id SAMPLE_NAME \
--read_1 /path/to/read_1.fastq \
--read_2 /path/to/read_2.fastq \
--single /path/to/reads.fastq \
--output_directory /path/to/output
Required arguments:
--sample_id <str>: Name of the FASTA/FASTQ sample.--output_directory <str>: Path to output directory.
Input read options (choose one mode):
--read_1 <str>: Path to FASTA/FASTQ file for paired-end read 1 (R1).--read_2 <str>: Path to FASTA/FASTQ file for paired-end read 2 (R2). Must be provided together with--read_1.--single <str>: Path to FASTA/FASTQ file for single-end reads Can be used on its own or with--read_1and--read_2.
Optional arguments:
--work_directory <str>: Path to directory for temporary files (default: tmp).--cpus <int>: Number of CPUs used by processes (default: 8).--verbose: Enable verbose logging.
Authors and acknowledgment
License
This project is licensed under the MIT License. See the LICENSE file for details.
Metadata
Release files for nfixplanet 0.1.11
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 | |
|---|---|---|---|---|
| nfixplanet-0.1.11.tar.gz | 10.4 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nfixplanet-0.1.11-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.5 MB
Release files / nfixplanet-0.1.11.tar.gz
| Download URL | nfixplanet-0.1.11.tar.gz |
|---|---|
| Size | 10.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b6c7b7251755e6fd01697b659d827d567e3d54cd83646136afbdb4475c3f2607
|
|
BLAKE2b-256 checksum How to use checksums |
be3d36dd9564b12ab846ab6782b8c89e2d1d302f961b9f36211b0643923fcc27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / nfixplanet-0.1.11-py3-none-any.whl
| Download URL | nfixplanet-0.1.11-py3-none-any.whl |
|---|---|
| Size | 7.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
568c0acdd30892e1bdc959125308a27c58b57fce26efd779900f5c818712b8c0
|
|
BLAKE2b-256 checksum How to use checksums |
474991080dc9f24cb9fa683f9f08604ee3e0b5d084e0280e32decdae128d2f06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Security for nfixplanet 0.1.11
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.