From 01fc9627c1e11ad27bebead662a7d6f9c67ce861 Mon Sep 17 00:00:00 2001
From: ddepanis <ddepanis@mi.fu-berlin.de>
Date: Thu, 9 May 2024 11:30:38 +0000
Subject: [PATCH] Update makePDF_indivMD.py

---
 scripts/report/makePDF_indivMD.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/scripts/report/makePDF_indivMD.py b/scripts/report/makePDF_indivMD.py
index 52a2cf2..0017052 100644
--- a/scripts/report/makePDF_indivMD.py
+++ b/scripts/report/makePDF_indivMD.py
@@ -139,6 +139,9 @@ if params_asm2provided:
 		lines = scoresOnlyFile.readlines()
 		lines = [line.rstrip() for line in lines]
 
+		percentage_data = re.split(r'[,\[\]]', lines[0])
+		percentage_values = {item.split(':')[0]: item.split(':')[1].split('[')[0] for item in percentage_data if len(item) > 0}
+
 		percentages = []
 		numbers = []
 		# Iterate through the data starting from the second line
@@ -163,13 +166,18 @@ if params_asm2provided:
 		})
 
 		busco_table = pd.merge(busco_table, busco_table_2, on='Metric')
-		print (busco_table)
+		print(busco_table)
 
 
 else:
 	gfastats_asm2=""
 	busco_asm2=""
 
+# Change the percentage values to 100.0 for 'Total searched groups'
+busco_table.loc[busco_table['Metric'] == 'Total searched groups', 'asm1 %'] = 100.0
+if 'asm2 %' in busco_table.columns:
+    busco_table.loc[busco_table['Metric'] == 'Total searched groups', 'asm2 %'] = 100.0
+
 output_file=snakemake.output[0]
 
 with open(output_file, 'w') as outFile:
@@ -271,4 +279,4 @@ with open(output_file, 'w') as outFile:
 		print("\\", file=outFile)
 		print("\\Large", file=outFile)
 		print("", file=outFile)
-
+		
\ No newline at end of file
-- 
GitLab