Open
Conversation
* 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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.