Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3 support? #100

Open
pfaucon opened this issue Oct 13, 2016 · 9 comments
Open

python3 support? #100

pfaucon opened this issue Oct 13, 2016 · 9 comments

Comments

@pfaucon
Copy link

pfaucon commented Oct 13, 2016

I'm looking to rewrite some of the scripts we were using for fast5 parsing, and in particular to just borrow functionality from poretools but I'm having trouble running with python3. In particular pip install fails because setup.py has a "print version" instead of "print(version)" I'll submit a fix for that, but I wanted to see if I can get everything up to speed at the same time. In particular I'm seeing the error below about "scripts" missing, this error does not show up in python2.7.

It looks like there is no support for python 3 within the package (imports are relative, prints and exceptions lack parenthesis etc...) is there interest from the group in doing the conversion?

pfaucon@pfaucon-ubuntu:~/Desktop/poretools$ python3
Python 3.4.3 (default, Oct 14 2015, 20:28:29)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.

import poretools
Traceback (most recent call last):
File "", line 1, in
File "/home/pfaucon/Desktop/poretools/poretools/init.py", line 3, in
import scripts
ImportError: No module named 'scripts'

@pfaucon
Copy link
Author

pfaucon commented Oct 13, 2016

for what it's worth I was able to get poretools working in python3 with the following commands(standard linux):

  • do a generic conversion of python 2 to python 3, make a new directory with the updated python
    • 2to3 --output-dir=poretools-3 -W -n poretools
  • copy the things that weren't changed without clobbering new stuff
    • cp -nr ../poretools/* poretools/
  • clean up the tabs (some of the developers work in vim/nano and mix tabs and spaces, also 8 spaces per tab)
    • find . -name '*.py' ! -type d -exec bash -c 'expand -t 8 "$0" > /tmp/e && mv /tmp/e "$0"' {} ;

after this I rebuilt in python2 and python3 and it seems to work fine. If there is interest I would be happy to place a pull request, else one of you could run the same.

@NathanielLegall
Copy link

A poretools conversion to python 3 would be much appreciated pfaucon. I wouldn't be able to help to achieve this since I am fairly new to bioinformatics but I am happy to offer the computer systems that I have available for testing of any new builds.

@nickloman
Copy link
Collaborator

This is great, thank you for the suggestion. @arq5x what do you think?

@arq5x
Copy link
Owner

arq5x commented Mar 10, 2017

I am on board with this, but don't have any direct experience doing this. @tomsasani would you be up for tackling this with a bit of guidance from @brentp, as he has done 2 and 3 support for some of his tools.

@phfaucon
Copy link

it's already done, look at the pull request that I opened in October. It is probable that there will be more changes to be made (or one could re-run my original pipeline to do the conversion).

I think the main problem is that there are no unit tests for pore tools so I did limited testing by hand at the time, but it would be more comforting to have a standardized testing.

@pfaucon
Copy link
Author

pfaucon commented Mar 12, 2017

@arq5x @nickloman @brentp @tomsasani

It seems like poretools hasn't had any maintenance for at least a few months, but it is still an important tool to the Nanopore community. There are numerous new tools being released, and new file formats and folder formats being used. Is there any interest in continuing the development, or at least maintaining it?

I would be willing to make some contributions, as I have used the tool, but only if they would actually be reviewed and possibly incorporated(unlike my proposed patch that has now sat for a few months :) ).

@nickloman
Copy link
Collaborator

Well I think between us we've managed to keep up with the various changes required for new Metrichor (recursive folder operation) and the new MinKNOW 1.4 file format, but we are certainly overdue rolling a new release.

What we really could do productively is spend a couple of days looking through all the issues and pull requests and cleaning up the repository.

@arq5x
Copy link
Owner

arq5x commented Mar 12, 2017

Agreed. Let's do that and yes, contributions from others are most welcome. Sorry for the slowness in integrating. We are juggling many software projects and just don't have enough hands on deck!

@robegan21
Copy link

Cross referencing this pull request to add python3 support.
#129

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants