MDU-PHL / ngmaster

In silico multi-antigen sequence typing for Neisseria gonorrhoeae (NG-MAST)
GNU General Public License v3.0
6 stars 5 forks source link

Upgrade to python3 #23

Closed schultzm closed 6 years ago

schultzm commented 6 years ago

This is an upgrade to python3. The main changes are:

first pass upgrade of py files using 2to3-3.6; then: upgrade shebang to #!/usr/bin/env python3 import of io instead of StringIO changes to import of urllib hard tabs to soft tabs (4 spaces) and these changes around line 164 in ngmaster.py:

    cmd = f'echo "{NGprimers}"'
    cmd2 = f'isPcr {f} stdin stdout -tileSize=6 -minPerfect=5 -stepSize=3 -maxSize=900'
    import shlex
    proc0 = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE)
    proc = subprocess.Popen(shlex.split(cmd2), stdin=proc0.stdout, stdout=subprocess.PIPE)
    PCRout = proc.communicate()[0].decode('UTF-8')

ngmaster --test successfully runs. Please run some real test cases to see if results are as expected.