Skip to content
Snippets Groups Projects
Commit 35108d71 authored by Thomas Faraut's avatar Thomas Faraut
Browse files

simplified sort

parent 3ef5dbea
No related branches found
No related tags found
No related merge requests found
......@@ -129,7 +129,7 @@ def read_vcf_file(infile):
ids.append(record.id)
return SVSet, ids
def svsort(sv, records):
"""
Function to sort regions
......@@ -139,8 +139,8 @@ def svsort(sv, records):
else:
first_tool = list(records[sv]["tools"].keys())[0]
start = str(records[sv]["tools"][first_tool]["start"])
return int(records[sv]["chromosome"] + ("0" * (15 - len(start))) + start)
return start
def get_gt(geno, true_gt):
"""
......@@ -679,7 +679,7 @@ def main():
filtered_records is not None,
nb_records, max_col_len, nb_inds)
rec_keys = sorted(records.keys(), key=lambda x:svsort(x, records))
rec_keys = sorted(records.keys(), key=lambda x:(records[x]["chromosome"], svsort(x, records)))
####################
# BUILD BODY CELLS #
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment