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

Parsing Binary files in python #201

Closed rafaloz closed 4 years ago

rafaloz commented 4 years ago

I am following the third python example to parse the different .bin files in the demo.

So after this block:

run_metrics = py_interop_run_metrics.run_metrics()
valid_to_load = py_interop_run.uchar_vector(py_interop_run.MetricCount, 0)
valid_to_load[py_interop_run.Extraction] = 1
run_metrics.read(run_folder, valid_to_load)

I understood that each file had its own function as:

q_metrics = run_metrics.q_metric_set()
extraction_metrics = run_metrics.extraction_metric_set()
q_metrics_by_lane = run_metrics.q_by_lane_metric_set()

etc...

however, except for the demo example, when extracting the data I

error_metric = error_metrics.at(0)

get that the last cycle is 0 and the error:

interop.py_interop_metrics.index_out_of_bounds_exception: Index out of bounds - 0 >= 0,

As if it is empty, but when using dumptext in the terminal all can see all the data.

Is it possible to do what I want with the python binding?

ezralanglois commented 4 years ago

This example only loads Extraction metrics:

run_metrics = py_interop_run_metrics.run_metrics()
valid_to_load = py_interop_run.uchar_vector(py_interop_run.MetricCount, 0)
valid_to_load[py_interop_run.Extraction] = 1
run_metrics.read(run_folder, valid_to_load)

You can load all metrics as follows:

run_metrics = py_interop_run_metrics.run_metrics()
run_metrics.read(run_folder)
rafaloz commented 4 years ago

Thank you!