Skip to main content

Store observations of vcf variants in a mongodb

Project description

loqusdb Build Status

Small tool to setup a local variant database.

Right now locusdb uses mongodb as backend for storing variants but there should not be a huge difference to use another database manager.

Installation

pip install loqusdb

or

$git clone https://github.com/moonso/loqusdb
$cd loqusdb
$pip install --editable .

Idea

Tool to keep track of what variants that have been seen and in what families they have been observed. This is NOT a tool to create a true frequency database. It will basically count the number of times we have seen a variant in any individual. We will also keep track of the variants that have been seen in a homozygous or hemizygous state.

Variants are stored by providing a vcf file and a (ped or ped like)family file.

Loqusdb will first check if the vcf file looks ok.

The tool will then check all variants if they have been observed in any of the individuals in the family.

When the variants are added:

  • Either the variant exists, in this case we increase the number of observations with one
  • Or this variant has not ben seen before, then the variant is added to database

Command Line Interface

$ loqusdb
Usage: loqusdb [OPTIONS] COMMAND [ARGS]...

  loqusdb: manage a local variant count database.

Options:
  -db, --database TEXT   [default: loqusdb]
  -u, --username TEXT
  -p, --password TEXT
  -port, --port INTEGER  Specify the port where to look for the mongo
                         database.  [default: 27017]
  -h, --host TEXT        Specify the host where to look for the mongo
                         database.  [default: localhost]
  -b, --backend [mongo]  Specify what backend to use.  [default: mongo]
  -c, --conn_host TEXT   Used for testing.  [default: mongodb://]
  -l, --logfile PATH     Path to log file. If none logging is printed to
                         stderr.
  -v, --verbose
  --version              Show the version and exit.
  --help                 Show this message and exit.

Commands:
  cases     Display cases in database
  delete    Delete the variants of a family
  export    Export variants to VCF format
  index     Add indexes to database
  load      Load the variants of a family
  migrate   Migrate an old loqusdb instance
  variants  Display variants in database
  wipe      Wipe a loqusdb instance

Database

Mongo

The collections looks like:

Case

{
    'case_id': 'case_id',
    'vcf_path': 'path_to_vcf'
}

Variant

{
    '_id': 'variant_id',
    'chrom': 'CHROM',
    'start': postition,
    'end': end postition,
    'ref': reference base(s),
    'alt': alternative base(s),
    'homozygote': number_of_homozygotes,
    'hemizygote': number_of_hemizygotes,
    'observations': number_of_observations,
    'families': ['family_id', ...]
}

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

loqusdb-2.3.tar.gz (67.7 kB view details)

Uploaded Source

Built Distribution

loqusdb-2.3-py2.py3-none-any.whl (43.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file loqusdb-2.3.tar.gz.

File metadata

  • Download URL: loqusdb-2.3.tar.gz
  • Upload date:
  • Size: 67.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.12.4 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.5.2

File hashes

Hashes for loqusdb-2.3.tar.gz
Algorithm Hash digest
SHA256 821708d481d8bacaf843baa5930f21b0e90893a7c93b1c0b01c5465a049c5da1
MD5 a51241a763659c20f8cb5eea5ca160d6
BLAKE2b-256 614b2c157478bf74370d15e5c833a310e2c1671bbeb287c9a9c2301aa92cf0c8

See more details on using hashes here.

File details

Details for the file loqusdb-2.3-py2.py3-none-any.whl.

File metadata

  • Download URL: loqusdb-2.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 43.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.12.4 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.5.2

File hashes

Hashes for loqusdb-2.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ded4c4d80a9d775f19ce03469b3fb192c4f34e584fd42b7b00191a17819c2463
MD5 61f7d3ea9f7a51d226a2a1471d367c90
BLAKE2b-256 45a8507e011352e7c49b6384b8c9c145705b2b885465b4edb87be16be4619c67

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