Skip to main content

MGEdb - Mobile Genetic Element database

MGEdb contains Mobile Genetic Elements sourced from several public databases including RefSeq, Tn registry and ICEberg. The database contain information on the properties, classification and genetic sequence of elements.

The database is shipped with a basic python API and a commandline interface for interacting with and maintaining the database. While the database and API is primarily desiged for the MGEfinder tool other applications are possible.

Installation

The database APIs are developed for python 3.7+, other versions are not activly supported.

Install database dependencies using the requirements file.

pip install -r requirements.txt

Run integration tests with either

make test

or

python setup.py test

Database structure

The database information is stored in mgedb/data. Database records are stored in json format. MGE nucleotide sequences are stored in fasta format in the folder mgedb/data/seqeunces.d.

Database commands

To see the available commands.

mgedb --help

To view a single MGE record or all the records of a given family in the database. Information are by default printed to stdout in a human readable format.

# view MGE record
mgedb view --name mge_name

# view all records from a given family
mgedb view --family mge_family_name

Extract CDS seqeunces and the sequences of the inverted repeats from MGE sequences in the database. These commands extract the ranges that are annotated in MGE records.

# Extract Inverted Repeat sequences annotated in MGEdb
mgedb extract ir output_file

# Extract CDS sequences for each MGE record with annotated CDS in MGEdb
mgedb extract ir output_file

Commands for updating and maintaining the database

Validate that database content conforms to database schema.

mgedb validate

Backup database as a tarball.

mgedb backup

Update database with new records and sequences. The new information need to be formatted in the MGEdb format. Prior to updating it makes an optional backup. Use the flag --dry-run to test the update without changing the database files.

mgedb update /path/to/new_database

Database API

Import and make database instance.

from mgedb import MGEdb

db = MGEdb()

mge_records = db.records

insertion_sequence_26 = mge_records['IS26']

Iterate over database sequences.

from mgedb import MGEdb

db = MGEdb()

mge_sequences = db.record_sequences
for mge in mge_sequences:
    header = mge.title
    sequence = mge.seq

See valid MGE names and MGE types in database

from mgedb import MGEdb

db = MGEdb()

mge_type_abbreviation = db.nomenclature.keys()
valid_insertion_sequence_names = db.nomenclature['is']

Release files for MGEdb 1.1.1

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

Source distribution (sdist)

Source distribution for MGEdb 1.1.1
File Size Uploaded
MGEdb-1.1.1.tar.gz 20.0 MB Details

Built distribution (wheel)

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

Total release size: 40.6 MB

Release files / MGEdb-1.1.1.tar.gz

Download URL MGEdb-1.1.1.tar.gz
Size 20.0 MB
Tags Source
SHA-256 checksum
How to use checksums
eaa88c3fd3d62daf191aab94870c418df8fa9c9b463f54e82ffeeb766f347b3e
BLAKE2b-256 checksum
How to use checksums
8283179d6498de2c27d7d94a59bf516d7810b706fba64156dca48bee2f58080e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

Release files / MGEdb-1.1.1-py3-none-any.whl

Download URL MGEdb-1.1.1-py3-none-any.whl
Size 20.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
59bef4450847c2b1061e20db4adaf6a2910bd038c0bafa408e3740cfd347d390
BLAKE2b-256 checksum
How to use checksums
1f5e362251af27e762151bf53f2195dbbd0d4e2a886aa8437167da9f37b8a0a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.0

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