secastel / phaser

phasing and Allele Specific Expression from RNA-seq
GNU General Public License v3.0
105 stars 36 forks source link

Port phaser to Python 3 via 2to3 #80

Closed pettyalex closed 2 months ago

pettyalex commented 4 months ago

Hello,

This PR updates phaser to Python 3. There are assorted bugs and other problems with the very old libraries that phaser depends on because it is stuck on Python 2, many of which are easily fixed by running on Python 3:

https://github.com/secastel/phaser/issues/59

This PR runs 2to3 over the codebase, to update it to Python 3 with minimal changes and preserved python2 specific behavior.

pettyalex commented 2 months ago

I have not thoroughly tested this, it's possible that there may be some other problems that were missed.

We ran into a couple of pitfalls with this while running it, including lists named list resulting in the shadowing of the list() builtin function, and some byte/str issues as well.

secastel commented 2 months ago

I tested the scripts with python3, made some additional modifications, and things seem to be running correctly in the master build now.

yybgood commented 2 months ago

! Tell us the pandas / python version may be usefull. Because pandas in py 3.8 is different from py3.9 , especially Dataframe.

sorry I rerun the phaser_gene_ae.py in py3, and then phaser_expr_matrix.py is no error

yybgood commented 2 months ago

! Tell us the pandas / python version may be usefull. Because pandas in py 3.8 is different from py3.9 , especially Dataframe.

sorry I rerun the phaser_gene_ae.py in py3, and then phaser_expr_matrix.py is no error

I get a new warning, maybe you can optimization image