Skip to main content

In silico multi-antigen sequence typing for Neisseria gonorrhoeae (NG-MAST)

Project description

PyPI - License PyPI - Python Version PyPI DOI:10.1099/mgen.0.000076

ngmaster

In silico multi-antigen sequence typing for Neisseria gonorrhoeae (NG-MAST) and Neisseria gonorrhoeae sequence typing for antimicrobial resistance (NG-STAR).

Synopsis

ngmaster gono.fa
FILE	SCHEME	    NG-MAST/NG-STAR	porB_NG-MAST	tbpB	penA	mtrR	porB_NG-STAR	ponA	gyrA	parC	23S
gono.fa	ngmaSTar    4186/231            2569            241     23      42      100             100     10      2       100

Dependencies

Installation

PiPy

# TODO how to integrate mlst dependency
pip3 install ngmaster

Brew

# TODO how to integrate mlst dependency
brew install brewsci/bio/ngmaster

Conda

conda install -c bioconda ngmaster

Test

Once installed, you can run the following to ensure ngmaster is successfully working:

ngmaster --test

If everything works, you will see the following:

Running ngmaster.py on test example (NG-MAST 4186 / NG-STAR 231) ...
FILE	SCHEME	    NG-MAST/NG-STAR	porB_NG-MAST	tbpB	penA	mtrR	porB_NG-STAR	ponA	gyrA	parC	23S
test.fa	ngmaSTar    4186/231            2569            241     23      42      100             100     10      2       100
... Test successful.

Usage

ngmaster -h

usage:
  ngmaster [OPTIONS] <fasta1> <fasta2> <fasta3> ... <fastaN>

In silico multi-antigen sequence typing for Neisseria gonorrhoeae (NG-MAST)
and Neisseria gonorrhoeae Sequence Typing for Antimicrobial Resistance (NG-STAR)

Please cite as:
  Kwong JC, Goncalves da Silva A, Howden BP and Seemann T.
  NGMASTER: in silico multi-antigen sequence typing for Neisseria gonorrhoeae (NG-MAST)
  GitHub: https://github.com/MDU-PHL/ngmaster

positional arguments:
  FASTA            input FASTA files eg. fasta1, fasta2, fasta3 ... fastaN

optional arguments:
  -h, --help       show this help message and exit
  --db DB          specify custom directory containing allele databases
                   directory must contain database sequence files (.tfa) and allele profile files (ngmast.txt / ngstar.txt)
                   in mlst format (see <https://github.com/tseemann/mlst#adding-a-new-scheme>)
  --csv            output comma-separated format (CSV) rather than tab-separated
  --printseq FILE  specify filename to save allele sequences to
  --minid MINID    DNA percent identity of full allele to consider 'similar' [~]
  --mincov MINCOV  DNA percent coverage to report partial allele at [?]
  --updatedb       update NG-MAST and NG-STAR allele databases from <https://rest.pubmlst.org/db/pubmlst_neisseria_seqdef>
  --assumeyes      assume you are certain you wish to update db
  --test           run test example
  --comments       include NG-STAR comments for each allele in output
  --version        show program's version number and exit

Quick start

To perform in silico NG-MAST and NG-STAR typing on FASTA files:

$ ngmaster <fasta1> <fasta2> <fasta3> ... <fastaN>

The NG-MAST and NG-STAR results and allele numbers are printed in tab-separated format to stdout.

  • ngmaster reports alleles according to the same rules that are implemented in mlst.
  • mlst's arguments --minid and --mincov are available directly in ngmaster
  • For each allele n:
Symbol Meaning Length Identity
n exact intact allele 100% 100%
~n novel full length allele similar to n 100% --minid
n? partial match to known allele --mincov --minid
- allele missing < --mincov < --minid
n,m multiple alleles    

To save results to a tab-separated text file, redirect stdout:

$ ngmaster <fasta1> <fasta2> <fasta3> ... <fastaN> > results.txt

To display results in comma-separated format, use the --csv option:

$ ngmaster --csv <fasta1> <fasta2> <fasta3> ... <fastaN>

To save sequences of the alleles to a file (eg. for uploading "new" sequences to PubMLST):

$ ngmaster --printseq [filename] <fasta1> <fasta2> <fasta3> ... <fastaN>

This will create two files:

  1. NGMAST__filename
  2. NGSTAR__filename

Updating the allele databases

To update the allele databases from PubMLST:
Warning: This will overwrite the existing databases so ensure you back them up if you wish to keep them.

$ ngmaster.py --updatedb

A copy of the old database is saved just in case, but is overwritten with each subsequent --updatedb.

To update the allele databases into a different folder (ie. not the /db folder in the ngmaster directory):

$ ngmaster.py --updatedb --db path/to/folder

This will download the database files into the folder path/to/folder. This can then be specified when running ngmaster using the --db path/to/folder option.

Creating a custom allele database

To create a custom allele database please follow the instructions for creating a custom mlst database described here. Usually, this should not be necessary, simply run ngmaster --update to update to the latest NG-MAST and NG-STAR schemes from PubMLST.

Citation

Kwong JC, Gonçalves da Silva A, Dyet K, Williamson DA, Stinear TP, Howden BP and Seemann T.
NGMASTER: in silico multi-antigen sequence typing for Neisseria gonorrhoeae Microbial Genomics 2016 Aug 25;2(8):e000076. PMID:28348871 DOI:10.1099/mgen.0.000076

Bugs

Please submit via the GitHub issues page.

Software Licence

GPLv2

References

Authors

  • Jason Kwong (@kwongjc)
  • Anders Gonçalves da Silva (@drandersgs)
  • Mark Schultz (@schultzm)
  • Torsten Seemann (@torstenseemann)
  • Andreas Stroehlein (@stroehleina)

Development

When incrementing version (i.e., minor patch), run the following:

bumpversion --verbose --dry-run --new-version <major.minor.patch> patch
bumpversion --new-version <new.version.number> patch

The same can be done for minor and major numbers.

This will automatically commit and tag the commit with the new version number. It will also update the necessary location in the file.

Pushing to pypi

Must be uploaded to maintainer's account.

bumpversion --new-version <new.version.number> <patch|minor|major>
git push
# create distribution
python3 setup.py sdist bdist_wheel
# run some checkes
twine check dist/*
# upload to test pypi to see if everything works
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
# upload to pypi
twine upload dist/*

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

ngmaster-1.0.0.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

ngmaster-1.0.0-py3-none-any.whl (2.1 MB view details)

Uploaded Python 3

File details

Details for the file ngmaster-1.0.0.tar.gz.

File metadata

  • Download URL: ngmaster-1.0.0.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for ngmaster-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4629c051b7133241afd8bdea9e152bcbabea62f908a66d2fc688f0415029c94c
MD5 9bc101cb28e4bc36b6af585eac22e601
BLAKE2b-256 b2931e7b3a86c0df54b2b1a3a540ccf8a149f262fe350707d4a86b5fd3206302

See more details on using hashes here.

File details

Details for the file ngmaster-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ngmaster-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for ngmaster-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 033077523130d66bdfe1585c497401e19fa983fa3ba17bc247161ad2856b084e
MD5 9be0475c294bff5526f9611c0280ec90
BLAKE2b-256 a1eed8a2ba1e07dab6ac5b6c542f4ad59257695983f52ea6048e74d0d65c4b36

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