Skip to main content

A simple observation count database

Project description

loqusdb

Publish to PyPI Coverage Status PyPI Version

Small tool to set up a local variant database. If you find Loqusdb useful in your work, please cite the article.

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

Find more detailed instructions and examples in the documentation.

Installation

poetry install

or

$git clone https://github.com/moonso/loqusdb
$cd loqusdb
$poetry install

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 adheres to the VCF format.

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 been seen before, then the variant is added to the database

Command Line Interface

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

  loqusdb: manage a local variant count database.

Options:
  -db, --database TEXT            Defaults to 'loqusdb' if not specified
  -u, --username TEXT
  -p, --password TEXT
  -a, --authdb TEXT               If authentication should be done against
                                  another database than --database

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

  --uri TEXT                      Specify a mongodb uri
  -c, --config FILENAME           Use a config with db information
  -t, --test                      Used for testing. This will use a mongomock
                                  database.

  -g, --genome-build [GRCh37|GRCh38]
                                  Specify what genome build to use
  -v, --verbose
  --version                       Show the version and exit.
  --help                          Show this message and exit.

Commands:
  annotate  Annotate a VCF with observations
  cases     Display cases in database
  delete    Delete the variants of a family
  dump      Dump the database
  export    Export variants to VCF format
  identity  Search identity collection
  index     Add indexes to database
  load      Load the variants of a family
  migrate   Migrate an old loqusdb instance
  profile   Loads variants to be used in profiling
  restore   Restore database from dump
  update    Update an existing case with a new type of variants
  variants  Display variants in database
  wipe      Wipe a loqusdb instance

Database

Connecting

Connection can be specified on command line with --database, --username, --password, --port, --host and/or --uri. Or these options can be sent with a config file that can take the same options:

uri: mongodb://loqusdb-username:loqusdb-pwd@localhost:27030/loqusdb-rd?authSource=admin
db_name: loqusdb_test

or

host: localhost
port: 27030
username: loqusdb-username
password: loqusdb-pwd
authdb: admin
db_name: loqusdb_test

Mongo

The collections are defined as follows:

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.7.25.tar.gz (12.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

loqusdb-2.7.25-py3-none-any.whl (12.2 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: loqusdb-2.7.25.tar.gz
  • Upload date:
  • Size: 12.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.11 Linux/6.11.0-1015-azure

File hashes

Hashes for loqusdb-2.7.25.tar.gz
Algorithm Hash digest
SHA256 726aa922086765e65cbb5a5fea3799b1fdf7e06d100035792750862511e339b9
MD5 ac324e7edd202dfd1464beb97dc39fc7
BLAKE2b-256 88203b7de8ffaa150e552ee68a1606a3a0be42c49a0dc4cf2a578f5a3a9f0ef7

See more details on using hashes here.

File details

Details for the file loqusdb-2.7.25-py3-none-any.whl.

File metadata

  • Download URL: loqusdb-2.7.25-py3-none-any.whl
  • Upload date:
  • Size: 12.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.11 Linux/6.11.0-1015-azure

File hashes

Hashes for loqusdb-2.7.25-py3-none-any.whl
Algorithm Hash digest
SHA256 2a362565e07b1926d309e857e867cde44f55cfa459168698bbcbc5f2f2c513ee
MD5 a0c1b9c2ab5cc284a52d77e10bf64c3f
BLAKE2b-256 fa26b39377b915ce5429db266b4dea125d0ffa543a38dee5741c7c6ba1de61ca

See more details on using hashes here.

Supported by

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