@@ -59,7 +59,7 @@ def main(args):
59
59
info .update (compile_json_reports ( json_reports ,
60
60
metadata_xml = metadata_xml_info ,
61
61
sts_xml = sts_xml_info ,
62
- lima_counts = lime_counts ))
62
+ lima_counts = lima_counts ))
63
63
64
64
dump_yaml (info , fh = sys .stdout )
65
65
@@ -141,16 +141,18 @@ def compile_json_reports(reports_dict, metadata_xml, sts_xml=None, lima_counts=N
141
141
reports ['Raw Data' ]['Longest Subread N50' ] = "{}" .format (rd ['raw_data_report.insert_n50' ])
142
142
reports ['Raw Data' ]['Unique Molecular Yield (Gb)' ] = "{:.1f}" .format (rd ['raw_data_report.unique_molecular_yield' ] / 1e9 )
143
143
144
- # This one from reports_dict['loading'], aside from OPLC
145
- try : # FIXME FIXME
146
- lt , = [t for t in reports_dict ['loading' ]['tables' ] if t ['id' ] == 'loading_xml_report.loading_xml_table' ]
147
- ld = { c ['id' ]: c ['values' ][0 ] for c in lt ['columns' ] }
148
- reports ['Loading' ]['P0 %' ] = "{:.1f}" .format (ld ['loading_xml_report.loading_xml_table.productivity_0_pct' ])
149
- reports ['Loading' ]['P1 %' ] = "{:.1f}" .format (ld ['loading_xml_report.loading_xml_table.productivity_1_pct' ])
150
- reports ['Loading' ]['P2 %' ] = "{:.1f}" .format (ld ['loading_xml_report.loading_xml_table.productivity_2_pct' ])
151
- except ValueError :
152
- reports ['Loading' ]['OPLC (pM), On-Plate Loading Conc.' ] = metadata_xml ['on_plate_loading_conc' ]
153
- reports ['Loading' ]['Real OPLC (pM), after clean-up' ] = "to be calculated"
144
+ # This one from reports_dict['loading'], aside from OPLC which we don't have
145
+ ld = { v ['id' ]: v ['value' ] for v in reports_dict ['loading' ]['attributes' ] }
146
+ productive_zmws = ld ['loading_xml_report.productive_zmws' ]
147
+ for n in ["0" , "1" , "2" ]:
148
+ if productive_zmws :
149
+ productivity_pct = (ld [f'loading_xml_report.productivity_{ n } _n' ] / productive_zmws ) * 100
150
+ reports ['Loading' ][f'P{ n } %' ] = "{:.2f}" .format (productivity_pct )
151
+ else :
152
+ reports ['Loading' ][f'P{ n } %' ] = "0.0"
153
+
154
+ reports ['Loading' ]['OPLC (pM), On-Plate Loading Conc.' ] = metadata_xml ['on_plate_loading_conc' ]
155
+ reports ['Loading' ]['Real OPLC (pM), after clean-up' ] = "to be calculated"
154
156
155
157
# This is under reports_dict['ccs'] and yes these really are HiFi numbers
156
158
ccsd = { a ['id' ]: a ['value' ] for a in reports_dict ['ccs' ]['attributes' ] }
0 commit comments