Skip to content

Commit

Permalink
fix: enforce ploidy in GATK gCNV ploidy calling wrapper (#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe authored Feb 22, 2023
1 parent 9717be7 commit f244691
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@
line = call_lines[i]
arr = line.split("\t")
chrom = arr[0].lower()
if "x" in chrom or "y" in chrom:
if chrom.startswith("@") or chrom == "contig":
pass # noop
elif "x" in chrom or "y" in chrom:
ploidy = int(arr[1])
if "x" in arr[0].lower():
if ploidy != ploidy_x[sample_sex]:
Expand All @@ -69,6 +71,11 @@
if ploidy != ploidy_y[sample_sex]:
arr[1] = str(ploidy_y[sample_sex])
arr[2] = f"42.000{ploidy}" # magic marker
else:
ploidy = int(arr[1])
if ploidy != 2:
arr[1] = "2"
arr[2] = f"42.000{ploidy}" # magic marker
call_lines[i] = "\t".join(arr)
with path_call.open("wt") as outputf:
for line in call_lines:
Expand Down

0 comments on commit f244691

Please sign in to comment.