loqusdb 2.7.3__tar.gz → 2.7.6__tar.gz
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.
- {loqusdb-2.7.3 → loqusdb-2.7.6}/CHANGELOG.md +4 -1
- {loqusdb-2.7.3 → loqusdb-2.7.6}/PKG-INFO +1 -1
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/__init__.py +4 -1
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/build_models/variant.py +12 -4
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb.egg-info/PKG-INFO +1 -1
- {loqusdb-2.7.3 → loqusdb-2.7.6}/setup.py +1 -1
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/vcf_tools/test_format_variant.py +14 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/CONTRIBUTING.md +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/LICENSE +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/MANIFEST.in +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/README.md +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/__main__.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/build_models/__init__.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/build_models/case.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/build_models/profile_variant.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/commands/__init__.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/commands/annotate.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/commands/cli.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/commands/delete.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/commands/export.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/commands/identity.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/commands/load.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/commands/load_profile.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/commands/migrate.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/commands/restore.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/commands/update.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/commands/view.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/commands/wipe.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/constants/__init__.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/exceptions/__init__.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/exceptions/case.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/exceptions/profile.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/exceptions/vcf.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/log.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/models/__init__.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/models/case.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/models/identity.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/models/profile_variant.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/models/variant.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/plugins/__init__.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/plugins/mongo/__init__.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/plugins/mongo/adapter.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/plugins/mongo/case.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/plugins/mongo/profile_variant.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/plugins/mongo/structural_variant.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/plugins/mongo/variant.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/resources/__init__.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/utils/__init__.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/utils/annotate.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/utils/case.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/utils/delete.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/utils/load.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/utils/migrate.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/utils/profiling.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/utils/update.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/utils/variant.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb/utils/vcf.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb.egg-info/SOURCES.txt +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb.egg-info/dependency_links.txt +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb.egg-info/entry_points.txt +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb.egg-info/requires.txt +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/loqusdb.egg-info/top_level.txt +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/setup.cfg +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/build_models/test_build_case.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/build_models/test_build_variant.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/build_models/test_is_greater.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/commands/test_export.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/commands/test_identity.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/commands/test_view.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/conftest.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/fixtures/643594.clinical.SV.vcf +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/fixtures/643594.clinical.vcf.gz +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/fixtures/double_variant.vcf +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/fixtures/funny_trio.ped +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/fixtures/profile_snv.vcf +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/fixtures/recessive_trio.ped +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/fixtures/test.SV.vcf +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/fixtures/test.vcf +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/fixtures/test.vcf.gz +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/fixtures/test.vcf.gz.tbi +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/fixtures/unsorted.vcf +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/functional/test_cli.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/plugins/mongo/test_case_operations.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/plugins/mongo/test_connect.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/plugins/mongo/test_flask_extension.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/plugins/mongo/test_get_sv.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/plugins/mongo/test_load_svs.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/plugins/mongo/test_variant_operations.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/utils/test_case.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/utils/test_delete.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/utils/test_delete_family.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/utils/test_delete_variant.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/utils/test_get_family.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/utils/test_load_database.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/utils/test_load_family.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/utils/test_load_variants.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/utils/test_migrate.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/utils/test_profiling.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/vcf_tools/test_check_par.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/vcf_tools/test_check_vcf.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/vcf_tools/test_format_sv_variant.py +0 -0
- {loqusdb-2.7.3 → loqusdb-2.7.6}/tests/vcf_tools/test_vcf.py +0 -0
@@ -3,8 +3,11 @@ All notable changes to this project will be documented in this file.
|
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
|
5
5
|
About changelog [here](https://keepachangelog.com/en/1.0.0/)
|
6
|
+
## [2.7.4]
|
7
|
+
## Changed
|
8
|
+
- When using QUAL values, treat . as 0 quality
|
6
9
|
|
7
|
-
## [2.
|
10
|
+
## [2.7.3]
|
8
11
|
### Added
|
9
12
|
- Basic cli tests touching fixed deprecated code
|
10
13
|
### Changed
|
@@ -28,12 +28,14 @@ INDEXES = {
|
|
28
28
|
"structural_variant": [
|
29
29
|
IndexModel(
|
30
30
|
[
|
31
|
+
("sv_type", ASCENDING),
|
31
32
|
("chrom", ASCENDING),
|
32
33
|
("end_chrom", ASCENDING),
|
33
|
-
("sv_type", ASCENDING),
|
34
34
|
("pos_left", ASCENDING),
|
35
|
+
("pos_right", ASCENDING),
|
35
36
|
],
|
36
37
|
name="coordinates",
|
38
|
+
background=True,
|
37
39
|
),
|
38
40
|
IndexModel(
|
39
41
|
[
|
@@ -42,6 +44,7 @@ INDEXES = {
|
|
42
44
|
("end_right", ASCENDING),
|
43
45
|
],
|
44
46
|
name="short_coordinates",
|
47
|
+
background=True,
|
45
48
|
),
|
46
49
|
],
|
47
50
|
"identity": [
|
@@ -1,8 +1,12 @@
|
|
1
1
|
import logging
|
2
2
|
from collections import namedtuple
|
3
3
|
|
4
|
+
import cyvcf2
|
5
|
+
|
6
|
+
from typing import Optional
|
7
|
+
|
4
8
|
from loqusdb.constants import CHROM_TO_INT, GENOTYPE_MAP, GRCH37, PAR
|
5
|
-
from loqusdb.models import Variant
|
9
|
+
from loqusdb.models import Case, Variant
|
6
10
|
|
7
11
|
LOG = logging.getLogger(__name__)
|
8
12
|
|
@@ -139,19 +143,21 @@ def get_coords(variant):
|
|
139
143
|
return coordinates
|
140
144
|
|
141
145
|
|
142
|
-
def build_variant(variant, case_obj, case_id=None, gq_threshold=None, gq_qual=False, genome_build=None):
|
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:
|
143
147
|
"""Return a Variant object
|
144
148
|
|
145
149
|
Take a cyvcf2 formated variant line and return a models.Variant.
|
146
150
|
|
147
|
-
If
|
151
|
+
If criteria are not fulfilled, eg variant has no GT call or quality.
|
148
152
|
is below gq threshold then return None.
|
149
153
|
|
154
|
+
|
150
155
|
Args:
|
151
156
|
variant(cyvcf2.Variant)
|
152
157
|
case_obj(Case): We need the case object to check individuals sex
|
153
158
|
case_id(str): The case id
|
154
159
|
gq_threshold(int): Genotype Quality threshold
|
160
|
+
gq_qual(bool): Use variant.QUAL for quality instead of GQ
|
155
161
|
|
156
162
|
Return:
|
157
163
|
formated_variant(models.Variant): A variant dictionary
|
@@ -190,7 +196,9 @@ def build_variant(variant, case_obj, case_id=None, gq_threshold=None, gq_qual=Fa
|
|
190
196
|
ind_pos = ind_obj["ind_index"]
|
191
197
|
|
192
198
|
if gq_qual:
|
193
|
-
gq =
|
199
|
+
gq = 0
|
200
|
+
if variant.QUAL:
|
201
|
+
gq = int(variant.QUAL)
|
194
202
|
|
195
203
|
if not gq_qual:
|
196
204
|
gq = int(variant.gt_quals[ind_pos])
|
@@ -19,7 +19,7 @@ URL = "https://github.com/moonso/loqusdb"
|
|
19
19
|
EMAIL = "mans.magnusson@scilifelab.com"
|
20
20
|
AUTHOR = "Måns Magnusson"
|
21
21
|
REQUIRES_PYTHON = ">=3.7.0"
|
22
|
-
VERSION = "2.7.
|
22
|
+
VERSION = "2.7.6"
|
23
23
|
|
24
24
|
with open('requirements.txt') as f:
|
25
25
|
install_requires = f.read().strip().split('\n')
|
@@ -21,6 +21,20 @@ def test_format_variant(het_variant, case_obj):
|
|
21
21
|
assert formated_variant["homozygote"] == 0
|
22
22
|
|
23
23
|
|
24
|
+
def test_format_variant_no_qual(variant_no_gq, case_obj):
|
25
|
+
## GIVEN a variant without GQ
|
26
|
+
variant = variant_no_gq
|
27
|
+
## And that has a missing QUAL value
|
28
|
+
variant.QUAL = None
|
29
|
+
case_id = case_obj["case_id"]
|
30
|
+
## WHEN parsing the variant using a QUAL threshold
|
31
|
+
formated_variant = build_variant(
|
32
|
+
variant=variant, case_obj=case_obj, case_id=case_id, gq_qual=True, gq_threshold=20
|
33
|
+
)
|
34
|
+
## THEN assert that None is returned since requirements are not fulfilled
|
35
|
+
assert formated_variant is None
|
36
|
+
|
37
|
+
|
24
38
|
def test_format_variant_no_gq(variant_no_gq, case_obj):
|
25
39
|
## GIVEN a variant without GQ
|
26
40
|
variant = variant_no_gq
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|