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.
@@ -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 criterias are not fullfilled, eg. variant have no gt call or quality
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 = int(variant.QUAL)
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])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: loqusdb
3
- Version: 2.7.3
3
+ Version: 2.7.4
4
4
  Summary: Store observations of vcf variants in a mongodb
5
5
  Home-page: https://github.com/moonso/loqusdb
6
6
  Author: Måns Magnusson
@@ -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=JE3o_htRQjpwwUPxmP5HJ_0Ax8BwKp610uBIo3HTaVA,6671
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.3.dist-info/LICENSE,sha256=urpFcJXw3elN9kV2fFutc-lXegjuu2lqP_GSy8_CAbs,1054
50
- loqusdb-2.7.3.dist-info/METADATA,sha256=zgf3S9hSpX0PXSt6M2aZoiNN9fAuemQ1jB4WcWnrMv0,6007
51
- loqusdb-2.7.3.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
52
- loqusdb-2.7.3.dist-info/entry_points.txt,sha256=39QklW01vy9ilBLcRPgCP18kN6oKXXLoOK50gZE7Jbs,59
53
- loqusdb-2.7.3.dist-info/top_level.txt,sha256=lRdRO6hqPhJEjFhfNsbCgVWMztvkYsjiOGK9DAL0UAI,8
54
- loqusdb-2.7.3.dist-info/RECORD,,
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,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.41.2)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5