Skip to main content

Mobile Genetic Element prediction

Project description

logo

MobileElementFinder is a tool for identifying Mobile Genetic Elements (MGEs) in Whole Genome Shotgun sequence data.

It is designed to predict mobile elements in assembled whole genome sequenced bacterial DNA. MGEs are predicted by aligning the assembled contigious sequences to reference seqeunces of previously known elements. Putative composite transposons are flagged. This command line version of MobileElementFinder is designed to run either on your local machine or inside a docker container.

NOTE: MobileElementFinder is also availabe as an online software service on https://cge.cbs.dtu.dk/services/MobileElementFinder/

Installation

Clone repository.

Ensure that the following software dependencies are installed. If dependencies are not put into your $PATH you have to supply their location to MobileElementFinder.

Depending on your operating system the dependancies might be available on it's package manager system.

For Homebrew on macOS.

$ brew install blast

To install MobileElementFinder with the database simply install it from pypi.

$ pip install MobileElementFinder

Using MobileElementFinder

Use the command $ mefinder find --help to see the full list of options.

MobileElementFinder takes assembled contiguous nucleotide sequences as input. Specify the sequence file with the --contig flag. The path to and name of the output files are specified as an argument.

$ mefinder find --contig /path/to/genome.fna output_name

MobileElementFinder reports predicted mobile elements in two files. Predicted MGEs and their quality metrics are written to a CSV file and their nucleotide sequence is written to a FASTA file. The first five rows in the CSV file contains comments, beginning with # and containing key-value paired metadata on how the file was generated. The user might be required to manually specify that these rows should be omitted depending on the downstream spreadsheet application or parser.

MobileElementFinder can additionally output the location of MGEs on the different contigs in GFF3 format by using the --gff flag. This to allow visualization with genomic browser software. The user can optionally choose to annotate the sequence depth of the predicted elements by aligning the raw reads, used to assemble the sample, with KMA. To enable this specifies the sequence files in fastq format with the fastq flag.

Options and configuration of MobileElementFinder

The operation of MobileElementFinder can be modulated by either giving the program optional flags or by supplying the program with a personal configuration file.

Usage: mobileElementFinder.py find [OPTIONS] OUTPUT

  Find mobile element in sequence data.

Options:
  -c, --contig PATH        Specify pre-assembled contigs to perform analysis
                           on.

  -f, --fq-file PATH       Sequencing files in fastq format. Only used for
                           annotating sequence depth in GFF files (Optional)

  --config FILE            Path to user defined config
  -j, --json               Write output in json format.
  -g, --gff                Write MGE location on contig in gff format.
  -t, --threads INTEGER    Number of threads [default: 1]
  --min-coverage FLOAT     Minimum coverage
  --max-evalue INTEGER     Maximum alignment e-value
  --temp-dir PATH          Set directory for temporary files.
  --kma-path TEXT          Path to KMA, if the executable is not in PATH
  --blastn-path TEXT       Path to Blast, if the executable is not in PATH
  --makeblastdb-path TEXT  Path to Blast, if the executable is not in PATH
  --db-path PATH           Path to MGEdb
  --help                   Show this message and exit.
  • threads :: set number of processor threads the software is allowed to use

  • min-coverage :: set the threshold for minimum total alignment coverage of blast HSPs. Valid range 0 < x < 1.

  • min-identity :: set the threshold for minimum total sequence identity between template and query. Valid range 0 < x < 1.

  • json :: Write extended output in machine readable json format.

  • makeblastdb-path :: Set custom path to blast.

  • db-path :: Path to MGEdb. This is primarily used if Mobile Element Finder is not installed as a python package.

    Using a custom configuration file is only recommended for advanced users. An example configuration file is located in ./example.config.ini. To specify the path of your configuration file use the flag --config.

Update MobileElementFinder

MobileElementFinder is updated with pip.

pip install -e . --upgrade

Run MobileElementFinder in docker (Optional)

You can optionally use a containerized version of MobileElementFinder. This simplifies some aspects of running the tool by ensuring that software dependencies are correctly installed.

Installation

Pre-built docker images of MobileElementFinder are hosted on Dockerhub. You can either pull the latest image or a specific version with the following command.

# pull the latest build
$ docker pull mkhj/mobile_element_finder:latest

# pull version 1.0.5
$ docker pull mkhj/mobile_element_finder:1.0.5

Using MobileElementFinder

To run MobileElementFinder from outside the docker container use the following make command. It will forward the arguments to the containerized MobileElementFinder tool.

$ make run CMD="mefinder find -t 4 -f ./data/forward_reads.fastq -f ./data/reverse_reads.fastq result"

The folders volumes/data and volumes/finder are linked as docker volumes which allows accesss to the local computers file system. Put the fastq and assembled contigs in volumes/data. MobileElementFinder writes temporary files by default to the temporary folder which is linked to volumes/finder in order to access temporary files outside the docker image.

The tool can be run interactivly inside the container by first using the command.

$ make bash

Development

Run the following command in your terminal of choice to install the development requirements.

pip install -r requirements-devel.txt

To run the automated integration tests with tox use the following commands.

tox py37 py38

To lint the code run

tox lint

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

MobileElementFinder-1.1.2.tar.gz (68.7 kB view details)

Uploaded Source

Built Distribution

MobileElementFinder-1.1.2-py3-none-any.whl (55.0 kB view details)

Uploaded Python 3

File details

Details for the file MobileElementFinder-1.1.2.tar.gz.

File metadata

  • Download URL: MobileElementFinder-1.1.2.tar.gz
  • Upload date:
  • Size: 68.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.7.12

File hashes

Hashes for MobileElementFinder-1.1.2.tar.gz
Algorithm Hash digest
SHA256 d2a809de5c271463ca342acb94f20c9712df89aef05220cda6bb6bb64a41af21
MD5 4b97c31225b7942e0fa29e576b3d786a
BLAKE2b-256 42097709dfe81fc6b695159c3cdc3d341b279af81e4e9986e545379642f07117

See more details on using hashes here.

File details

Details for the file MobileElementFinder-1.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for MobileElementFinder-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 29e89d2695d7138b0354d9e85f7d4fcf0a0d9e7cc171593cdb5522c58b2d32c6
MD5 027db7fde7522b585ec70831a1ec7797
BLAKE2b-256 2b41697e76cee66ff29812c0a5bdecb2656383291ca8bbebb14922beba5c0e38

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page