Skip to main content

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', ...]
}

Metadata

Release files for loqusdb 2.8.0

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

Source distribution (sdist)

Source distribution for loqusdb 2.8.0
File Size Uploaded
loqusdb-2.8.0.tar.gz 12.7 MB Details

Built distribution (wheel)

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

Total release size: 24.9 MB

Release files / loqusdb-2.8.0.tar.gz

Download URL loqusdb-2.8.0.tar.gz
Size 12.7 MB
Tags Source
SHA-256 checksum
How to use checksums
b57c16997c2f26342e5ec746ef2000dad46028da7a5d355c9142d1d8d3faef51
BLAKE2b-256 checksum
How to use checksums
970b18a644558c3238360cdf7f810324ec8fd4dadab68fa17e7d8a1a6142fffe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.12.14 Linux/6.17.0-1022-azure

Release files / loqusdb-2.8.0-py3-none-any.whl

Download URL loqusdb-2.8.0-py3-none-any.whl
Size 12.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
76ff3668ad54a26dea38ae07bb0e25e3b0586e37d21eb64505e6c4a1c94cb5ce
BLAKE2b-256 checksum
How to use checksums
9350c01c4d5c5525c066463ab29cacb445a9831b0634ca13eca75e8f848ab7b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.12.14 Linux/6.17.0-1022-azure

Release history Release notifications | RSS feed

This release

2.8.0 This release

2 release files

2.7.25

2 release files

2.7.24

2 release files

2.7.23

2 release files

2.7.19

2 release files

2.7.18

2 release files

2.7.17

2 release files

2.7.10

2 release files

2.7.9

2 release files

2.7.8

2 release files

2.7.7

2 release files

2.7.6

2 release files

2.7.4

2 release files

2.7.3

2 release files

2.7.2

2 release files

2.7.1

2 release files

2.7.0

2 release files

2.6.9

2 release files

2.6.8

2 release files

2.6.7

2 release files

2.6.6

2 release files

2.6.5

2 release files

2.6.4

2 release files

2.6.3

2 release files

2.6.2

2 release files

2.6.1

2 release files

2.6.0

2 release files

2.5.2

2 release files

2.5

2 release files

2.4

2 release files

2.3

2 release files

2.1

2 release files

2.0

2 release files

1.0

2 release files

0.5.1

2 release files

0.5

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4

2 release files

0.2

1 release file

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1

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