From 0eba472f7f49841eac8411a9dc461a63d23e1e53 Mon Sep 17 00:00:00 2001 From: Asmaa Samy <71710659+asmmahmoud@users.noreply.github.com> Date: Tue, 14 Jan 2025 11:21:13 -0330 Subject: [PATCH] Add files via upload Fix header length --- nanoinsight/create_consensus.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/nanoinsight/create_consensus.py b/nanoinsight/create_consensus.py index 725759f..b560a52 100644 --- a/nanoinsight/create_consensus.py +++ b/nanoinsight/create_consensus.py @@ -89,18 +89,19 @@ def rename_header(con_dir, id_seq): # Remove the '.con' extension from the name name = name.replace('.con', '') # Add coordinates of SV to the header line - matching_row = id_seq[id_seq['ID'] == name] - SV_info = matching_row['sv_coo'].values[0] + # matching_row = id_seq[id_seq['ID'] == name] + # SV_info = matching_row['sv_coo'].values[0] # Open file and read lines with open(os.path.join(con_dir, con_file), "r") as f: lines = f.readlines() - # Replace first line with SV ID and coordinates info if or only SV ID if header length > 50 - header_info = f"{name}{SV_info}" - if len(header_info) > 50: new_header = f">{name}\n" - else: - new_header = f">{header_info}\n" - lines[0] = new_header + # Replace first line with SV ID and coordinates info if or only SV ID if header length > 50 + #header_info = f"{name}{SV_info}" + # if len(header_info) > 47: + # new_header = f">{name}\n" + # else: + # new_header = f">{header_info}\n" + lines[0] = new_header # Open file for writing and write updated lines with open(os.path.join(con_dir, con_file), "w") as f: f.writelines(lines)