iRNA-COSI / APAeval

Community effort to evaluate computational methods for the detection and quantification of poly(A) sites and estimating their differential usage across RNA-seq samples
MIT License
13 stars 14 forks source link

fix: deal with empty matched df #453

Closed dominikburri closed 1 year ago

dominikburri commented 1 year ago

The problem was that if the match within bedtools_window is empty, the dataframe was not correctly constructed and column names were not properly created. This caused a KeyError in compute_metrics.py when sorting the variable matched.

The fix is to explicitly name the columns when creating the empty dataframe. The else statement is now extended to rename the columns from the non-empty (i.e. number of rows > 0) directly.

I locally debugged the solution and it seems to work in that the variable matched is created with corresponding column names and the sorting successfully finishes. The metrics sensitivity and precision are evaluated to 0, as expected.

Checklist