Illumina / interop

C++ Library to parse Illumina InterOp files
http://illumina.github.io/interop/index.html
GNU General Public License v3.0
75 stars 26 forks source link

% of Clusters Passing Filter #255

Closed kate-simonova closed 3 years ago

kate-simonova commented 3 years ago

Could you please provide an example how to come to the percentage of Clusters Passing Filter value per lane in Python.

ezralanglois commented 3 years ago

Here is an example:

from interop import py_interop_run_metrics, py_interop_summary, py_interop_run
run_metrics = py_interop_run_metrics.run_metrics()
valid_to_load = py_interop_run.uchar_vector(py_interop_run.MetricCount, 0)
py_interop_run_metrics.list_summary_metrics_to_load(valid_to_load)
run_metrics.read(run_folder, valid_to_load)
summary = py_interop_summary.run_summary()
py_interop_summary.summarize_run_metrics(run_metrics, summary)
read = 1
for lane in range(summary.at(read).size()):
    lane_summary = summary.at(read).at(lane)
    print("Lane {} has mean PF {}".format(lane_summary.lane(), lane_summary.percent_pf().mean()))

You can list all available metrics in the lane_summary as follows:

tuple([v for v in dir(py_interop_summary.lane_summary()) if not v.startswith('__') and v not in ('this', '_s', 'at', 'size', 'resize', 'resize_stat', 'lane', 'surface')])

By clusters passing filter, you mean mean reads_pf. You can substitute it above

kate-simonova commented 3 years ago

Thank you!