diff --git a/mirtop/exporter/vcf.py b/mirtop/exporter/vcf.py index 3d5aaf0..9193bd4 100644 --- a/mirtop/exporter/vcf.py +++ b/mirtop/exporter/vcf.py @@ -1,11 +1,7 @@ -from __future__ import print_function - import datetime import sys import os.path as op -import six - from mirtop.mirna.fasta import read_precursor from mirtop.mirna.mapper import read_gtf_to_precursor, read_gtf_to_mirna from mirtop.gff.body import read_gff_line @@ -133,14 +129,12 @@ def create_vcf(mirgff3, precursor, gtf, vcffile, database): """ #Check if the input files exist: try: - gff3_file = open(mirgff3, "r", encoding="utf-8") if six.PY3 else open(mirgff3, "r") + gff3_file = open(mirgff3, "r", encoding="utf-8") except IOError: print ("Can't read the file", end=mirgff3) sys.exit() with gff3_file: data = gff3_file.read() - if six.PY2: - data = data.decode("utf-8-sig").encode("utf-8") gff3_data = data.split("\n") vcf_file = open(vcffile, "w") diff --git a/mirtop/libs/do.py b/mirtop/libs/do.py index 8e626a5..886d710 100644 --- a/mirtop/libs/do.py +++ b/mirtop/libs/do.py @@ -5,8 +5,6 @@ import subprocess import logging -import six - logger = logging.getLogger("run") @@ -16,7 +14,7 @@ def run(cmd, data=None, checks=None, region=None, log_error=True, """Run the provided command, logging details and checking for errors. """ try: - logger.debug(" ".join(str(x) for x in cmd) if not isinstance(cmd, six.string_types) else cmd) + logger.debug(" ".join(str(x) for x in cmd) if not isinstance(cmd, str) else cmd) _do_run(cmd, checks, log_stdout) except: if log_error: @@ -44,7 +42,7 @@ def _normalize_cmd_args(cmd): Piped commands set pipefail and require use of bash to help with debugging intermediate errors. """ - if isinstance(cmd, six.string_types): + if isinstance(cmd, str): # check for standard or anonymous named pipes if cmd.find(" | ") > 0 or cmd.find(">(") or cmd.find("<("): return "set -o pipefail; " + cmd, True, find_bash() @@ -74,7 +72,7 @@ def _do_run(cmd, checks, log_stdout=False): for line in s.stdout: debug_stdout.append(line) if exitcode is not None and exitcode != 0: - error_msg = " ".join(cmd) if not isinstance(cmd, six.string_types) else cmd + error_msg = " ".join(cmd) if not isinstance(cmd, str) else cmd error_msg += "\n" error_msg += "".join(debug_stdout) s.communicate() diff --git a/requirements.txt b/requirements.txt index a56d8c1..b71c4cd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,5 +3,6 @@ pybedtools pandas biopython pyyaml +pybedtools six pytest diff --git a/setup.py b/setup.py index 2085ce8..37ac0bf 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,6 @@ def write_version_py(): long_description_content_type="text/markdown", classifiers=[ 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python :: 2.7', "Programming Language :: Python :: 3", 'Topic :: Scientific/Engineering :: Bio-Informatics' ],