Skip to content

Commit 280ce78

Browse files
committed
script for post-processing/scoring introgressions
1 parent 12bd85b commit 280ce78

File tree

2 files changed

+479
-2
lines changed

2 files changed

+479
-2
lines changed

panagram/introgressions_group_based.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import pandas as pd
33
from panagram.index import Index
44
import plotly.express as px
5+
import subprocess
56

67

78
def visualize(pair, output_file, inverse=False):
@@ -157,7 +158,7 @@ def run_introgression_finder(
157158
output_bed = output_dir / f"{anchor}_{chr_name}_{comp_group}.bed"
158159
threshold_to_bed(group_sims, bin_size, chr_name, comp_group, output_bed)
159160

160-
# repeat analysis one more with merged introgressions from all comp_groups
161+
# repeat analysis one more time with merged introgressions from all comp_groups
161162
# pair.loc["Intro. Score"] = (~(merged_sims["introgression"].astype(bool))).astype(int)
162163

163164
# divide by the max to get between 0 and 1, do 1 - x to invert
@@ -170,11 +171,12 @@ def run_introgression_finder(
170171

171172
# save introgressions to bed file
172173
output_bed = output_dir / f"{anchor}_{chr_name}_merged.bed"
173-
threshold_to_bed(merged_sims, bin_size, chr_name, comp_group, output_bed)
174+
threshold_to_bed(merged_sims, bin_size, chr_name, "merged", output_bed)
174175
return
175176

176177

177178
def main():
179+
# TODO: allow for a 2-bin gap
178180
# USER PARAMS
179181
bitmap_step = 100
180182
bin_size = 1000000

0 commit comments

Comments
 (0)