Skip to content

Conversation

@dariober
Copy link

Source code edited to be compatible with python3. The compatibility with python2 has not been tested and it is probably lost. Known differences in output between this version and the original python2 version:

  • Transcripts lengths are occasionally different due to the different rounding strategies used by py2 and py3. Differences are minor and sporadic. Python3 rounding is generally preferable.

  • In transcript selection mode, the selected transcript may be different when ties occur. This is because ties are resolved by the order transcripts are returned by the dict.items() method which is not guaranteed to be preserved. These differences are sporadic and there is no reason to prefer one or the other.

dariober and others added 13 commits August 21, 2018 14:11
* On root directory run `2to3 -w ./` which will fix most of the
  incompatiblities. 2to3 ships with python

* Open gzip files in `rt` mode [`gzip.open(<file.gz>), 'rt'`] so that
  each line is returned as string instead of as binary

* Integer division is explicitly cast to integer where an integer is
  expected

* Major version bump to 2.0.0
Minor edits mostly done via `2to3`. Version bumped. Tested against
original python2 version and with no differences in output
Program working on python3 with minor differences with python2:

* Rounding in python3 is different from python2 (python3 considered to
"correct" one) gives slight differences in transcript lenghts

* Order of transcripts in output is slightly differences but it should
not matter
In transcript selection mode, the selected transcript may depend on the
order the transcripts are returned by the dict.items() method. This
order is not guaranteed to be predictable. We sort the list of candidate
transcripts by ENST. In this way we know, at least, that in case of ties
between candidates we consistently select the last one.

(See also comments in the script)
A small unit test to check the basic funcionality of the python3 port
We report transcript lengths in base-pairs, i.e. as integers instead of
kilobases (as floats).
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

Successfully merging this pull request may close these issues.

1 participant