loqusdb 2.6.10__py3-none-any.whl → 2.7.1__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.
@@ -139,7 +139,7 @@ def get_coords(variant):
139
139
  return coordinates
140
140
 
141
141
 
142
- def build_variant(variant, case_obj, case_id=None, gq_threshold=None, genome_build=None):
142
+ def build_variant(variant, case_obj, case_id=None, gq_threshold=None, gq_qual=False, genome_build=None):
143
143
  """Return a Variant object
144
144
 
145
145
  Take a cyvcf2 formated variant line and return a models.Variant.
@@ -188,7 +188,13 @@ def build_variant(variant, case_obj, case_id=None, gq_threshold=None, genome_bui
188
188
  ind_id = ind_obj["ind_id"]
189
189
  # Get the index position for the individual in the VCF
190
190
  ind_pos = ind_obj["ind_index"]
191
- gq = int(variant.gt_quals[ind_pos])
191
+
192
+ if gq_qual:
193
+ gq = int(variant.QUAL)
194
+
195
+ if not gq_qual:
196
+ gq = int(variant.gt_quals[ind_pos])
197
+
192
198
  if gq_threshold and gq < gq_threshold:
193
199
  continue
194
200
 
loqusdb/commands/load.py CHANGED
@@ -55,6 +55,7 @@ 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
59
  @click.option(
59
60
  "--max-window",
60
61
  "-m",
@@ -96,6 +97,7 @@ def load(
96
97
  check_profile,
97
98
  hard_threshold,
98
99
  soft_threshold,
100
+ qual_gq
99
101
  ):
100
102
  """Load the variants of a case
101
103
 
@@ -137,6 +139,7 @@ def load(
137
139
  skip_case_id=skip_case_id,
138
140
  case_id=case_id,
139
141
  gq_threshold=gq_threshold,
142
+ qual_gq=qual_gq,
140
143
  max_window=max_window,
141
144
  profile_file=variant_profile_path,
142
145
  hard_threshold=hard_threshold,
loqusdb/utils/load.py CHANGED
@@ -32,6 +32,7 @@ def load_database(
32
32
  family_type="ped",
33
33
  skip_case_id=False,
34
34
  gq_threshold=None,
35
+ qual_gq=False,
35
36
  case_id=None,
36
37
  max_window=3000,
37
38
  profile_file=None,
@@ -49,6 +50,7 @@ def load_database(
49
50
  family_type(str): Format of family file
50
51
  skip_case_id(bool): If no case information should be added to variants
51
52
  gq_threshold(int): If only quality variants should be considered
53
+ qual_gq(bool): Use QUAL field instead of GQ format tag to gate quality
52
54
  case_id(str): If different case id than the one in family file should be used
53
55
  max_window(int): Specify the max size for sv windows
54
56
  check_profile(bool): Does profile check if True
@@ -92,7 +94,7 @@ def load_database(
92
94
  # Get a cyvcf2.VCF object
93
95
  vcf = get_vcf(_vcf_file)
94
96
 
95
- if gq_threshold and not vcf.contains("GQ"):
97
+ if gq_threshold and not vcf.contains("GQ") and not qual_gq:
96
98
  LOG.warning("Set gq-threshold to 0 or add info to vcf {0}".format(_vcf_file))
97
99
  raise SyntaxError("GQ is not defined in vcf header")
98
100
 
@@ -144,6 +146,7 @@ def load_database(
144
146
  case_obj=case_obj,
145
147
  skip_case_id=skip_case_id,
146
148
  gq_threshold=gq_threshold,
149
+ qual_gq=qual_gq,
147
150
  max_window=max_window,
148
151
  variant_type=variant_type,
149
152
  genome_build=genome_build,
@@ -190,6 +193,7 @@ def load_variants(
190
193
  case_obj,
191
194
  skip_case_id=False,
192
195
  gq_threshold=None,
196
+ qual_gq=False,
193
197
  max_window=3000,
194
198
  variant_type="snv",
195
199
  genome_build=None,
@@ -222,7 +226,7 @@ def load_variants(
222
226
  with click.progressbar(vcf_obj, label="Inserting variants", length=nr_variants) as bar:
223
227
 
224
228
  variants = (
225
- build_variant(variant, case_obj, case_id, gq_threshold, genome_build=genome_build)
229
+ build_variant(variant, case_obj, case_id, gq_threshold, qual_gq, genome_build=genome_build)
226
230
  for variant in bar
227
231
  )
228
232
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: loqusdb
3
- Version: 2.6.10
3
+ Version: 2.7.1
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
@@ -29,8 +29,8 @@ Requires-Dist: numpy (==1.21.4)
29
29
  Requires-Dist: coloredlogs (==14.0)
30
30
  Requires-Dist: pyyaml (==5.4.0)
31
31
  Requires-Dist: vcftoolbox (==1.5)
32
- Requires-Dist: pip (==21.3.1)
33
- Requires-Dist: setuptools (==59.2.0)
32
+ Requires-Dist: pip (==23.1.2)
33
+ Requires-Dist: setuptools (==65.5.1)
34
34
  Requires-Dist: mongo-adapter (>=0.3.3)
35
35
  Requires-Dist: ped-parser
36
36
 
@@ -4,14 +4,14 @@ 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=9OhR1mbolMPHyChyDWLFfS3eaiz_N6BfJOWBUWi7JKQ,6558
7
+ loqusdb/build_models/variant.py,sha256=JE3o_htRQjpwwUPxmP5HJ_0Ax8BwKp610uBIo3HTaVA,6671
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
11
11
  loqusdb/commands/delete.py,sha256=R6ysHKSMw1mmL4ZbktoUIKzdzDLQ3314YPYhIy1myic,1979
12
12
  loqusdb/commands/export.py,sha256=0V3S3QU9LKlR13w3KCGfqFliTYiDRCgNwusA27AEvmE,3254
13
13
  loqusdb/commands/identity.py,sha256=hzbnvniKgSNEwSeYHsxdNvVlqu_vXeOSLlNFnDXTQjA,779
14
- loqusdb/commands/load.py,sha256=4ypfiar2Si76R3r5P_ncO7vig4GoQyEnfRm3l79WvGU,4231
14
+ loqusdb/commands/load.py,sha256=cVDdY7meBfcv8nMEGsjAX6aE-SKDOceGqM2vAvXPhko,4407
15
15
  loqusdb/commands/load_profile.py,sha256=cflCbF9f77_HCH8xPnN8zSSocvIffRMnC2LPE0j7Xq8,3336
16
16
  loqusdb/commands/migrate.py,sha256=2C8YL-zVqnpnqg3JIyUr0rbVnb8-AGPVWNhicHnPKLo,667
17
17
  loqusdb/commands/restore.py,sha256=eqPX0yao0IAYS5SbjCdlsfSJRBbRByBLISUU2hTzqqs,1492
@@ -40,15 +40,15 @@ loqusdb/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
40
  loqusdb/utils/annotate.py,sha256=cPNWlhsv6yoe3lxNfa9DytO5eACuM_mOJJw_mglVMN0,2646
41
41
  loqusdb/utils/case.py,sha256=aeTvyACJTDjzl-aOjAZaUzFMLisgFKMfcoXSvNAZz4s,2168
42
42
  loqusdb/utils/delete.py,sha256=-ddBM_QXKzlUN6egEJggKzXX1P-WEdi92HgaD1DJRtg,4843
43
- loqusdb/utils/load.py,sha256=Xj1QpgMO_UCs0gEZC_dZz_p0kJPbQyZi9vlTNIOX-mc,8075
43
+ loqusdb/utils/load.py,sha256=rujUk89lL5jO35QfO8NKGJkjEJmN6PQxohKkxtpnw6Y,8252
44
44
  loqusdb/utils/migrate.py,sha256=9Q6kdIi9TpFVzDYptlEE8RqPPS5wyzfM3F8egzmmBBk,1113
45
45
  loqusdb/utils/profiling.py,sha256=3OizF7CpYvSl9kyl2g4KGJxbIRUqWfmfLxn3843XYDk,9164
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.6.10.dist-info/LICENSE,sha256=urpFcJXw3elN9kV2fFutc-lXegjuu2lqP_GSy8_CAbs,1054
50
- loqusdb-2.6.10.dist-info/METADATA,sha256=ntsTkcLmU07bQFrYSk958_59He_pwSTxiRAwwsKnkEg,6057
51
- loqusdb-2.6.10.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
52
- loqusdb-2.6.10.dist-info/entry_points.txt,sha256=39QklW01vy9ilBLcRPgCP18kN6oKXXLoOK50gZE7Jbs,59
53
- loqusdb-2.6.10.dist-info/top_level.txt,sha256=lRdRO6hqPhJEjFhfNsbCgVWMztvkYsjiOGK9DAL0UAI,8
54
- loqusdb-2.6.10.dist-info/RECORD,,
49
+ loqusdb-2.7.1.dist-info/LICENSE,sha256=urpFcJXw3elN9kV2fFutc-lXegjuu2lqP_GSy8_CAbs,1054
50
+ loqusdb-2.7.1.dist-info/METADATA,sha256=tygTDUyQg54n3CJZ7gpSDJ6ryWQCKJJEEAZfT09ebq0,6056
51
+ loqusdb-2.7.1.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
52
+ loqusdb-2.7.1.dist-info/entry_points.txt,sha256=39QklW01vy9ilBLcRPgCP18kN6oKXXLoOK50gZE7Jbs,59
53
+ loqusdb-2.7.1.dist-info/top_level.txt,sha256=lRdRO6hqPhJEjFhfNsbCgVWMztvkYsjiOGK9DAL0UAI,8
54
+ loqusdb-2.7.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.38.4)
2
+ Generator: bdist_wheel (0.40.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5