Skip to main content

Mobile Genetic Element database

Project description

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']

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

MGEdb-1.1.1.tar.gz (20.0 MB view details)

Uploaded Source

Built Distribution

MGEdb-1.1.1-py3-none-any.whl (20.7 MB view details)

Uploaded Python 3

File details

Details for the file MGEdb-1.1.1.tar.gz.

File metadata

  • Download URL: MGEdb-1.1.1.tar.gz
  • Upload date:
  • Size: 20.0 MB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for MGEdb-1.1.1.tar.gz
Algorithm Hash digest
SHA256 eaa88c3fd3d62daf191aab94870c418df8fa9c9b463f54e82ffeeb766f347b3e
MD5 f335af19d1a304c585096158c02072ca
BLAKE2b-256 8283179d6498de2c27d7d94a59bf516d7810b706fba64156dca48bee2f58080e

See more details on using hashes here.

File details

Details for the file MGEdb-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: MGEdb-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 20.7 MB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for MGEdb-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 59bef4450847c2b1061e20db4adaf6a2910bd038c0bafa408e3740cfd347d390
MD5 3cbd01ce13bda81bc5a0c91aeb8f0c64
BLAKE2b-256 1f5e362251af27e762151bf53f2195dbbd0d4e2a886aa8437167da9f37b8a0a9

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