Skip to content

Commit 2e4ed97

Browse files
committed
I think we are done. Need to test that sts handling is OK.
1 parent da0f5eb commit 2e4ed97

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

compile_cell_info.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def main(args):
5959
info.update(compile_json_reports( json_reports,
6060
metadata_xml = metadata_xml_info,
6161
sts_xml = sts_xml_info,
62-
lima_counts = lime_counts ))
62+
lima_counts = lima_counts ))
6363

6464
dump_yaml(info, fh=sys.stdout)
6565

@@ -141,16 +141,18 @@ def compile_json_reports(reports_dict, metadata_xml, sts_xml=None, lima_counts=N
141141
reports['Raw Data']['Longest Subread N50'] = "{}".format(rd['raw_data_report.insert_n50'])
142142
reports['Raw Data']['Unique Molecular Yield (Gb)'] = "{:.1f}".format(rd['raw_data_report.unique_molecular_yield'] / 1e9)
143143

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"
154156

155157
# This is under reports_dict['ccs'] and yes these really are HiFi numbers
156158
ccsd = { a['id']: a['value'] for a in reports_dict['ccs']['attributes'] }

doc/adapter_and_loading_report.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,13 @@ to get the pipeline run today.
6969

7070
Also for the laoding report. I think for this I just need to divide some numbers, but I need to check.
7171
Hmmm.
72+
73+
Looking at
74+
r84140_20241220_153042/1_D01/statistics/m84140_241220_153813_s1.reports.zip loading.report.json
75+
76+
I see that the values for productivity_0_pct, productivity_1_pct, productivity_2_pct are:
77+
24.442 74.956 0.602
78+
79+
And yes, we can just get these by dividing the numbers by Productive ZMWs.
80+
81+
Implemented. Cool. Let's go.

0 commit comments

Comments
 (0)