Skip to content

Commit

Permalink
ref AF is now calculated using ref_DP
Browse files Browse the repository at this point in the history
  • Loading branch information
Shettland committed Jul 2, 2024
1 parent 62aedf0 commit 8fee2d2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bin/ivar_variants_to_vcf.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,17 +430,17 @@ def get_ref_rowset(self, row_set):
for each variant position.
"""
ref_row_set = row_set.copy()
#ref_row_set["REF_DP"] = ref_row_set["FILENAME"].str.split(":").str[2]
ref_row_set["ALT"] = ref_row_set["REF"]
#np.where(ref_row_set["REF_DP"] == "0", row_set["ALT"], row_set["REF"]
ref_row_set["ALT_CODON"] = ref_row_set["REF_CODON"]
filecol = ref_row_set["FILENAME"].values.tolist()
ref_filecol = []
for row in filecol:
# values = GT:DP:REF_DP:REF_RV:REF_QUAL:ALT_DP:ALT_RV:ALT_QUAL:ALT_FREQ
split_vals = row.split(":")
#if split_vals[2] != 0:
split_vals[8] = str(round(1 - float(split_vals[8]), 3))
split_vals[5] = split_vals[2]
ref_dp = split_vals[2]
total_dp = split_vals[1]
split_vals[8] = str(round(int(ref_dp)/int(total_dp), 3))
split_vals[5] = ref_dp
ref_filecol.append(":".join(split_vals))
ref_row_set["FILENAME"] = ref_filecol
merged_ref_rows = (
Expand Down

0 comments on commit 8fee2d2

Please sign in to comment.