Skip to content

Commit

Permalink
added option to calculate error rates on duplication groups separately
Browse files Browse the repository at this point in the history
  • Loading branch information
leonschuetz committed Jan 23, 2025
1 parent 78931d3 commit 8e645db
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions calculateMRD.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def parse_args():
parser.add_argument("--blacklist", type=str, help="VCF of variants which should be excluded for the background error rate", default="")
parser.add_argument("--remove_off_target", action="store_true", help="Remove tumor off-target variants")
parser.add_argument("--keep_indels", action="store_true", help="Do not remove InDels.")
parser.add_argument("--keep_duplication_groups_separate", action="store_true", help="Calculate errors/MRD on the different duplication set separately.")

args = parser.parse_args()
return args
Expand Down Expand Up @@ -161,10 +162,11 @@ def main():
combined_tables[dup_level] = dedup_tables[dup_level][["A", "C", "G", "T", "DEL", "INS", "DP", "DP_HQ"]]
included_levels = [dup_level]
print(dup_level)
for idx in range(dup_levels.index(dup_level) + 1, len(dup_levels)):
combined_tables[dup_level] = combined_tables[dup_level].add(dedup_tables[dup_levels[idx]][["A", "C", "G", "T", "DEL", "INS", "DP", "DP_HQ"]], fill_value=0)
included_levels.append(dup_levels[idx])
print(" - " + dup_levels[idx])
if not args.keep_duplication_groups_separate:
for idx in range(dup_levels.index(dup_level) + 1, len(dup_levels)):
combined_tables[dup_level] = combined_tables[dup_level].add(dedup_tables[dup_levels[idx]][["A", "C", "G", "T", "DEL", "INS", "DP", "DP_HQ"]], fill_value=0)
included_levels.append(dup_levels[idx])
print(" - " + dup_levels[idx])

# get combined ref column
ref_column = pd.concat([dedup_tables[dedup]["REF"] for dedup in included_levels])
Expand Down

0 comments on commit 8e645db

Please sign in to comment.