Skip to main content

Nanomotif

Anaconda-Server Badge PyPI version

Nanomotif is a Python package designed to explore methylation in prokaryotic genomes using Nanopore sequencing. Nanomotif is a fast, scalable, and sensitive tool for identification and utilization of methylation motifs in monocultures and metagenomic samples.

Nanomotif offers

  • de novo methylated motif identification
  • metagenomic bin contamination detection
  • bin association of unbinned contigs (eg. plasmids)
  • association of MTases and RM-systems to motifs.

Documentation

Please see the documentation for detailed installation and usage instructions, descriptions of required files, and analysis examples.

Skip the Documentation: Your Quickstart Guide to Nanomotif

Installation

Nanomotif can easily be installed using Conda for managing your Python environments. You can create a new environment and install Nanomotif as follows:

conda create -n nanomotif  python=3.12
conda activate nanomotif
conda install -c conda-forge -c bioconda nanomotif

Check installation

Once installed, the installation can be checked by running:

nanomotif check_installation

This runs a test run on a small dataset, ensuring everything works.

For further details, check out the installation guidelines.

Usage

Required files

To identify methylated motifs, the following files are required:

  • Assembly (fasta file)
  • modkit methylation pileup
  • tab-separated file describing contig-bin relationship.

For further details, check out the required files documentation.

Motif discovery

Whether you are interested in finding methylated motifs in monoculture samples or metagenomic samples, we recomment just running motif_discovery

nanomotif motif_discovery ASSEMBLY.fasta PILEUP.bed CONTIG_BIN.tsv -t THREADS --out OUT

This will create three files: motifs.tsv,motif-scored.tsv, and bin-motifs.tsv. Highly methylated motifs are found in bin-motifs.tsv.

See usage and output for detailed usage and output information.

Bin contamination

After motif identification it is possible to identify contamination in bins using the bin-motifs.tsv, assembly, pileup and contig_bin file.

nanomotif detect_contamination --pileup PILEUP --assembly ASSEMBLY --bin_motifs BIN_MOTIFS --contig_bins CONTIG_BIN --out OUT

This will generate a bin_contamination.tsv specifying the contigs, which is flagged as contamination.

If the --write_bins and the --assembly_file flags are specified new de-contaminated bins will be written to a bins folder.

See usage and output for detailed usage and output information.

Include unbinned contigs

The include_contigs command assigns unbinned contigs in the assembly file to bins by training three classifiers, random forest, linear discriminant analysis, and k neighbors classifier, on the methylation pattern of the bins.

nanomotif include_contigs --pileup PILEUP --assembly ASSEMBLY --bin_motifs BIN_MOTIFS --contig_bins CONTIG_BIN --run_detect_contamination --out OUT

Note: this is not a binner and included contigs should be considered putative. Methylation patterns can be shared across MAGs, which is problematic for unrecovered MAGs.

If decontamination should not be performed, the include_contigs can be run without the --run_detect_contamination flag or without the --contamination_file flag.

MTase-linker

This module tries to link methylation motifs to their corresponding MTase and, when present, their entire RM system.

The MTase-Linker module has additional dependencies that are not automatically installed with Nanomotif. Therefore, before using this module, you must manually install these dependencies using the MTase-linker install command. The MTase-linker module requires that conda is available on your system.

nanomotif MTase-linker install

This will create a folder named ML_dependencies in your current working directory, containing the required dependencies for the MTase-linker module. You can use the --dependency_dir flag to change the installation location of the ML_dependencies folder.

The installation requires conda to generate a few environments, and it takes a bit time as it runs the workflow on a small dataset to check the installation.

When the additional dependencies are installed you can run the workflow using MTase-linker run

nanomotif MTase-linker run -t 10 --assembly ASSEMBLY.fasta --contig_bin contig_bin.tsv --bin_motifs nanomotif/bin_motifs.tsv -d ML_dependencies -o mtase_linker

Running the nanomotif MTase-linker run command will generate two primary output files: mtase_assignment_table.tsv and nanomotif_assignment_table.tsv. The first file lists all predicted MTase genes in the genome along with their predicted methylation characteristics and whether the module was able to unambiguously assign any detected motifs to the MTase (linked = (True/False)). The second file includes data from the bin-motifs.tsv of the nanomotif output with two additional columns linked and candidate_genes. The linked variable is a boolean indicator if the motif could be unambiguously linked to a MTase in the bin/genome (TRUE/FALSE). If True the gene_id of the MTase is provided in candidate_gene. If False, the candidate_gene variable lists feasible candidate facilitators of the modification based on motif type and modification type predictions.

Citation

Please cite our preprint if you use Nanomotif for your research:

Nanomotif: Leveraging DNA Methylation Motifs for Genome Recovery and Host Association of Plasmids in Metagenomes from Complex Microbial Communities. Søren Heidelbach, Sebastian Mølvang Dall, Jeppe Støtt Bøjer, Jacob Nissen, Lucas Nicolaas Ludovic van der Maas, Mantas Sereika, Rasmus Kirkegaard, Sabrina Just Kousgaard, Ole Thorlacius-Ussing, Sheila I Jensen, Katja Hose, Thomas Dyhre Nielsen, Mads Albertsen. Preprint at bioRxiv https://doi.org/10.1101/2024.04.29.591623 (2024)

License

Nanomotif is released under the MIT License. Feel free to use, modify, and distribute the package in accordance with the terms of the license.

Acknowledgments

Nanomotif builds upon various open-source libraries and tools that are instrumental in its functionality. We would like to express our gratitude to the developers and contributors of these projects for their valuable work.

Metadata

Release files for nanomotif 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nanomotif 1.1.2
File Size Uploaded
nanomotif-1.1.2.tar.gz 16.7 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for nanomotif 1.1.2
File Interpreter ABI Platform
nanomotif-1.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 33.8 MB

Release files / nanomotif-1.1.2.tar.gz

Download URL nanomotif-1.1.2.tar.gz
Size 16.7 MB
Tags Source
SHA-256 checksum
How to use checksums
3a70c95b07c6f1baa72a6ffc84f86169cc92fae54f279d1bc93216d87340c2e7
BLAKE2b-256 checksum
How to use checksums
06286d7b0c7214fe120ae7837710a049da22989066601c4774d1a3a06014eaa5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / nanomotif-1.1.2-py3-none-any.whl

Download URL nanomotif-1.1.2-py3-none-any.whl
Size 17.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
05e930ad6cb8ee7c54631ba97df173d58e004ffe8ec4ea6e40542cd36dfdcddd
BLAKE2b-256 checksum
How to use checksums
8bc560cc2c5236a5f2bafcd82a6c87512872623d461d6d0636e1d38f66176d75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

This release

1.1.2 This release

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.8

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.17

2 release files

0.4.16

2 release files

0.4.15

2 release files

0.4.13

2 release files

0.4.10

2 release files

0.4.9

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.20

2 release files

0.1.19

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page