RemiAllio / MitoFinder

MitoFinder: efficient automated large-scale extraction of mitogenomic data from high throughput sequencing data
86 stars 14 forks source link

Python 3 support #19

Open bgruening opened 3 years ago

bgruening commented 3 years ago

It would be nice to run MitoFinder under Python 3. This will enable to mix this nice pipeline with others in one environment.

junaruga commented 1 year ago

The pipeline is mainly written in python 2.7.

It would be nice to have Python 3 support. Python 2 is not supported by the Python project anymore.

https://www.python.org/doc/sunset-python-2/

Sunsetting Python 2

We are volunteers who make and take care of the Python programming language. We have decided that January 1, 2020, was the day that we sunset Python 2. That means that we will not improve it anymore after that day, even if someone finds a security problem in it. You should upgrade to Python 3 as soon as you can.

https://developers.redhat.com/blog/2019/10/25/python-2-support-is-going-away-soon-make-the-move-to-python-3

jacquefm commented 1 year ago

I have a fork that is compatible with python3 if you want to try it: https://github.com/jacquefm/MitoFinder-python3. It works on my setup but it would be nice to see if this works well for others.

JGLAHE commented 1 year ago

@jacquefm thanks for that! How can I provide feedback to you? Can you activate issues on that fork?

jacquefm commented 1 year ago

@JGLAHE Sure thing. Issues activated.

Adamtaranto commented 7 months ago

I've also made a fork of this project that is ported to Python 3 and refactored to work as a pip installable package and has improved error logging.

Basic use cases are working. If anyone finds a bug please open an issue.

https://github.com/Adamtaranto/MitoFinder

OndroV commented 6 months ago

Not sure if the only problem is the spaces instead of brackets after print command, but I had to try and solve the problem myself again because the README in your forks @Adamtaranto and @jacquefm still refers to this RemiAllio version... so my colleague and I haven't noticed and installed the old one thinking that it's your Python3 version :D

For anyone going through the struggle, here is a part of code that we devised to do most of the replacing: for f in $(ls *.py); do lines=$(grep -n "print " $f | cut -d: -f1) ; sed -i "s/print /print(/" $f ; for l in $lines; do sed -i "${l}s/$/)/" $f ; done ; done Then we run python3 ./mitofinder -h and had to manually fix a few lines where the closing bracket should not have been added at the end... this way we were able to obtain the help message as desired.

If it's not the only adaptation from python2 to python3 then I guess we will land on your versions... thanks :)

Adamtaranto commented 6 months ago

@OndroV I changed quite a lot of things. To install do: pip install git+https://github.com/Adamtaranto/MitoFinder.git.

Install any other dependencies via Conda. The software will check for them on your path.

OndroV commented 6 months ago

Thanks for your reply @Adamtaranto , but we got the same outcomes, i.e. the package was regarded as UNKNOWN and mitofinder was giving errors (no such file or directory...).

We tried switching from WSL to Anaconda PowerShell Prompt and got a more desirable installation: "Successfully installed mitofinder-0.1.dev203+gbb3ca13" But no success at installing dependencies with conda install -c Adamtaranto mitofinder , nor at attempting to run mitofinder, mitofinder.exe, python mitofinder -h etc.

So we switched to @jacquefm 's version, which we could easily install and use as described in the README. We only had to edit two installation commands: wget https://github.com/jacquefm/MitoFinder-python3/archive/master.zip and mv MitoFinder-python3-master MitoFinder

JGLAHE commented 6 months ago

Out curiosity @OndroV: which version of WSL (and with which distro) were you using?

OndroV commented 6 months ago

Ubuntu 22.04.3 on WSL 2, Windows 10