Commit 15e1fe38 authored by Theo Serralta's avatar Theo Serralta

New code to isolate high depth

parent 5b182bf3
align_file = "/home/theo/dev/git/cnvCallerGPU/test_depth.txt"
depth_sup_mean = "/home/theo/dev/git/cnvCallerGPU/depth_sup_mean.txt"
def calc_depth_mean(align_file):
with open(align_file, 'r') as file:
total_depth = 0
total_window = 0
for line in file:
depth_str_split = line.split()
depth_str_value = depth_str_split[6:]
total_depth += float(depth_str_value[0])
total_window += 1
mean = total_depth / total_window
return mean
with open(depth_sup_mean, 'w') as output:
with open(align_file, 'r') as file:
mean = calc_depth_mean(align_file)
for line in file:
depth_str_split = line.split()
depth_str_value = depth_str_split[6:]
if float(depth_str_value[0]) > mean:
output.write(f"{depth_str_split[5]}: {depth_str_value[0]}\n")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment