BSSeeker / BSseeker2

A versatile aligning pipeline for bisulfite sequencing data
http://pellegrini.mcdb.ucla.edu/BS_Seeker2/
MIT License
60 stars 25 forks source link

bs_seeker2-call_methylation.py line 286 makes bad comparison to pysam version string #13

Closed iankorf closed 7 years ago

iankorf commented 7 years ago

On line 286, there is the following statement

if pysam.__version__ > "0.8.0" :

The problem is that pysam is on version 0.10.0. Therefore, a simple string comparison no longer works because 0.10.0 is lexically less than 0.8.0 even though in version numbers it's greater.

Instead of using string comparison, use distutils.version.LooseVersion().

guoweilong commented 7 years ago

Great thanks, @iankorf !

The fixed code is just commited.

Best, Weilong

hlfernandez commented 7 years ago

Thank you @guoweilong. However, last version of BS-Seeker2 (v2.1.1) still presents this problem in that line and fails in line 289 because of the bad version comparison.

Since I am using pysam v0.11.2.1, I have commented line 286 to ignore the bad if and made the correct assignment (_pr_qpos = pr.queryposition).

Moreover, taking a look at commit "fix version error", the problem seems to be fixed on line 132 but line 286 has not been changed.

guoweilong commented 7 years ago

@hlfernandez Thanks. I just noticed your message by checking back. Now it should be fixed.

Weilong