Store observations of vcf variants in a mongodb
Project description
loqusdb
Small tool to setup 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.
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 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, looks like:
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 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file loqusdb-2.6.0.tar.gz
.
File metadata
- Download URL: loqusdb-2.6.0.tar.gz
- Upload date:
- Size: 77.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21c9db41215f7cc2efc48e8e576b3e52adf5581d8c62c7dbb37070f9ae6d4b5a |
|
MD5 | eab48640640f386d95d83123a131c6cd |
|
BLAKE2b-256 | 24a51388ffe6fffa9afb3f5345125cacc8a852dd1682c07ea4bfecb9a82c33f2 |
File details
Details for the file loqusdb-2.6.0-py3-none-any.whl
.
File metadata
- Download URL: loqusdb-2.6.0-py3-none-any.whl
- Upload date:
- Size: 49.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d2299d0d5bd547f8ea2aea4e2c82783f72f507d50b48215ac6ff9105bc6c241 |
|
MD5 | 7502b5500acf5280f163f541dd5c5343 |
|
BLAKE2b-256 | f3af78c113cfa2740217ff4e906ef426abbd47ef76b9cc8e4ed74cb23f0dcc77 |