diff --git a/src/sv-pipeline/scripts/SplitVariants.py b/src/sv-pipeline/scripts/SplitVariants.py index b1ee784c9..7565886b5 100644 --- a/src/sv-pipeline/scripts/SplitVariants.py +++ b/src/sv-pipeline/scripts/SplitVariants.py @@ -4,10 +4,14 @@ import csv import os import argparse + + def process_bed_file(input_bed, N, bca=True): condition_prefixes = { - 'gt5kb': {'condition': lambda line: (line[4] == 'DEL' or line[4] == 'DUP') and (int(line[2]) - int(line[1]) >= 5000)}, - 'lt5kb': {'condition': lambda line: (line[4] == 'DEL' or line[4] == 'DUP') and (int(line[2]) - int(line[1]) < 5000)}, + 'gt5kb': { + 'condition': lambda line: (line[4] == 'DEL' or line[4] == 'DUP') and (int(line[2]) - int(line[1]) >= 5000)}, + 'lt5kb': { + 'condition': lambda line: (line[4] == 'DEL' or line[4] == 'DUP') and (int(line[2]) - int(line[1]) < 5000)}, 'bca': {'condition': lambda line: bca and (line[4] != 'DEL' and line[4] != 'DUP' and line[4] != 'INS')}, 'ins': {'condition': lambda line: bca and line[4] == 'INS'} } @@ -46,6 +50,7 @@ def process_bed_file(input_bed, N, bca=True): print(f"File {output_file} written.") + def increment_suffix(suffix): alphabet = 'abcdefghijklmnopqrstuvwxyz' if suffix == 'z' * 6: @@ -55,6 +60,7 @@ def increment_suffix(suffix): next_char = alphabet[(index + 1) % 26] return next_char + suffix[1:] + def main(): parser = argparse.ArgumentParser() parser.add_argument( @@ -64,6 +70,7 @@ def main(): args = parser.parse_args() process_bed_file(args.bed, args.n, args.bca) + # Press the green button in the gutter to run the script. if __name__ == '__main__': - main() \ No newline at end of file + main()