# loqusdb
[![Publish to PyPI](https://github.com/moonso/loqusdb/actions/workflows/build_and_publish.yml/badge.svg)](https://github.com/moonso/loqusdb/actions/workflows/build_and_publish.yml)
[![Coverage Status](https://coveralls.io/repos/github/moonso/loqusdb/badge.svg?branch=master)](https://coveralls.io/github/moonso/loqusdb?branch=master)
[![PyPI Version][pypi-img]][pypi-url]
Small tool to setup a local variant database. If you find loqusdb useful in your work, please cite the [article][publication].
Right now **locusdb** uses [mongodb][mongodb] as backend for
storing variants but there should not be a huge difference to use another
database manager.
## Installation ##
These instructions were written and tested using a conda environment with a version of **Python >=3.9**, which is required by the installer file (setup.py).
`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:
```yaml
uri: mongodb://loqusdb-username:loqusdb-pwd@localhost:27030/loqusdb-rd?authSource=admin
db_name: loqusdb_test
```
or
```yaml
host: localhost
port: 27030
username: loqusdb-username
password: loqusdb-pwd
authdb: admin
db_name: loqusdb_test
```
### Mongo ###
The collections looks like:
**Case**
```python
{
'case_id': 'case_id',
'vcf_path': 'path_to_vcf'
}
```
**Variant**
```python
{
'_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', ...]
}
```
[mongodb]: https://www.mongodb.org
[publication]: https://bmcbioinformatics.biomedcentral.com/articles/10.1186/s12859-020-03609-z
[pypi-img]: https://img.shields.io/pypi/v/loqusdb.svg?style=flat-square
[pypi-url]: https://pypi.python.org/pypi/loqusdb/
Raw data
{
"_id": null,
"home_page": "https://github.com/moonso/loqusdb",
"name": "loqusdb",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7.0",
"maintainer_email": "",
"keywords": "vcf,variants",
"author": "M\u00e5ns Magnusson",
"author_email": "mans.magnusson@scilifelab.com",
"download_url": "https://files.pythonhosted.org/packages/02/e7/3b9309ae19e121c4cfe8373b4d62549bf1bdaa1ca1c0d3663198179c5940/loqusdb-2.7.2.tar.gz",
"platform": null,
"description": "\n# loqusdb\n[![Publish to PyPI](https://github.com/moonso/loqusdb/actions/workflows/build_and_publish.yml/badge.svg)](https://github.com/moonso/loqusdb/actions/workflows/build_and_publish.yml)\n[![Coverage Status](https://coveralls.io/repos/github/moonso/loqusdb/badge.svg?branch=master)](https://coveralls.io/github/moonso/loqusdb?branch=master)\n[![PyPI Version][pypi-img]][pypi-url]\n\nSmall tool to setup a local variant database. If you find loqusdb useful in your work, please cite the [article][publication].\n\nRight now **locusdb** uses [mongodb][mongodb] as backend for\nstoring variants but there should not be a huge difference to use another\ndatabase manager.\n\n## Installation ##\n\nThese instructions were written and tested using a conda environment with a version of **Python >=3.9**, which is required by the installer file (setup.py).\n\n`pip install loqusdb`\n\nor\n\n```\n$git clone https://github.com/moonso/loqusdb\n$cd loqusdb\n$pip install --editable .\n```\n\n## Idea ##\n\nTool to keep track of what variants that have been seen and in what families they have been observed.\nThis is **NOT** a tool to create a true frequency database.\nIt will basically count the number of times we have seen a variant in any individual.\nWe will also keep track of the variants that have been seen in a homozygous or hemizygous state.\n\nVariants are stored by providing a vcf file and a (ped or ped like)family file.\n\nLoqusdb will first check if the vcf file looks ok.\n\nThe tool will then check all variants if they have been observed in any of the individuals in the family.\n\nWhen the variants are added:\n\n- Either the variant exists, in this case we increase the number of observations with one\n- Or this variant has not ben seen before, then the variant is added to database\n\n\n## Command Line Interface ##\n\n```\n$ loqusdb\nUsage: loqusdb [OPTIONS] COMMAND [ARGS]...\n\n loqusdb: manage a local variant count database.\n\nOptions:\n -db, --database TEXT Defaults to 'loqusdb' if not specified\n -u, --username TEXT\n -p, --password TEXT\n -a, --authdb TEXT If authentication should be done against\n another database than --database\n\n -port, --port INTEGER Specify the port where to look for the mongo\n database. [default: 27017]\n\n -h, --host TEXT Specify the host where to look for the mongo\n database. [default: localhost]\n\n --uri TEXT Specify a mongodb uri\n -c, --config FILENAME Use a config with db information\n -t, --test Used for testing. This will use a mongomock\n database.\n\n -g, --genome-build [GRCh37|GRCh38]\n Specify what genome build to use\n -v, --verbose\n --version Show the version and exit.\n --help Show this message and exit.\n\nCommands:\n annotate Annotate a VCF with observations\n cases Display cases in database\n delete Delete the variants of a family\n dump Dump the database\n export Export variants to VCF format\n identity Search identity collection\n index Add indexes to database\n load Load the variants of a family\n migrate Migrate an old loqusdb instance\n profile Loads variants to be used in profiling\n restore Restore database from dump\n update Update an existing case with a new type of variants\n variants Display variants in database\n wipe Wipe a loqusdb instance\n```\n\n\n## Database ##\n\n### Connecting ###\n\nConnection 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:\n\n```yaml\nuri: mongodb://loqusdb-username:loqusdb-pwd@localhost:27030/loqusdb-rd?authSource=admin\ndb_name: loqusdb_test\n```\nor\n```yaml\nhost: localhost\nport: 27030\nusername: loqusdb-username\npassword: loqusdb-pwd\nauthdb: admin\ndb_name: loqusdb_test\n```\n\n### Mongo ###\n\nThe collections looks like:\n\n**Case**\n\n```python\n{\n 'case_id': 'case_id',\n 'vcf_path': 'path_to_vcf'\n}\n```\n\n**Variant**\n\n```python\n{\n '_id': 'variant_id',\n 'chrom': 'CHROM',\n 'start': postition,\n 'end': end postition,\n 'ref': reference base(s),\n 'alt': alternative base(s),\n 'homozygote': number_of_homozygotes,\n 'hemizygote': number_of_hemizygotes,\n 'observations': number_of_observations,\n 'families': ['family_id', ...]\n}\n```\n\n[mongodb]: https://www.mongodb.org\n[publication]: https://bmcbioinformatics.biomedcentral.com/articles/10.1186/s12859-020-03609-z\n[pypi-img]: https://img.shields.io/pypi/v/loqusdb.svg?style=flat-square\n[pypi-url]: https://pypi.python.org/pypi/loqusdb/\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Store observations of vcf variants in a mongodb",
"version": "2.7.2",
"project_urls": {
"Homepage": "https://github.com/moonso/loqusdb"
},
"split_keywords": [
"vcf",
"variants"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "84b6c066c9446319755b2e8b754e350065c08daa4ea6e87bb3241883e4570706",
"md5": "1fac728ae9cd631671e3935444a1fcef",
"sha256": "f90ac07581c8571283f3fcab3185d8e813245f31e97f419e1713873cb633d9c2"
},
"downloads": -1,
"filename": "loqusdb-2.7.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1fac728ae9cd631671e3935444a1fcef",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7.0",
"size": 50204,
"upload_time": "2023-10-25T10:42:45",
"upload_time_iso_8601": "2023-10-25T10:42:45.090536Z",
"url": "https://files.pythonhosted.org/packages/84/b6/c066c9446319755b2e8b754e350065c08daa4ea6e87bb3241883e4570706/loqusdb-2.7.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "02e73b9309ae19e121c4cfe8373b4d62549bf1bdaa1ca1c0d3663198179c5940",
"md5": "72a40201b19fe962571dd3b8e34d36cc",
"sha256": "d3c14d9c67c1a4f34ce403c3bb2956b77460f04a41dbfd9b1b89919f6b93ad47"
},
"downloads": -1,
"filename": "loqusdb-2.7.2.tar.gz",
"has_sig": false,
"md5_digest": "72a40201b19fe962571dd3b8e34d36cc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7.0",
"size": 491978,
"upload_time": "2023-10-25T10:42:47",
"upload_time_iso_8601": "2023-10-25T10:42:47.135651Z",
"url": "https://files.pythonhosted.org/packages/02/e7/3b9309ae19e121c4cfe8373b4d62549bf1bdaa1ca1c0d3663198179c5940/loqusdb-2.7.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-25 10:42:47",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "moonso",
"github_project": "loqusdb",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "loqusdb"
}