loqusdb 2.7.3__py3-none-any.whl → 2.7.4__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.
- loqusdb/build_models/variant.py +12 -4
- {loqusdb-2.7.3.dist-info → loqusdb-2.7.4.dist-info}/METADATA +1 -1
- {loqusdb-2.7.3.dist-info → loqusdb-2.7.4.dist-info}/RECORD +7 -7
- {loqusdb-2.7.3.dist-info → loqusdb-2.7.4.dist-info}/WHEEL +1 -1
- {loqusdb-2.7.3.dist-info → loqusdb-2.7.4.dist-info}/LICENSE +0 -0
- {loqusdb-2.7.3.dist-info → loqusdb-2.7.4.dist-info}/entry_points.txt +0 -0
- {loqusdb-2.7.3.dist-info → loqusdb-2.7.4.dist-info}/top_level.txt +0 -0
loqusdb/build_models/variant.py
CHANGED
@@ -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])
|
@@ -4,7 +4,7 @@ loqusdb/log.py,sha256=CDcrCjzs9ef-d5Wg8Q_41bCOZRM5j8PyP06kNcynTj0,1691
|
|
4
4
|
loqusdb/build_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
5
|
loqusdb/build_models/case.py,sha256=P3sfQkI_fH8u5iqecYWhV866lcHz4upWkepaea5MMIw,4255
|
6
6
|
loqusdb/build_models/profile_variant.py,sha256=TbSxfVjESstS_FgbkOW4NQwMQVeTyhn9oc9yPZmDhzI,1021
|
7
|
-
loqusdb/build_models/variant.py,sha256=
|
7
|
+
loqusdb/build_models/variant.py,sha256=LviEaovB_s_-jaLM64x0NzqzilFr__NPgv4Vf49Rhbk,6939
|
8
8
|
loqusdb/commands/__init__.py,sha256=BXAN3UADgqPrkGczzjlLO9GyyQ96dnLnP7n92JlYHgo,603
|
9
9
|
loqusdb/commands/annotate.py,sha256=748kImopE5WbaO1nuv3WUgIqezWFSsi7SBeWhOz26-s,1384
|
10
10
|
loqusdb/commands/cli.py,sha256=wJD5S1BoCxtRTAobd1QtmQpzlngJg-mt1nsyD92fDD4,3176
|
@@ -46,9 +46,9 @@ loqusdb/utils/profiling.py,sha256=3OizF7CpYvSl9kyl2g4KGJxbIRUqWfmfLxn3843XYDk,91
|
|
46
46
|
loqusdb/utils/update.py,sha256=1edJG-u24FgOSxyXAQEiyTG4IyK-Uo3lSIl5qyzcXsI,4433
|
47
47
|
loqusdb/utils/variant.py,sha256=Lq5x9egVB-3rExBiRceF67TaL4Hp2gGoWMSRBEcnm4Q,2088
|
48
48
|
loqusdb/utils/vcf.py,sha256=ybmrTBEPYa0FbUXo8ttlwATk13RnKjX9eIDbRDwCiVE,5175
|
49
|
-
loqusdb-2.7.
|
50
|
-
loqusdb-2.7.
|
51
|
-
loqusdb-2.7.
|
52
|
-
loqusdb-2.7.
|
53
|
-
loqusdb-2.7.
|
54
|
-
loqusdb-2.7.
|
49
|
+
loqusdb-2.7.4.dist-info/LICENSE,sha256=urpFcJXw3elN9kV2fFutc-lXegjuu2lqP_GSy8_CAbs,1054
|
50
|
+
loqusdb-2.7.4.dist-info/METADATA,sha256=XxP5xaw8eJa0wWxJn2DCLk9aSd3P2f69-K9s4mw4lSU,6007
|
51
|
+
loqusdb-2.7.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
52
|
+
loqusdb-2.7.4.dist-info/entry_points.txt,sha256=39QklW01vy9ilBLcRPgCP18kN6oKXXLoOK50gZE7Jbs,59
|
53
|
+
loqusdb-2.7.4.dist-info/top_level.txt,sha256=lRdRO6hqPhJEjFhfNsbCgVWMztvkYsjiOGK9DAL0UAI,8
|
54
|
+
loqusdb-2.7.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|