loqusdb 2.7.10__py3-none-any.whl → 2.7.12__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. loqusdb/__init__.py +1 -1
  2. loqusdb/build_models/variant.py +9 -4
  3. loqusdb/commands/export.py +4 -1
  4. loqusdb/commands/load.py +10 -4
  5. loqusdb/commands/view.py +1 -2
  6. loqusdb/plugins/mongo/structural_variant.py +2 -2
  7. loqusdb/utils/load.py +6 -6
  8. loqusdb/utils/variant.py +5 -6
  9. {loqusdb-2.7.10.dist-info → loqusdb-2.7.12.dist-info}/METADATA +3 -2
  10. loqusdb-2.7.12.dist-info/RECORD +56 -0
  11. {loqusdb-2.7.10.dist-info → loqusdb-2.7.12.dist-info}/WHEEL +1 -1
  12. README.md +0 -148
  13. loqusdb-2.7.10.dist-info/RECORD +0 -97
  14. tests/build_models/test_build_case.py +0 -150
  15. tests/build_models/test_build_variant.py +0 -15
  16. tests/build_models/test_is_greater.py +0 -49
  17. tests/commands/test_export.py +0 -16
  18. tests/commands/test_identity.py +0 -22
  19. tests/commands/test_view.py +0 -17
  20. tests/conftest.py +0 -438
  21. tests/fixtures/643594.clinical.SV.vcf +0 -178
  22. tests/fixtures/643594.clinical.vcf.gz +0 -0
  23. tests/fixtures/double_variant.vcf +0 -21
  24. tests/fixtures/funny_trio.ped +0 -4
  25. tests/fixtures/profile_snv.vcf +0 -47
  26. tests/fixtures/recessive_trio.ped +0 -4
  27. tests/fixtures/test.SV.vcf +0 -178
  28. tests/fixtures/test.vcf +0 -26
  29. tests/fixtures/test.vcf.gz +0 -0
  30. tests/fixtures/test.vcf.gz.tbi +0 -0
  31. tests/fixtures/unsorted.vcf +0 -20
  32. tests/functional/test_cli.py +0 -213
  33. tests/plugins/mongo/test_case_operations.py +0 -143
  34. tests/plugins/mongo/test_connect.py +0 -8
  35. tests/plugins/mongo/test_flask_extension.py +0 -27
  36. tests/plugins/mongo/test_get_sv.py +0 -27
  37. tests/plugins/mongo/test_load_svs.py +0 -74
  38. tests/plugins/mongo/test_variant_operations.py +0 -278
  39. tests/utils/test_case.py +0 -34
  40. tests/utils/test_delete.py +0 -73
  41. tests/utils/test_delete_family.py +0 -30
  42. tests/utils/test_delete_variant.py +0 -74
  43. tests/utils/test_get_family.py +0 -13
  44. tests/utils/test_load_database.py +0 -52
  45. tests/utils/test_load_family.py +0 -69
  46. tests/utils/test_load_variants.py +0 -225
  47. tests/utils/test_migrate.py +0 -38
  48. tests/utils/test_profiling.py +0 -68
  49. tests/vcf_tools/test_check_par.py +0 -67
  50. tests/vcf_tools/test_check_vcf.py +0 -64
  51. tests/vcf_tools/test_format_sv_variant.py +0 -102
  52. tests/vcf_tools/test_format_variant.py +0 -113
  53. tests/vcf_tools/test_vcf.py +0 -63
  54. {loqusdb-2.7.10.dist-info → loqusdb-2.7.12.dist-info}/LICENSE +0 -0
  55. {loqusdb-2.7.10.dist-info → loqusdb-2.7.12.dist-info}/entry_points.txt +0 -0
loqusdb/__init__.py CHANGED
@@ -4,7 +4,7 @@ from pymongo import ASCENDING, IndexModel
4
4
 
5
5
  logger = logging.getLogger(__name__)
6
6
 
7
- __version__ = "2.7.10"
7
+ __version__ = "2.7.12"
8
8
 
9
9
  INDEXES = {
10
10
  "variant": [
@@ -1,10 +1,9 @@
1
1
  import logging
2
2
  from collections import namedtuple
3
+ from typing import Optional
3
4
 
4
5
  import cyvcf2
5
6
 
6
- from typing import Optional
7
-
8
7
  from loqusdb.constants import CHROM_TO_INT, GENOTYPE_MAP, GRCH37, PAR
9
8
  from loqusdb.models import Case, Variant
10
9
 
@@ -143,7 +142,14 @@ def get_coords(variant):
143
142
  return coordinates
144
143
 
145
144
 
146
- def build_variant(variant: cyvcf2.Variant, case_obj: Case, case_id: Optional[str]=None, gq_threshold: Optional[int]=None, gq_qual: Optional[bool]=False, genome_build: Optional[str]=None) -> Variant:
145
+ def build_variant(
146
+ variant: cyvcf2.Variant,
147
+ case_obj: Case,
148
+ case_id: Optional[str] = None,
149
+ gq_threshold: Optional[int] = None,
150
+ gq_qual: Optional[bool] = False,
151
+ genome_build: Optional[str] = None,
152
+ ) -> Variant:
147
153
  """Return a Variant object
148
154
 
149
155
  Take a cyvcf2 formated variant line and return a models.Variant.
@@ -191,7 +197,6 @@ def build_variant(variant: cyvcf2.Variant, case_obj: Case, case_id: Optional[str
191
197
  else:
192
198
  found_variant = False
193
199
  for ind_obj in case_obj["individuals"]:
194
- ind_id = ind_obj["ind_id"]
195
200
  # Get the index position for the individual in the VCF
196
201
  ind_pos = ind_obj["ind_index"]
197
202
 
@@ -59,7 +59,10 @@ def export(ctx, outfile, variant_type, freq):
59
59
  head.add_meta_line("NrCases", nr_cases)
60
60
  if freq:
61
61
  head.add_info(
62
- "Frq", "1", "Float", "Observation frequency of the variant (not allele frequency)"
62
+ "Frq",
63
+ "1",
64
+ "Float",
65
+ f"Observation frequency of the variant (not allele frequency) based on {nr_cases} cases",
63
66
  )
64
67
  head.add_info("Obs", "1", "Integer", "The number of observations for the variant")
65
68
  head.add_info("Hom", "1", "Integer", "The number of observed homozygotes")
loqusdb/commands/load.py CHANGED
@@ -3,10 +3,10 @@ import os
3
3
  from datetime import datetime
4
4
 
5
5
  import click
6
- from loqusdb.exceptions import CaseError
7
- from loqusdb.utils.load import load_database
8
6
 
9
7
  from loqusdb.commands.cli import cli as base_command
8
+ from loqusdb.exceptions import CaseError
9
+ from loqusdb.utils.load import load_database
10
10
 
11
11
  LOG = logging.getLogger(__name__)
12
12
 
@@ -55,7 +55,13 @@ def validate_profile_threshold(ctx, param, value):
55
55
  )
56
56
  @click.option("--ensure-index", is_flag=True, help="Make sure that the indexes are in place")
57
57
  @click.option("--gq-threshold", default=20, show_default=True, help="Threshold to consider variant")
58
- @click.option("--qual-gq", is_flag=True, default=False, show_default=True, help="Use QUAL tag instead of GQ value for quality filter")
58
+ @click.option(
59
+ "--qual-gq",
60
+ is_flag=True,
61
+ default=False,
62
+ show_default=True,
63
+ help="Use QUAL tag instead of GQ value for quality filter",
64
+ )
59
65
  @click.option(
60
66
  "--max-window",
61
67
  "-m",
@@ -97,7 +103,7 @@ def load(
97
103
  check_profile,
98
104
  hard_threshold,
99
105
  soft_threshold,
100
- qual_gq
106
+ qual_gq,
101
107
  ):
102
108
  """Load the variants of a case
103
109
 
loqusdb/commands/view.py CHANGED
@@ -2,9 +2,9 @@
2
2
  import json
3
3
  import logging
4
4
  from pprint import pprint as pp
5
- from pymongo.cursor import Cursor
6
5
 
7
6
  import click
7
+ from pymongo.cursor import Cursor
8
8
 
9
9
  from loqusdb.commands.cli import cli as base_command
10
10
 
@@ -49,7 +49,6 @@ def cases(ctx, case_id, to_json, count, case_type):
49
49
  ctx.abort()
50
50
  cases: Cursor = adapter.cases()
51
51
 
52
-
53
52
  if to_json:
54
53
  click.echo(json.dumps(cases))
55
54
  return
@@ -1,8 +1,9 @@
1
1
  import logging
2
2
 
3
- from loqusdb.models import Identity
4
3
  from pymongo import ASCENDING
5
4
 
5
+ from loqusdb.models import Identity
6
+
6
7
  LOG = logging.getLogger(__name__)
7
8
 
8
9
 
@@ -175,7 +176,6 @@ class SVMixin:
175
176
  self.db.identity.delete_one(dict(identity_obj))
176
177
 
177
178
  def _update_sv_metrics(self, sv_type, pos_mean, end_mean, max_window):
178
-
179
179
  """
180
180
  calculates cluster length, and interval size for SV based on
181
181
  mean start position and mean end position.
loqusdb/utils/load.py CHANGED
@@ -11,15 +11,14 @@ import logging
11
11
 
12
12
  import click
13
13
 
14
+ from loqusdb.build_models.case import build_case
15
+ from loqusdb.build_models.profile_variant import build_profile_variant
16
+ from loqusdb.build_models.variant import build_variant
14
17
  from loqusdb.exceptions import CaseError, VcfError
15
-
16
18
  from loqusdb.utils.case import get_case, update_case
17
19
  from loqusdb.utils.delete import delete
18
20
  from loqusdb.utils.profiling import get_profiles, profile_match
19
21
  from loqusdb.utils.vcf import check_vcf, get_vcf
20
- from loqusdb.build_models.case import build_case
21
- from loqusdb.build_models.profile_variant import build_profile_variant
22
- from loqusdb.build_models.variant import build_variant
23
22
 
24
23
  LOG = logging.getLogger(__name__)
25
24
 
@@ -226,7 +225,9 @@ def load_variants(
226
225
  with click.progressbar(vcf_obj, label="Inserting variants", length=nr_variants) as bar:
227
226
 
228
227
  variants = (
229
- build_variant(variant, case_obj, case_id, gq_threshold, qual_gq, genome_build=genome_build)
228
+ build_variant(
229
+ variant, case_obj, case_id, gq_threshold, qual_gq, genome_build=genome_build
230
+ )
230
231
  for variant in bar
231
232
  )
232
233
 
@@ -258,7 +259,6 @@ def load_profile_variants(adapter, variant_file):
258
259
  """
259
260
 
260
261
  vcf_info = check_vcf(variant_file)
261
- nr_variants = vcf_info["nr_variants"]
262
262
  variant_type = vcf_info["variant_type"]
263
263
 
264
264
  if variant_type != "snv":
loqusdb/utils/variant.py CHANGED
@@ -32,14 +32,13 @@ def format_info(variant, variant_type="snv", nr_cases=None, add_freq=False):
32
32
 
33
33
  # This is SV specific
34
34
  if variant_type == "sv":
35
- pos= int((variant["pos_left"] + variant["pos_right"]) / 2)
35
+ pos = int((variant["pos_left"] + variant["pos_right"]) / 2)
36
36
  end = int((variant["end_left"] + variant["end_right"]) / 2)
37
37
 
38
- if not variant['sv_type'] == "BND":
38
+ if not variant["sv_type"] == "BND":
39
39
  vcf_info += f";SVTYPE={variant['sv_type']};END={end};SVLEN={variant['length']}"
40
40
  else:
41
- vcf_info += f";SVTYPE=BND"
42
-
41
+ vcf_info += ";SVTYPE=BND"
43
42
 
44
43
  return vcf_info
45
44
 
@@ -63,10 +62,10 @@ def format_variant(variant, variant_type="snv", nr_cases=None, add_freq=False):
63
62
 
64
63
  if variant_type == "sv":
65
64
  pos = int((variant["pos_left"] + variant["pos_right"]) / 2)
66
- end= int((variant["end_left"] + variant["end_right"]) / 2)
65
+ end = int((variant["end_left"] + variant["end_right"]) / 2)
67
66
  ref = "N"
68
67
 
69
- if not variant['sv_type'] == "BND":
68
+ if not variant["sv_type"] == "BND":
70
69
  alt = f"<{variant['sv_type']}>"
71
70
  else:
72
71
  alt = f"N]{variant['end_chrom']}:{end}]"
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: loqusdb
3
- Version: 2.7.10
3
+ Version: 2.7.12
4
4
  Summary: A simple observation count database
5
5
  License: MIT
6
6
  Author: Your Name
@@ -9,6 +9,7 @@ Requires-Python: >=3.12,<4.0
9
9
  Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Programming Language :: Python :: 3
11
11
  Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
12
13
  Requires-Dist: PyYAML
13
14
  Requires-Dist: click
14
15
  Requires-Dist: coloredlogs
@@ -0,0 +1,56 @@
1
+ loqusdb/__init__.py,sha256=8HkygPjhH1mlqoo1IXBaXPSGUkIRHyhkkz5f29Am25I,1688
2
+ loqusdb/__main__.py,sha256=8FGKySAGaWSzAYMj6HRsxeyiME3V01Idt7HrmN7pSYY,397
3
+ loqusdb/build_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ loqusdb/build_models/case.py,sha256=AByutEYK2N3kS9JFvyZfPKNZdCpZHCSD0nNHAgaU1Cs,4127
5
+ loqusdb/build_models/profile_variant.py,sha256=TbSxfVjESstS_FgbkOW4NQwMQVeTyhn9oc9yPZmDhzI,1021
6
+ loqusdb/build_models/variant.py,sha256=2ate8viYhHK1yX7UvCzEPgfuuXwTgAApU_2E5jl1ZO4,6934
7
+ loqusdb/commands/__init__.py,sha256=BXAN3UADgqPrkGczzjlLO9GyyQ96dnLnP7n92JlYHgo,603
8
+ loqusdb/commands/annotate.py,sha256=748kImopE5WbaO1nuv3WUgIqezWFSsi7SBeWhOz26-s,1384
9
+ loqusdb/commands/cli.py,sha256=wJD5S1BoCxtRTAobd1QtmQpzlngJg-mt1nsyD92fDD4,3176
10
+ loqusdb/commands/delete.py,sha256=R6ysHKSMw1mmL4ZbktoUIKzdzDLQ3314YPYhIy1myic,1979
11
+ loqusdb/commands/export.py,sha256=DPcMo4QgTCA5fu8x_IWZ9YskRl4_ikKARXpnuFr1iow,3302
12
+ loqusdb/commands/identity.py,sha256=KLA9c8e6cJFDxtqIa1G6zdHTHK1sz2b3v1Utdtik_4k,787
13
+ loqusdb/commands/load.py,sha256=sDGCOGbukdfebLn1iBGyWoI6t3tijLzywP1tg3WheQI,4431
14
+ loqusdb/commands/load_profile.py,sha256=cflCbF9f77_HCH8xPnN8zSSocvIffRMnC2LPE0j7Xq8,3336
15
+ loqusdb/commands/migrate.py,sha256=2C8YL-zVqnpnqg3JIyUr0rbVnb8-AGPVWNhicHnPKLo,667
16
+ loqusdb/commands/restore.py,sha256=eqPX0yao0IAYS5SbjCdlsfSJRBbRByBLISUU2hTzqqs,1492
17
+ loqusdb/commands/update.py,sha256=zz3wueaJVqJ1FKact-rpY2az__5oa1LnZKf7mgqNGPk,3211
18
+ loqusdb/commands/view.py,sha256=PkwyvzQgq5ArrEakI-lKQThrhjBLLl2gYejHI2g13WU,5197
19
+ loqusdb/commands/wipe.py,sha256=WTOjyNooCUhtmZ6pdcPFa0PZrFc9E_pkLbnat_zP96M,553
20
+ loqusdb/constants/__init__.py,sha256=r6y2TN8BqbKuh2Uyxq0trh-3A9xiWeStqWlvEPp-rSA,1645
21
+ loqusdb/exceptions/__init__.py,sha256=Fq0UQg9TepWh19D7WT3dARyAHvorwJF6phhnZi2AkxE,88
22
+ loqusdb/exceptions/case.py,sha256=n3mGF7RIc1imQFxnNJ1TWxeJeMWN4MHsKxoZb0m1-Os,92
23
+ loqusdb/exceptions/profile.py,sha256=TVkRXh3ZbkNCmFHzZTCuhPP3iFWBwP1YQGD8IlSoCTo,98
24
+ loqusdb/exceptions/vcf.py,sha256=QMpr9oRzYtMaHzP8wtSU5HiXGmi4k48YnjCilNZ0j2M,95
25
+ loqusdb/log.py,sha256=CDcrCjzs9ef-d5Wg8Q_41bCOZRM5j8PyP06kNcynTj0,1691
26
+ loqusdb/models/__init__.py,sha256=yf0wONlDuGkztsOv15BFulYyQxdzqhuUKpL-R_clDVM,139
27
+ loqusdb/models/case.py,sha256=EJOkrAMJfS6eID3E7QtWkoa_tMMf21KV3Z5B-U0c-Wk,1660
28
+ loqusdb/models/identity.py,sha256=3DBlaZtrEtoiSU6nMXs7zY-mvy-9ew08-ZPjr_F3x3c,511
29
+ loqusdb/models/profile_variant.py,sha256=7Y7HRnoOfhvThAuuaXWe2tOr0u2wktSFr5GmoLuDhg8,409
30
+ loqusdb/models/variant.py,sha256=9QpM0ojJ24tKY9RrcgC411Wjnl3uRUawVYo6RWz1gXY,1068
31
+ loqusdb/plugins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
+ loqusdb/plugins/mongo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
+ loqusdb/plugins/mongo/adapter.py,sha256=rRUQ2y_bZwjINbdTtfzJ_1JwE0Ns0usyAJ3o0O1Y10I,2593
34
+ loqusdb/plugins/mongo/case.py,sha256=zKnaaam8Ey1AEH-1GofXp6iNqgmSvWWxZZWsx7dAO0Y,3006
35
+ loqusdb/plugins/mongo/profile_variant.py,sha256=madOBa3HacIN_T1V8mp7NEC4QOpqQBqSY6pKTObkMLA,600
36
+ loqusdb/plugins/mongo/structural_variant.py,sha256=7NjdRxRVzp4huTTEPI-buKoG7N5d_5LH11GHcncwboE,12955
37
+ loqusdb/plugins/mongo/variant.py,sha256=NS3N8bhRap1b2ZSGjOw2LO6l7q_CzD00GZs499l38Tg,8715
38
+ loqusdb/resources/__init__.py,sha256=JOx3Ppgtghx55cOJN0bfBonSXM5DM_v0OFdlT-Qybg4,639
39
+ loqusdb/resources/loqusdb.20181005.gz,sha256=DI8CLI7fPnIAjM25Avraz-C7KQkOKsfnhgZWguGat9Y,12172904
40
+ loqusdb/resources/maf_50_sites_GRCh37.vcf.gz,sha256=BoD1_xZ-Rr8DTWCMNlQGh7gz1K8FA-j2nC4jKn_eB2A,5260
41
+ loqusdb/resources/maf_50_sites_GRCh38.vcf.gz,sha256=6T4iyrIr6yx1HpgobzAsh305BO1JX0oGj48nFiYt2QM,9037
42
+ loqusdb/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
+ loqusdb/utils/annotate.py,sha256=cPNWlhsv6yoe3lxNfa9DytO5eACuM_mOJJw_mglVMN0,2646
44
+ loqusdb/utils/case.py,sha256=aeTvyACJTDjzl-aOjAZaUzFMLisgFKMfcoXSvNAZz4s,2168
45
+ loqusdb/utils/delete.py,sha256=-ddBM_QXKzlUN6egEJggKzXX1P-WEdi92HgaD1DJRtg,4843
46
+ loqusdb/utils/load.py,sha256=ZdsnmHTVGOjwG24Fm5gcUu7tcLwYSqvh3W9j6ixqyF0,8239
47
+ loqusdb/utils/migrate.py,sha256=9Q6kdIi9TpFVzDYptlEE8RqPPS5wyzfM3F8egzmmBBk,1113
48
+ loqusdb/utils/profiling.py,sha256=3OizF7CpYvSl9kyl2g4KGJxbIRUqWfmfLxn3843XYDk,9164
49
+ loqusdb/utils/update.py,sha256=1edJG-u24FgOSxyXAQEiyTG4IyK-Uo3lSIl5qyzcXsI,4433
50
+ loqusdb/utils/variant.py,sha256=U6nMZRUf5NDDQ74nG0HBCLMnFQVgFAT6eHll_F2uiwc,2087
51
+ loqusdb/utils/vcf.py,sha256=ybmrTBEPYa0FbUXo8ttlwATk13RnKjX9eIDbRDwCiVE,5175
52
+ loqusdb-2.7.12.dist-info/LICENSE,sha256=urpFcJXw3elN9kV2fFutc-lXegjuu2lqP_GSy8_CAbs,1054
53
+ loqusdb-2.7.12.dist-info/METADATA,sha256=xuej6Yy1Xc1YBsrc1YxlnTO6MkMr80_HoDAYqVcqzKs,5321
54
+ loqusdb-2.7.12.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
55
+ loqusdb-2.7.12.dist-info/entry_points.txt,sha256=wFoWzEFjsSgXkj9FMQA8C9ihZoJ9R1XvbGuX9hEEI6E,52
56
+ loqusdb-2.7.12.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.0
2
+ Generator: poetry-core 2.0.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
README.md DELETED
@@ -1,148 +0,0 @@
1
- # loqusdb
2
- [![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)
3
- [![Coverage Status](https://coveralls.io/repos/github/moonso/loqusdb/badge.svg?branch=master)](https://coveralls.io/github/moonso/loqusdb?branch=master)
4
- [![PyPI Version][pypi-img]][pypi-url]
5
-
6
- Small tool to set up a local variant database.
7
- If you find Loqusdb useful in your work, please cite the [article][publication].
8
-
9
- Right now **Locusdb** uses [mongodb][mongodb] as backend for
10
- storing variants, but there should not be a huge difference to use another
11
- database manager.
12
-
13
- ## Installation ##
14
-
15
-
16
- `poetry install`
17
-
18
- or
19
-
20
- ```
21
- $git clone https://github.com/moonso/loqusdb
22
- $cd loqusdb
23
- $poetry install
24
- ```
25
-
26
- ## Idea ##
27
-
28
- Tool to keep track of what variants that have been seen and in what families they have been observed.
29
- This is **NOT** a tool to create a true frequency database.
30
- It will basically count the number of times we have seen a variant in any individual.
31
- We will also keep track of the variants that have been seen in a homozygous or hemizygous state.
32
-
33
- Variants are stored by providing a VCF file and a (ped or ped like) family file.
34
-
35
- Loqusdb will first check if the VCF file adheres to the VCF format.
36
-
37
- The tool will then check all variants if they have been observed in any of the individuals in the family.
38
-
39
- When the variants are added:
40
-
41
- - Either the variant exists, in this case we increase the number of observations with one
42
- - Or this variant has not been seen before, then the variant is added to the database
43
-
44
-
45
- ## Command Line Interface ##
46
-
47
- ```
48
- $ loqusdb
49
- Usage: loqusdb [OPTIONS] COMMAND [ARGS]...
50
-
51
- loqusdb: manage a local variant count database.
52
-
53
- Options:
54
- -db, --database TEXT Defaults to 'loqusdb' if not specified
55
- -u, --username TEXT
56
- -p, --password TEXT
57
- -a, --authdb TEXT If authentication should be done against
58
- another database than --database
59
-
60
- -port, --port INTEGER Specify the port where to look for the mongo
61
- database. [default: 27017]
62
-
63
- -h, --host TEXT Specify the host where to look for the mongo
64
- database. [default: localhost]
65
-
66
- --uri TEXT Specify a mongodb uri
67
- -c, --config FILENAME Use a config with db information
68
- -t, --test Used for testing. This will use a mongomock
69
- database.
70
-
71
- -g, --genome-build [GRCh37|GRCh38]
72
- Specify what genome build to use
73
- -v, --verbose
74
- --version Show the version and exit.
75
- --help Show this message and exit.
76
-
77
- Commands:
78
- annotate Annotate a VCF with observations
79
- cases Display cases in database
80
- delete Delete the variants of a family
81
- dump Dump the database
82
- export Export variants to VCF format
83
- identity Search identity collection
84
- index Add indexes to database
85
- load Load the variants of a family
86
- migrate Migrate an old loqusdb instance
87
- profile Loads variants to be used in profiling
88
- restore Restore database from dump
89
- update Update an existing case with a new type of variants
90
- variants Display variants in database
91
- wipe Wipe a loqusdb instance
92
- ```
93
-
94
-
95
- ## Database ##
96
-
97
- ### Connecting ###
98
-
99
- 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:
100
-
101
- ```yaml
102
- uri: mongodb://loqusdb-username:loqusdb-pwd@localhost:27030/loqusdb-rd?authSource=admin
103
- db_name: loqusdb_test
104
- ```
105
- or
106
- ```yaml
107
- host: localhost
108
- port: 27030
109
- username: loqusdb-username
110
- password: loqusdb-pwd
111
- authdb: admin
112
- db_name: loqusdb_test
113
- ```
114
-
115
- ### Mongo ###
116
-
117
- The collections are defined as follows:
118
-
119
- **Case**
120
-
121
- ```python
122
- {
123
- 'case_id': 'case_id',
124
- 'vcf_path': 'path_to_vcf'
125
- }
126
- ```
127
-
128
- **Variant**
129
-
130
- ```python
131
- {
132
- '_id': 'variant_id',
133
- 'chrom': 'CHROM',
134
- 'start': postition,
135
- 'end': end postition,
136
- 'ref': reference base(s),
137
- 'alt': alternative base(s),
138
- 'homozygote': number_of_homozygotes,
139
- 'hemizygote': number_of_hemizygotes,
140
- 'observations': number_of_observations,
141
- 'families': ['family_id', ...]
142
- }
143
- ```
144
-
145
- [mongodb]: https://www.mongodb.org
146
- [publication]: https://bmcbioinformatics.biomedcentral.com/articles/10.1186/s12859-020-03609-z
147
- [pypi-img]: https://img.shields.io/pypi/v/loqusdb.svg?style=flat-square
148
- [pypi-url]: https://pypi.python.org/pypi/loqusdb/
@@ -1,97 +0,0 @@
1
- README.md,sha256=0-XD0EEYvCnenT07wkO0ZX6lJbzN8OC1cV3M9G47nps,4648
2
- loqusdb/__init__.py,sha256=kpB-4LlsICY9AfcuMV_bs-94IjgIkzfQr9yfPJizESk,1688
3
- loqusdb/__main__.py,sha256=8FGKySAGaWSzAYMj6HRsxeyiME3V01Idt7HrmN7pSYY,397
4
- loqusdb/build_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- loqusdb/build_models/case.py,sha256=AByutEYK2N3kS9JFvyZfPKNZdCpZHCSD0nNHAgaU1Cs,4127
6
- loqusdb/build_models/profile_variant.py,sha256=TbSxfVjESstS_FgbkOW4NQwMQVeTyhn9oc9yPZmDhzI,1021
7
- loqusdb/build_models/variant.py,sha256=LviEaovB_s_-jaLM64x0NzqzilFr__NPgv4Vf49Rhbk,6939
8
- loqusdb/commands/__init__.py,sha256=BXAN3UADgqPrkGczzjlLO9GyyQ96dnLnP7n92JlYHgo,603
9
- loqusdb/commands/annotate.py,sha256=748kImopE5WbaO1nuv3WUgIqezWFSsi7SBeWhOz26-s,1384
10
- loqusdb/commands/cli.py,sha256=wJD5S1BoCxtRTAobd1QtmQpzlngJg-mt1nsyD92fDD4,3176
11
- loqusdb/commands/delete.py,sha256=R6ysHKSMw1mmL4ZbktoUIKzdzDLQ3314YPYhIy1myic,1979
12
- loqusdb/commands/export.py,sha256=-9SHgvr0G8FlyW0FGSfe1dmNDnjx4HKAaa-xYzSkvNc,3238
13
- loqusdb/commands/identity.py,sha256=KLA9c8e6cJFDxtqIa1G6zdHTHK1sz2b3v1Utdtik_4k,787
14
- loqusdb/commands/load.py,sha256=cVDdY7meBfcv8nMEGsjAX6aE-SKDOceGqM2vAvXPhko,4407
15
- loqusdb/commands/load_profile.py,sha256=cflCbF9f77_HCH8xPnN8zSSocvIffRMnC2LPE0j7Xq8,3336
16
- loqusdb/commands/migrate.py,sha256=2C8YL-zVqnpnqg3JIyUr0rbVnb8-AGPVWNhicHnPKLo,667
17
- loqusdb/commands/restore.py,sha256=eqPX0yao0IAYS5SbjCdlsfSJRBbRByBLISUU2hTzqqs,1492
18
- loqusdb/commands/update.py,sha256=zz3wueaJVqJ1FKact-rpY2az__5oa1LnZKf7mgqNGPk,3211
19
- loqusdb/commands/view.py,sha256=kQ_HuFhIX5wTHoEFC6atH-5unQFkRtopzD2_GqHNPKY,5198
20
- loqusdb/commands/wipe.py,sha256=WTOjyNooCUhtmZ6pdcPFa0PZrFc9E_pkLbnat_zP96M,553
21
- loqusdb/constants/__init__.py,sha256=r6y2TN8BqbKuh2Uyxq0trh-3A9xiWeStqWlvEPp-rSA,1645
22
- loqusdb/exceptions/__init__.py,sha256=Fq0UQg9TepWh19D7WT3dARyAHvorwJF6phhnZi2AkxE,88
23
- loqusdb/exceptions/case.py,sha256=n3mGF7RIc1imQFxnNJ1TWxeJeMWN4MHsKxoZb0m1-Os,92
24
- loqusdb/exceptions/profile.py,sha256=TVkRXh3ZbkNCmFHzZTCuhPP3iFWBwP1YQGD8IlSoCTo,98
25
- loqusdb/exceptions/vcf.py,sha256=QMpr9oRzYtMaHzP8wtSU5HiXGmi4k48YnjCilNZ0j2M,95
26
- loqusdb/log.py,sha256=CDcrCjzs9ef-d5Wg8Q_41bCOZRM5j8PyP06kNcynTj0,1691
27
- loqusdb/models/__init__.py,sha256=yf0wONlDuGkztsOv15BFulYyQxdzqhuUKpL-R_clDVM,139
28
- loqusdb/models/case.py,sha256=EJOkrAMJfS6eID3E7QtWkoa_tMMf21KV3Z5B-U0c-Wk,1660
29
- loqusdb/models/identity.py,sha256=3DBlaZtrEtoiSU6nMXs7zY-mvy-9ew08-ZPjr_F3x3c,511
30
- loqusdb/models/profile_variant.py,sha256=7Y7HRnoOfhvThAuuaXWe2tOr0u2wktSFr5GmoLuDhg8,409
31
- loqusdb/models/variant.py,sha256=9QpM0ojJ24tKY9RrcgC411Wjnl3uRUawVYo6RWz1gXY,1068
32
- loqusdb/plugins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
- loqusdb/plugins/mongo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
- loqusdb/plugins/mongo/adapter.py,sha256=rRUQ2y_bZwjINbdTtfzJ_1JwE0Ns0usyAJ3o0O1Y10I,2593
35
- loqusdb/plugins/mongo/case.py,sha256=zKnaaam8Ey1AEH-1GofXp6iNqgmSvWWxZZWsx7dAO0Y,3006
36
- loqusdb/plugins/mongo/profile_variant.py,sha256=madOBa3HacIN_T1V8mp7NEC4QOpqQBqSY6pKTObkMLA,600
37
- loqusdb/plugins/mongo/structural_variant.py,sha256=RPc3GF37-O3GqRS9Z5PRxsBXACljfRT4KFsrEl0jCu0,12955
38
- loqusdb/plugins/mongo/variant.py,sha256=NS3N8bhRap1b2ZSGjOw2LO6l7q_CzD00GZs499l38Tg,8715
39
- loqusdb/resources/__init__.py,sha256=JOx3Ppgtghx55cOJN0bfBonSXM5DM_v0OFdlT-Qybg4,639
40
- loqusdb/resources/loqusdb.20181005.gz,sha256=DI8CLI7fPnIAjM25Avraz-C7KQkOKsfnhgZWguGat9Y,12172904
41
- loqusdb/resources/maf_50_sites_GRCh37.vcf.gz,sha256=BoD1_xZ-Rr8DTWCMNlQGh7gz1K8FA-j2nC4jKn_eB2A,5260
42
- loqusdb/resources/maf_50_sites_GRCh38.vcf.gz,sha256=6T4iyrIr6yx1HpgobzAsh305BO1JX0oGj48nFiYt2QM,9037
43
- loqusdb/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
44
- loqusdb/utils/annotate.py,sha256=cPNWlhsv6yoe3lxNfa9DytO5eACuM_mOJJw_mglVMN0,2646
45
- loqusdb/utils/case.py,sha256=aeTvyACJTDjzl-aOjAZaUzFMLisgFKMfcoXSvNAZz4s,2168
46
- loqusdb/utils/delete.py,sha256=-ddBM_QXKzlUN6egEJggKzXX1P-WEdi92HgaD1DJRtg,4843
47
- loqusdb/utils/load.py,sha256=rujUk89lL5jO35QfO8NKGJkjEJmN6PQxohKkxtpnw6Y,8252
48
- loqusdb/utils/migrate.py,sha256=9Q6kdIi9TpFVzDYptlEE8RqPPS5wyzfM3F8egzmmBBk,1113
49
- loqusdb/utils/profiling.py,sha256=3OizF7CpYvSl9kyl2g4KGJxbIRUqWfmfLxn3843XYDk,9164
50
- loqusdb/utils/update.py,sha256=1edJG-u24FgOSxyXAQEiyTG4IyK-Uo3lSIl5qyzcXsI,4433
51
- loqusdb/utils/variant.py,sha256=Lq5x9egVB-3rExBiRceF67TaL4Hp2gGoWMSRBEcnm4Q,2088
52
- loqusdb/utils/vcf.py,sha256=ybmrTBEPYa0FbUXo8ttlwATk13RnKjX9eIDbRDwCiVE,5175
53
- tests/build_models/test_build_case.py,sha256=4CzykSmiBgAVZWlqzjLTjBmY9NafzmPol7LiEu4003U,4404
54
- tests/build_models/test_build_variant.py,sha256=-9ulYBNBIxAGt_FiyaADWLuTJ4bWwRVVfMbjzummMZA,537
55
- tests/build_models/test_is_greater.py,sha256=sAz_UB6oGr72Pqc7ZEbPTw6N07E0QR-Yvn8UCEi0yP8,1360
56
- tests/commands/test_export.py,sha256=PGLtmxbOzEgWsS9AqAQkjBY9NlQiHdWfrt7DAPUSzrY,439
57
- tests/commands/test_identity.py,sha256=uEYPNkBvyQScrMRGpBqpINLDN3MgGt2nqXXjAkowQvc,566
58
- tests/commands/test_view.py,sha256=wUM5DXqDBs0OP-KsWh1_Lizhizvt5-GFawgOKgN4FDM,659
59
- tests/conftest.py,sha256=F7teEGvH3mD1zO5tqd_yEWneFrmW5U8d74-IDDSAXoI,10531
60
- tests/fixtures/643594.clinical.SV.vcf,sha256=e-RVC96kxwrohNmiZ7xHAHcTcnWI5-NSpOVMX2zGsXA,59626
61
- tests/fixtures/643594.clinical.vcf.gz,sha256=CuGqNRVLnkPDy8JM9i8JhYQZn28CDM1eGenECi2dD4E,413153
62
- tests/fixtures/double_variant.vcf,sha256=LlVy4mW1-HAw0dyJpWPJTbAGQm5LZOtOuD2uLkbJE7w,2165
63
- tests/fixtures/funny_trio.ped,sha256=t4Mroxg51i5zhLPnbbWSXaC2aKgETMvNcfQc-ArjFpk,130
64
- tests/fixtures/profile_snv.vcf,sha256=SdQA2CCzCLCrwYEEod2yuZsVt6--8dHppUVyaIKxan0,5420
65
- tests/fixtures/recessive_trio.ped,sha256=leXtMPWrwXeDQY557R_sL5QLcewu1uwHFsn8moOjMCY,148
66
- tests/fixtures/test.SV.vcf,sha256=OqNrkQQpgbXs2L1en7S6C8A0KFCKDn4w1czRRAU-lEY,59618
67
- tests/fixtures/test.vcf,sha256=AGTIHfmy_c2R0CUSwia7HjvyEYUWLi-uZVam38k9hg8,2393
68
- tests/fixtures/test.vcf.gz,sha256=3XRv5PmJro-Dm8duXrByuAqrBSfsM9dnQjZuRE4Rru8,652
69
- tests/fixtures/test.vcf.gz.tbi,sha256=ew7qzOaJQlmMyI8Oq-kmnba4mFnCtD2INpN4RXhKgVQ,267
70
- tests/fixtures/unsorted.vcf,sha256=NSsdgsVVJuJwd3udD__GBrZaregz4qa_egDg4OzBLF4,2049
71
- tests/functional/test_cli.py,sha256=XO7toMozpFU3MrqxSqsqKjUgeLSbeEmNtLSmGePWuXg,8095
72
- tests/plugins/mongo/test_case_operations.py,sha256=SJ9KHiDV7iHRtxu-4C9mp9uSKQ5wen3hoqK0W7JULGA,4271
73
- tests/plugins/mongo/test_connect.py,sha256=RsyDY5T9BkkgZANyOrMZ3-nXRZX8sjvBH7E1BD5noYU,199
74
- tests/plugins/mongo/test_flask_extension.py,sha256=UtvMJbRqVcVn82b9sGL-IQCK5GBW2KdnhckLuB9Dqkk,738
75
- tests/plugins/mongo/test_get_sv.py,sha256=9LBnCv7zLjKuioNMhSBMo0zJ3Md3wpEUa395Gz_18ms,1029
76
- tests/plugins/mongo/test_load_svs.py,sha256=zkDiowbG2p6uiUC5nzajDp_QDky5lyKAnyr_sir8Pic,2670
77
- tests/plugins/mongo/test_variant_operations.py,sha256=Th42H-rHuN8oa-e8Sug29-_8tJtezevjmD4rM3543kM,9687
78
- tests/utils/test_case.py,sha256=DTbdiTn5myeE1K91wXtJwiDeLfmYOU8uqooSAq_B56o,1317
79
- tests/utils/test_delete.py,sha256=Gzatf_WpqdtRhkELEt2WgVuKF-UwiPUuycS7cjtKcgg,1872
80
- tests/utils/test_delete_family.py,sha256=ym0ffeCf8IvNy9-AUL2ix1BWBapxZo4P4ZuLtQfQNtQ,845
81
- tests/utils/test_delete_variant.py,sha256=bRNFmV9OvQJ-Ao6eq2yKIhjz3-FOH75OCqclKTu9c8A,2171
82
- tests/utils/test_get_family.py,sha256=WLIqNHCfmHbZoL-TMLf6wFGxf_vBeEBE9ndWOE2iHTQ,329
83
- tests/utils/test_load_database.py,sha256=gZOLSTrRYsTq8q3in0gazmZJxZVreoFN1_o9EzXD_1s,1473
84
- tests/utils/test_load_family.py,sha256=DWDqC9UCMVMwVKoYToL_KGc0kpsn9DVFFZovD3zOCMc,2376
85
- tests/utils/test_load_variants.py,sha256=CAo8oDw9mz8oTszscIS38yl7jKUPVapJIH_Y4MUBZHs,6278
86
- tests/utils/test_migrate.py,sha256=DM4RC_sY6C3aCbE0-Rzg5Yi5pp0BgKNefP1OCaviPSw,1177
87
- tests/utils/test_profiling.py,sha256=tehPKrE0tNbaz26On8lp4MeDTMwTpw_iyQdW1cW5iMo,2658
88
- tests/vcf_tools/test_check_par.py,sha256=zmG3HKWy6omyofqK4WjzmcbkVEvkncUm26GeMtnxHiI,1155
89
- tests/vcf_tools/test_check_vcf.py,sha256=bTZQOSbhXthRDwTmcfvf4sW-DMUdlpM7bBSDsmXSDrU,1966
90
- tests/vcf_tools/test_format_sv_variant.py,sha256=eeQ6XI6X2lNpsVaWecu5lfdRHrDh1XZvcz9UhL7j3qo,4375
91
- tests/vcf_tools/test_format_variant.py,sha256=CfgCnrS5OvuIcUOCTUGCiDRUelk3fZgT7YQAytNPvvM,4176
92
- tests/vcf_tools/test_vcf.py,sha256=Fc9tO1IgKFo_DCfj_GrsXGx9t_69xkWhn1ZCL7IXqLU,1563
93
- loqusdb-2.7.10.dist-info/LICENSE,sha256=urpFcJXw3elN9kV2fFutc-lXegjuu2lqP_GSy8_CAbs,1054
94
- loqusdb-2.7.10.dist-info/METADATA,sha256=gk9R2uviWXIKE3TkB40x0vTW4KLZvbL9Z-D2XoSNFqg,5270
95
- loqusdb-2.7.10.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
96
- loqusdb-2.7.10.dist-info/entry_points.txt,sha256=wFoWzEFjsSgXkj9FMQA8C9ihZoJ9R1XvbGuX9hEEI6E,52
97
- loqusdb-2.7.10.dist-info/RECORD,,