Skip to content

Commit

Permalink
fixed order of columns in splitvariants.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kirtanav98 committed Feb 23, 2024
1 parent 0cad166 commit 1bad1ae
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/sv-pipeline/04_variant_resolution/scripts/split_variants.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ def process_bed_file(input_bed, n_per_split, bca=True):
with open(input_bed, 'r') as infile:
for line in infile:
# process bed file line by line
line = line.strip().split('\t')
line = line.strip('\n').split('\t')

# Checks which condition and prefix the current line matches and appends it to the corresponding
# array and increments the counter for that array
for prefix, conditions in condition_prefixes.items():
if conditions['condition'](line):
line[4],line[5]=line[5],line[4]
current_lines[prefix].append('\t'.join(line))
current_counts[prefix] += 1

Expand Down Expand Up @@ -61,19 +62,6 @@ def process_bed_file(input_bed, n_per_split, bca=True):
logging.info(f"File '{output_file}' written.")


# Function to generate the pattern for suffixes
def increment_suffix(suffix):
# define the alphabet and ending
alphabet = 'abcdefghijklmnopqrstuvwxyz'
if suffix == 'z' * 6:
raise ValueError('All possible files generated.')
else:
# if there are available suffixes increment to next available suffix
index = alphabet.index(suffix[0])
next_char = alphabet[(index + 1) % 26]
return next_char + suffix[1:]


def main():
parser = argparse.ArgumentParser()
parser.add_argument("--bed", help="Path to input bed file", required=True)
Expand Down

0 comments on commit 1bad1ae

Please sign in to comment.