Skip to content
Snippets Groups Projects
Commit 01fc9627 authored by ddepanis's avatar ddepanis
Browse files

Update makePDF_indivMD.py

parent 7633a944
No related branches found
No related tags found
No related merge requests found
...@@ -139,6 +139,9 @@ if params_asm2provided: ...@@ -139,6 +139,9 @@ if params_asm2provided:
lines = scoresOnlyFile.readlines() lines = scoresOnlyFile.readlines()
lines = [line.rstrip() for line in lines] 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 = [] percentages = []
numbers = [] numbers = []
# Iterate through the data starting from the second line # Iterate through the data starting from the second line
...@@ -163,13 +166,18 @@ if params_asm2provided: ...@@ -163,13 +166,18 @@ if params_asm2provided:
}) })
busco_table = pd.merge(busco_table, busco_table_2, on='Metric') busco_table = pd.merge(busco_table, busco_table_2, on='Metric')
print (busco_table) print(busco_table)
else: else:
gfastats_asm2="" gfastats_asm2=""
busco_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] output_file=snakemake.output[0]
with open(output_file, 'w') as outFile: with open(output_file, 'w') as outFile:
...@@ -271,4 +279,4 @@ with open(output_file, 'w') as outFile: ...@@ -271,4 +279,4 @@ with open(output_file, 'w') as outFile:
print("\\", file=outFile) print("\\", file=outFile)
print("\\Large", file=outFile) print("\\Large", file=outFile)
print("", file=outFile) print("", file=outFile)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment