phc-ingestion 1.0.1__py3-none-any.whl → 1.0.2__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.
@@ -4,8 +4,6 @@ import re
4
4
  import os
5
5
  from typing import Iterator, Optional
6
6
 
7
- import pysam
8
-
9
7
 
10
8
  def check_vcf(infile: str, log: Logger) -> None:
11
9
  log.info("Checking VCF file")
@@ -74,35 +72,11 @@ def write_vcf(
74
72
  ) -> int:
75
73
  log.info(f"Writing standardized VCF to {outfile}")
76
74
 
77
- if compression:
78
- # Write uncompressed first, then compress with bgzip (indexable format)
79
- # pysam.tabix_compress requires an uncompressed input file
80
- # Create a temporary uncompressed file
81
- if outfile.endswith(".gz"):
82
- temp_uncompressed = outfile[:-3] # Remove .gz extension
83
- else:
84
- temp_uncompressed = outfile + ".tmp"
85
-
86
- with open(temp_uncompressed, "w") as w:
87
- w.write("\n".join(headers) + "\n")
88
- for variant in variants_gen:
89
- line_count += 1
90
- if variant:
91
- w.write(variant + "\n")
92
-
93
- # Compress with bgzip (indexable format) using pysam
94
- log.info(f"Compressing VCF with bgzip to {outfile}")
95
- pysam.tabix_compress(temp_uncompressed, outfile, force=True)
96
-
97
- # Clean up temporary uncompressed file
98
- if os.path.exists(temp_uncompressed):
99
- os.remove(temp_uncompressed)
100
- else:
101
- with open(outfile, "w") as w:
102
- w.write("\n".join(headers) + "\n")
103
- for variant in variants_gen:
104
- line_count += 1
105
- if variant:
106
- w.write(variant + "\n")
75
+ with gzip.open(outfile, "wt") if compression else open(outfile, "w") as w:
76
+ w.write("\n".join(headers) + "\n")
77
+ for variant in variants_gen:
78
+ line_count += 1
79
+ if variant:
80
+ w.write(variant + "\n")
107
81
 
108
82
  return line_count
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: phc-ingestion
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: Functions for LifeOmic PHC genomic ingestions
5
5
  License: MIT
6
6
  Author-email: LifeOmic Development <development@lifeomic.com>
@@ -13,7 +13,6 @@ Requires-Dist: natsort==7.1.1
13
13
  Requires-Dist: numpy>=2.1.2
14
14
  Requires-Dist: packaging>=23.1
15
15
  Requires-Dist: pandas>=2.2.3
16
- Requires-Dist: pysam>=0.21.0
17
16
  Requires-Dist: ruamel.yaml==0.17.21
18
17
  Requires-Dist: schema>=0.7.5
19
18
  Requires-Dist: urllib3>=1.26.16
@@ -59,7 +59,7 @@ ingestion/vcf_standardization/standardize.py,sha256=zYzZxncq8USA1bUs26L-ByLPTnUl
59
59
  ingestion/vcf_standardization/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
60
60
  ingestion/vcf_standardization/util/af_helpers.py,sha256=dpTzoeIQVeBRt0ETF3a9rp5ojZqznHg4x_hCZ8OPcOg,1061
61
61
  ingestion/vcf_standardization/util/dp_helpers.py,sha256=Nq8oLOLObu4_pv16qwwgpALRlUoJVCULrd9cFOD-eoI,823
62
- ingestion/vcf_standardization/util/read_write.py,sha256=xogLdqtm1xGzigY459LqP_1zM6c5X9AjAFGkfaDI-bg,3479
63
- phc_ingestion-1.0.1.dist-info/WHEEL,sha256=B19PGBCYhWaz2p_UjAoRVh767nYQfk14Sn4TpIZ-nfU,87
64
- phc_ingestion-1.0.1.dist-info/METADATA,sha256=jvycAlRde4lUsP8O87F9a5bSF3fFINgtkMrr5FKsqWE,705
65
- phc_ingestion-1.0.1.dist-info/RECORD,,
62
+ ingestion/vcf_standardization/util/read_write.py,sha256=x3Pf6Dq8tmolblbCS5CrNmrcHS3FGfqBSFpFgvFGC4g,2526
63
+ phc_ingestion-1.0.2.dist-info/WHEEL,sha256=B19PGBCYhWaz2p_UjAoRVh767nYQfk14Sn4TpIZ-nfU,87
64
+ phc_ingestion-1.0.2.dist-info/METADATA,sha256=PrNukFYVStjbSRrBD7OjQTv0ZVOIZMwbQ2LDgWP6lNM,676
65
+ phc_ingestion-1.0.2.dist-info/RECORD,,