Skip to content

Commit

Permalink
Add VCF detectedChip meta-information
Browse files Browse the repository at this point in the history
  • Loading branch information
apriha committed Aug 26, 2024
1 parent 276060e commit eaf5824
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/snps/io/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,16 @@ def _write_vcf(self):
if self._snps.determine_sex():
comment.append(f"##detectedSex={self._snps.determine_sex()}")

if self._vcf_qc_only or self._vcf_qc_filter:
chip_version = ""
if self._snps.chip_version:
chip_version = f" {self._snps.chip_version}"

if self._snps.chip:
comment.append(
f'##detectedChip="{self._snps.chip}{chip_version} per Lu et al.: https://doi.org/10.1016/j.csbj.2021.06.040"'
)

df = self._snps.snps

p = self._snps._parallelizer
Expand Down
3 changes: 3 additions & 0 deletions src/snps/snps.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def __init__(
self._cluster = ""
self._chip = ""
self._chip_version = ""
self._cluster_overlap_computed = False

if file:
d = self._read_raw_data(file, only_detect_source, rsids)
Expand Down Expand Up @@ -2021,6 +2022,8 @@ def compute_cluster_overlap(self, cluster_overlap_threshold=0.95):
"Detected SNPs data source not found in cluster's company composition"
)

self._cluster_overlap_computed = True

return df

def identify_low_quality_snps(self):
Expand Down

0 comments on commit eaf5824

Please sign in to comment.