Skip to content

Commit

Permalink
reformatted python script to match github lint8 formatting specificat…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
kirtanav98 committed Nov 20, 2023
1 parent d7ee19e commit 2b0f5da
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/sv-pipeline/scripts/SplitVariants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
}
Expand Down Expand Up @@ -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:
Expand All @@ -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(
Expand All @@ -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()
main()

0 comments on commit 2b0f5da

Please sign in to comment.