Hi I was solving an issue in pyranges and sow this:
In pyrle.methods in to_ranges function line 199 pr.from_dfs -> module pyranges has no attribute from_dfs
This affects the function _to_bigwig in pyranges.out because when the to_ranges function fails to return a PyRanges objects, gr is not a PyRanges but a Dataframe and does not have a chromosomes attribute.
fix:
original:
pr.from_dfs(dfs)
updated:
pr.PyRanges(dfs)
further suggestion:
Since the name of the function is to_ranges, one expects a PyRanges object, but in case of an exception, the code returns a pandas Dataframe. Furthermore, the exception is caught but not raised or logged, I think something like logging.warning(msg) may help.
Hi I was solving an issue in pyranges and sow this:
In pyrle.methods in to_ranges function line 199 pr.from_dfs -> module pyranges has no attribute from_dfs This affects the function _to_bigwig in pyranges.out because when the to_ranges function fails to return a PyRanges objects, gr is not a PyRanges but a Dataframe and does not have a chromosomes attribute.
fix:
original:
updated:
further suggestion:
Since the name of the function is to_ranges, one expects a PyRanges object, but in case of an exception, the code returns a pandas Dataframe. Furthermore, the exception is caught but not raised or logged, I think something like
logging.warning(msg)
may help.Thanks for the grate package !