Get Cluster PF % and Cluster Density from Interop module using python
1
0
Entering edit mode
11 months ago
kspata ▴ 90

Greetings,

I am using inter op module in python to obtain %Q30, Cluster Density (K/mm2), and Cluster PF (%). I am implementing python interop module to obtain these files from the run folders.

I have following code to obtain Q30, where run folder is MiSeq run folder. I wish to automate this script as I have multiple folders.

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_folder = run_metrics.read(run_folder, valid_to_load)
        summary = py_interop_summary.run_summary()
        py_interop_summary.summarize_run_metrics(run_metrics, summary)
        q_30_score = round(float(summary.total_summary().percent_gt_q30()),2)

How can I obtain cluster density (K/mm2) and Clusters PF % similarly. The run_summary() module does not give this information. There is another class in the py_interop_metrics which gives these two metrics however I can not figure it out.

dir(py_interop_metrics.tile_metric())        **cluster_density_k, and percent_pf**

When I try to replicate the q30 score code it gives me error:

valid_to_load = py_interop_run.uchar_vector(py_interop_run.Tile, 0)
py_interop_run_metrics.list_summary_metrics_to_load(valid_to_load)
run_folder = run_metrics.read(r"input_dir_path", valid_to_load)
pf_summary = py_interop_metrics.tile_metric()
py_interop_summary.summarize_run_metrics(run_metrics, summary)
py_interop_summary.summarize_run_metrics(run_metrics, pf_summary)

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\\Python\Python311\site-packages\interop\py_interop_summary.py", line 711, in summarize_run_metrics
    return _py_interop_summary.summarize_run_metrics(metrics, summary, skip_median, trim)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Wrong number or type of arguments for overloaded function 'summarize_run_metrics'.
  Possible C/C++ prototypes are:
    illumina::interop::logic::summary::summarize_run_metrics(illumina::interop::model::metrics::run_metrics &,illumina::interop::model::summary::run_summary &,bool const,bool const)
    illumina::interop::logic::summary::summarize_run_metrics(illumina::interop::model::metrics::run_metrics &,illumina::interop::model::summary::run_summary &,bool const)
    illumina::interop::logic::summary::summarize_run_metrics(illumina::interop::model::metrics::run_metrics &,illumina::interop::model::summary::run_summary &)

Would highly appreciate help, thanks !

Interop python • 735 views
ADD COMMENT
0
Entering edit mode
11 months ago
kspata ▴ 90

I used following commands to calculate Cluster PF % and Cluster Density (K/mm2)

perc_clusters_pf = round(float((summary.at(1).at(0)).percent_pf().mean()),2)
density = round(float((summary.at(1).at(0)).density().mean()),2)
cluster_density = round((density / 1000), 2)  

summary.at(read).at(lane) 
ADD COMMENT

Login before adding your answer.

Traffic: 1996 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6