jpiper / pyDNase

Python module for the easy handling and analysis of DNase-seq data
http://jpiper.github.io/pyDNase
MIT License
37 stars 24 forks source link

Python version issues(?) running wellington_footprints.py #25

Closed Xparx closed 6 years ago

Xparx commented 6 years ago

Running python 3.6.1 running pip install pyDNase After fixing the print statements to work in python3

I'm running the following code

import pyDNase
regions = pyDNase.GenomicIntervalSet("merged_peaks.bed")
len(regions.intervals.values())
sorted(regions.intervals.values())

where the last line can be found in the file wellington_footprints.py now this gives an error.

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-5-7d9455173698> in <module>()
----> 1 sorted(regions.intervals.values())

TypeError: '<' not supported between instances of 'GenomicInterval' and 'GenomicInterval'

trying to figure out what is going on here but it seems like Genomic Interval does not work the same as it used to. How do I fix this?

PS: Is this project dead? The fact that wellington_footprints script is not working and no responses to previous issues hints at this.

jpiper commented 6 years ago

Hey,

Apologies but I moved companies and I had to get permission to continue developing pyDNase from legal. It’s all sorted now and I should hope to have some time this weekend to go through these bugs and clean them up :) however, I’m definitely in bug fix mode - I don’t anticipate developing any new features (I left the bioinformatics field) but I’ll continue to support where I can :)

J

Sent from my iPhone

On 26 Jan 2018, at 00:00, Andreas notifications@github.com wrote:

Running python 3.6.1 running pip install pyDNase After fixing the print statements to work in python3

I'm running the following code

import pyDNase regions = pyDNase.GenomicIntervalSet("merged_peaks.bed") len(regions.intervals.values()) sorted(regions.intervals.values()) where the last line can be found in the file wellington_footprints.py now this gives an error.


TypeError Traceback (most recent call last)

in () ----> 1 sorted(regions.intervals.values()) TypeError: '<' not supported between instances of 'GenomicInterval' and 'GenomicInterval' trying to figure out what is going on here but it seems like Genomic Interval does not work the same as it used to. How do I fix this? PS: Is this project dead? The fact that wellington_footprints script is not working and no responses to previous issues hints at this. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
Xparx commented 6 years ago

EDIT: significant!! not "non signifcant".... Ah, I understand. Sorry if it sounded harsh. Anecdotally it feels like a significant group uses pyDNase in their pipeline. Mopping up some bugs would be great!

Not sure this is the optimal/correct way to fix my issue but I hacked the offending line in the script as follows

orderedbychr = [item for sublist in sorted(regions.intervals.keys()) for item in sorted(regions.intervals[sublist], key=lambda peak: peak.startbp)]
Xparx commented 6 years ago

I will leave an extra comment just to make sure my above correction is read. Did not mean to be insulting. I blame my English skills =/

jpiper commented 6 years ago

Haha, no worries. And thanks for the code snippet!

jpiper commented 6 years ago

Ok, I have Python 3 support for the core scripts done!

jpiper commented 6 years ago

Fixed in #26

Xparx commented 6 years ago

After updating I get the same issue with the problem above. Could I be missing some dependency? I did a pip force reinstall and upgrade but it did not fix the issue.

Also, the terminal is confused running python on the file. This might be on my end though, needed to add back the #! line.