[med-svn] [Git][med-team/strelka][master] 2 commits: Enable cmake configuring

Andreas Tille gitlab at salsa.debian.org
Thu May 14 10:07:23 BST 2020



Andreas Tille pushed to branch master at Debian Med / strelka


Commits:
716b7fc2 by Andreas Tille at 2020-05-14T10:52:43+02:00
Enable cmake configuring

- - - - -
7fbdd9e5 by Andreas Tille at 2020-05-14T11:07:02+02:00
Weak and totally untested attempt to port to Python3 by using 2to3

- - - - -


4 changed files:

- debian/control
- + debian/patches/2to3.patch
- + debian/patches/series
- debian/rules


Changes:

=====================================
debian/control
=====================================
@@ -6,7 +6,16 @@ Priority: optional
 Build-Depends: debhelper-compat (= 12),
                cmake,
                dh-python,
-               python3
+               python3,
+               libboost-date-time-dev,
+               libboost-filesystem-dev,
+               libboost-program-options-dev,
+               libboost-serialization-dev,
+               libboost-system-dev,
+               libboost-timer-dev,
+               libboost-chrono-dev,
+               libboost-test-dev,
+               zlib1g-dev
 Standards-Version: 4.5.0
 Vcs-Browser: https://salsa.debian.org/med-team/strelka
 Vcs-Git: https://salsa.debian.org/med-team/strelka.git


=====================================
debian/patches/2to3.patch
=====================================
@@ -0,0 +1,1350 @@
+Author: Andreas Tille <tille at debian.org>
+Last-Update: Wed, 13 May 2020 16:55:22 +0200
+Description: Weak and totally untested attempt to port to Python3 by using 2to3
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -125,15 +125,15 @@ set(THIS_PROJECT_NAME "strelka")
+ 
+ project (${THIS_PROJECT_NAME})
+ 
+-# Find python2 interpreter
+-find_package(PythonInterp 2 QUIET)
++# Find python3 interpreter
++find_package(PythonInterp 3 QUIET)
+ if (NOT PYTHONINTERP_FOUND)
+-    message (WARNING "No python2 interpreter found, disabling optional python build and installation components. Installed workflow requires python2 interpreter to run.")
++    message (WARNING "No python3 interpreter found, disabling optional python build and installation components. Installed workflow requires python3 interpreter to run.")
+ else()
+-    set (MINIMUM_PYTHON_VERSION "2.6")
++    set (MINIMUM_PYTHON_VERSION "3.6")
+     if (${PYTHON_VERSION_STRING} VERSION_LESS ${MINIMUM_PYTHON_VERSION})
+         message (WARNING
+-            "Python2 interpretor must be at least version (${MINIMUM_PYTHON_VERSION}). Found version ${PYTHON_VERSION_STRING} at '${PYTHON_EXECUTABLE}'."
++            "Python3 interpretor must be at least version (${MINIMUM_PYTHON_VERSION}). Found version ${PYTHON_VERSION_STRING} at '${PYTHON_EXECUTABLE}'."
+ 		    " Disabling optional python build and installation components. Installed workflow requires python ${MINIMUM_PYTHON_VERSION} or higher to run.")
+         set(PYTHONINTERP_FOUND false)
+     endif ()
+--- a/docs/developerGuide/README.md
++++ b/docs/developerGuide/README.md
+@@ -191,7 +191,7 @@ see the `builderImage` variable.
+ 
+ ## Coding Guidelines
+ 
+-Supported project languages are C++11 for core methods development and python2 (2.6+) for workflow and scripting support.
++Supported project languages are C++11 for core methods development and python3 (3.6+) for workflow and scripting support.
+ 
+ ### Source formatting
+ 
+--- a/src/config/validate/validateJsonModelFromSchema.py
++++ b/src/config/validate/validateJsonModelFromSchema.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+--- a/src/python/bin/configureStrelkaGermlineWorkflow.py
++++ b/src/python/bin/configureStrelkaGermlineWorkflow.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+@@ -24,13 +24,9 @@ This script configures the strelka germl
+ 
+ import os,sys
+ 
+-if sys.version_info >= (3,0):
++if sys.version_info < (3,6):
+     import platform
+-    raise Exception("Strelka does not currently support python3 (version %s detected)" % (platform.python_version()))
+-
+-if sys.version_info < (2,6):
+-    import platform
+-    raise Exception("Strelka requires python2 version 2.6+ (version %s detected)" % (platform.python_version()))
++    raise Exception("Strelka requires python3 version 3.6+ (version %s detected)" % (platform.python_version()))
+ 
+ 
+ scriptDir=os.path.abspath(os.path.dirname(__file__))
+--- a/src/python/bin/configureStrelkaSomaticWorkflow.py
++++ b/src/python/bin/configureStrelkaSomaticWorkflow.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+@@ -24,13 +24,9 @@ This script configures the Strelka somat
+ 
+ import os,sys
+ 
+-if sys.version_info >= (3,0):
++if sys.version_info < (3,6):
+     import platform
+-    raise Exception("Strelka does not currently support python3 (version %s detected)" % (platform.python_version()))
+-
+-if sys.version_info < (2,6):
+-    import platform
+-    raise Exception("Strelka requires python2 version 2.6+ (version %s detected)" % (platform.python_version()))
++    raise Exception("Strelka requires python3 version 3.6+ (version %s detected)" % (platform.python_version()))
+ 
+ 
+ scriptDir=os.path.abspath(os.path.dirname(__file__))
+--- a/src/python/deNovoQualityScore/denovo.py
++++ b/src/python/deNovoQualityScore/denovo.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+@@ -18,7 +18,7 @@
+ #
+ #
+ 
+-from __future__ import print_function
++
+ 
+ import argparse
+ import csv
+@@ -206,7 +206,7 @@ def check_pedigree_input(pedigree, sampl
+             raise ValueError(msg)
+ 
+     # check if all pedigree sample names are referenced in the header
+-    for k, v in pedigree.iteritems():
++    for k, v in pedigree.items():
+         if v not in samples:
+             msg = "Sample '{1}' for {0} missing in the input VCF.".format(k, v)
+             raise ValueError(msg)
+@@ -372,8 +372,8 @@ def full_genotype_mapping(gtsu_idx):
+     """Map trio sample genotypes to DNG indexing schema"""
+ 
+     n = len(gtsu_idx)
+-    full_idx = itertools.product(xrange(n), xrange(n), xrange(n))
+-    idx_gtsu = {v: k for k, v in gtsu_idx.iteritems()}  # index->GT mapping
++    full_idx = itertools.product(range(n), range(n), range(n))
++    idx_gtsu = {v: k for k, v in gtsu_idx.items()}  # index->GT mapping
+     full_gt = [
+         "/".join([paste(idx_gtsu[k]), paste(idx_gtsu[j]), paste(idx_gtsu[i])])
+         for i, j, k in full_idx
+@@ -475,7 +475,7 @@ def read_prior(path, vartype):
+             'names': col_names,
+             'formats': col_formats
+         })
+-    prior = dict(zip(col_names, prior))
++    prior = dict(list(zip(col_names, prior)))
+ 
+     prior['denovo_flag'].astype(bool)
+ 
+@@ -503,10 +503,10 @@ def reorder_prior(prior, full_gt_idx):
+     """Reorder imported prior to match the DNG genotype order"""
+ 
+     p_gt = {g: i for i, g in enumerate(prior['gt'])}
+-    idx_full_gt = {v: k for k, v in full_gt_idx.iteritems()}  # revert mapping
+-    new_prior_ord = [p_gt[idx_full_gt[i]] for i in xrange(len(idx_full_gt))]
++    idx_full_gt = {v: k for k, v in full_gt_idx.items()}  # revert mapping
++    new_prior_ord = [p_gt[idx_full_gt[i]] for i in range(len(idx_full_gt))]
+ 
+-    prior = {k: np.take(v, new_prior_ord, axis=0) for k, v in prior.iteritems()}
++    prior = {k: np.take(v, new_prior_ord, axis=0) for k, v in prior.items()}
+ 
+     return prior
+ 
+@@ -542,7 +542,7 @@ def allele_indices(alleles, genotype_ind
+     """Return ordered indices for allele combinations for PL field"""
+ 
+     indices = [genotype_index[alleles[j], alleles[i]]
+-               for i in xrange(len(alleles)) for j in xrange(i + 1)]
++               for i in range(len(alleles)) for j in range(i + 1)]
+ 
+     return indices
+ 
+@@ -558,9 +558,9 @@ def build_PL_indices_lookup(alleles, gen
+             alleles, repeat=3),
+         itertools.product(
+             alleles, repeat=4))
+-    alleles_comb = itertools.ifilter(
++    alleles_comb = filter(
+         lambda x: len(set(x)) == min(len(x), n_uniq_alleles), alleles_comb)
+-    alleles_comb = itertools.ifilter(lambda x: ref not in x[1:], alleles_comb)
++    alleles_comb = filter(lambda x: ref not in x[1:], alleles_comb)
+     alleles_lookup = {
+         alleles: allele_indices(alleles, genotype_index)
+         for alleles in alleles_comb
+@@ -800,7 +800,7 @@ def calculate_dng_DQ_indel(variant, prio
+ 
+     try:
+         pl = get_PL_field(variant)
+-        alleles = tuple(['R'] + ['V' for i in xrange(len(variant.ALT))])
++        alleles = tuple(['R'] + ['V' for i in range(len(variant.ALT))])
+         alleles_idx = get_PL_indices_indel(alleles)
+         C = map_sample_pl_indel(pl[sample_index[0]], alleles_idx)
+         M = map_sample_pl_indel(pl[sample_index[1]], alleles_idx)
+@@ -846,7 +846,7 @@ def calculate_dng_DQ_sv(variant, prior,
+ 
+     try:
+         pl = get_PL_field(variant)
+-        alleles = tuple(['R'] + ['V' for i in xrange(len(variant.ALT))])
++        alleles = tuple(['R'] + ['V' for i in range(len(variant.ALT))])
+         alleles_idx = get_PL_indices_indel(alleles)
+         C = map_sample_pl_indel(pl[sample_index[0]], alleles_idx)
+         M = map_sample_pl_indel(pl[sample_index[1]], alleles_idx)
+@@ -897,7 +897,7 @@ def add_DQ_score_to_variant(variant, par
+         # if variant has no DQ format field yet
+         # append the DQ score to the proband and 'missing' to all other samples
+         fields[8] += ':' + _field_name
+-        for i in xrange(param['n_samples']):
++        for i in range(param['n_samples']):
+             field_value, field_index = \
+                 select_sample_score(score, i, sample_index_child, decimals, null_value)
+             fields[field_index] = fields[field_index] + ':' + field_value
+@@ -1011,7 +1011,7 @@ def import_bed_regions(path, fieldnames=
+                 coords = (int(entry['start']), int(entry['end']))
+                 regions.setdefault(contig, list()).append(coords)
+         # convert values from list to tuple
+-        regions = {contig: tuple(coords) for contig, coords in regions.iteritems()}
++        regions = {contig: tuple(coords) for contig, coords in regions.items()}
+     except (IOError, BaseException):
+         regions = None
+ 
+@@ -1067,7 +1067,7 @@ if __name__ == '__main__':
+     parser.add_argument(
+         '--model',
+         required=False,
+-        choices=_models.keys(),
++        choices=list(_models.keys()),
+         default=_default_model_name,
+         help=argparse.SUPPRESS)
+ 
+--- a/src/python/deNovoQualityScore/test/test
++++ b/src/python/deNovoQualityScore/test/test
+@@ -8,4 +8,4 @@ test_dir=$( cd "$(dirname "${BASH_SOURCE
+ base_dir=$( dirname ${test_dir} )
+ 
+ # Run the tests without changing the current directory
+-( cd ${base_dir} && python2 -m pytest "$@" )
++( cd ${base_dir} && python3 -m pytest "$@" )
+--- a/src/python/deNovoQualityScore/test/test_denovo.py
++++ b/src/python/deNovoQualityScore/test/test_denovo.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+@@ -101,7 +101,7 @@ def datasets():
+         'par_bed': 'PARv5.bed'
+     }
+ 
+-    paths = {name: get_test_data_path(path) for name, path in files.iteritems()}
++    paths = {name: get_test_data_path(path) for name, path in files.items()}
+ 
+     return paths
+ 
+@@ -284,7 +284,7 @@ def test_cmd_ids_spw_ref(datasets, tempd
+ 
+     n_hit = 0
+     n_called = {'indel': 0, 'snp': 0}
+-    for variant, variant2 in itertools.izip(vr1, vr2):
++    for variant, variant2 in zip(vr1, vr2):
+         assert variant == variant2
+         for sample in variant.samples:
+             assert 'DQ' in sample.data._fields
+@@ -340,7 +340,7 @@ def test_cmd_parallel_spw_ref(datasets,
+ 
+     n_hit = 0
+     n_called = {'indel': 0, 'snp': 0}
+-    for variant, variant2 in itertools.izip(vr1, vr2):
++    for variant, variant2 in zip(vr1, vr2):
+         assert variant == variant2
+         for sample in variant.samples:
+             assert 'DQ' in sample.data._fields
+@@ -398,7 +398,7 @@ def test_cmd_single_parallel_spw_compari
+     assert vr1.metadata['denovo_program'][0] == vr2.metadata['denovo_program'][0]
+     assert vr1.formats['DQ'] == vr1.formats['DQ']
+ 
+-    for variant, variant2 in itertools.izip(vr1, vr2):
++    for variant, variant2 in zip(vr1, vr2):
+         assert variant == variant2
+ 
+ 
+@@ -494,7 +494,7 @@ def test_cmd_pedphase_filter_spw(dataset
+     check_denovo_header(vr2)
+ 
+     n_denovo = n_no_denovo = n_no_dq = 0
+-    for variant, variant2 in itertools.izip(vr1, vr2):
++    for variant, variant2 in zip(vr1, vr2):
+         assert variant == variant2
+         # compare against simulation tags
+         has_dq_field = 'DQ' in variant.samples[0].data._fields
+@@ -566,7 +566,7 @@ def test_cmd_proband_sibling_five_sample
+     sample_indices = lambda vcf, samples: \
+                           [vcf.samples.index(sample) for sample in samples]
+ 
+-    for variant1, variant2 in itertools.izip(vf1, vf2):
++    for variant1, variant2 in zip(vf1, vf2):
+         # compare common most fields are the same
+         for field in ('CHROM', 'POS', 'ID', 'REF', 'ALT', 'FILTER', 'INFO', 'FORMAT'):
+             assert variant1.__getattribute__(field) == variant2.__getattribute__(field)
+@@ -936,7 +936,7 @@ def test_python_spw_ref_five_samples(dat
+             assert variant.samples[child_idx]['DQ'] >= 20.0
+             n_hit += 1
+         if 'DQ' in variant.samples[child_idx].data._fields:
+-            for sample_index in xrange(len(variant.samples)):
++            for sample_index in range(len(variant.samples)):
+                 sample = variant.samples[sample_index]
+                 if sample_index != child_idx:
+                     assert sample['DQ'] is None
+@@ -991,7 +991,7 @@ def test_python_spw_old_prior_cases(data
+ def test_snv_prior_import_order():
+     """Test SNV prior import and reordering"""
+ 
+-    for prior_type, prior_path in denovo._prior_paths.iteritems():
++    for prior_type, prior_path in denovo._prior_paths.items():
+ 
+         prior_path = prior_path['snv']
+         assert os.path.exists(prior_path)
+@@ -1021,7 +1021,7 @@ def test_indel_length_prior_computation(
+     assert len(mut_rate) == max_len+1
+     assert np.all(np.diff(mut_rate) < 0.0)  # decaying values
+ 
+-    for prior_type, prior_path in denovo._prior_paths.iteritems():
++    for prior_type, prior_path in denovo._prior_paths.items():
+ 
+         prior_path = prior_path['indel']
+         assert os.path.exists(prior_path)
+@@ -1441,7 +1441,7 @@ def test_import_par_bed(datasets):
+     par = denovo.import_bed_regions(par_path)
+ 
+     # check properties of data structure
+-    for contig, coords in par.iteritems():
++    for contig, coords in par.items():
+         assert contig == 'X'
+         assert isinstance(coords, tuple)
+         for pos in coords:
+--- a/src/python/lib/checkChromSet.py
++++ b/src/python/lib/checkChromSet.py
+@@ -172,7 +172,7 @@ def checkChromSet(htsfileBin,referenceFa
+ 
+     # first bam is used as a reference:
+     chromInfo = getBamChromInfo(htsfileBin,bamList[0])
+-    chroms = sorted(chromInfo.keys(),key=lambda x:chromInfo[x][1])
++    chroms = sorted(list(chromInfo.keys()),key=lambda x:chromInfo[x][1])
+ 
+     # check that first bam is compatible with reference:
+     for chrom in chroms :
+@@ -184,7 +184,7 @@ def checkChromSet(htsfileBin,referenceFa
+ 
+     # optionally check that BAM contains all chromosomes in reference:
+     if isReferenceLocked :
+-        for refChrom in refChromInfo.keys() :
++        for refChrom in list(refChromInfo.keys()) :
+             if refChrom not in chroms :
+                 chromError("Reference genome mismatch: %s BAM/CRAM file is missing a chromosome found in the reference fasta file: '%s'" % (bamLabel[0], refChrom))
+ 
+@@ -207,5 +207,5 @@ def checkChromSet(htsfileBin,referenceFa
+         # If all chromosomes matched, then compareChromInfo should be empty at this point.
+         #
+         # Check that no chromosomes are unique to the 'compare' BAM file.
+-        for chrom in compareChromInfo.keys() :
++        for chrom in list(compareChromInfo.keys()) :
+             chromError("Reference genome mismatch: %s BAM/CRAM file is missing a chromosome found in the %s BAM/CRAM file: '%s'" % (bamLabel[0], bamLabel[index], chrom))
+--- a/src/python/lib/configureOptions.py
++++ b/src/python/lib/configureOptions.py
+@@ -95,9 +95,9 @@ class ConfigureWorkflowOptions(object) :
+         """
+ 
+         def updateIniSections(data,newData) :
+-            for k in newData.keys() :
++            for k in list(newData.keys()) :
+                 if k not in data : data[k] = {}
+-                for kk in newData[k].keys() :
++                for kk in list(newData[k].keys()) :
+                     data[k][kk] = newData[k][kk]
+ 
+ 
+@@ -153,7 +153,7 @@ class ConfigureWorkflowOptions(object) :
+ 
+             # write options object back into full iniSections object:
+             #
+-            for k,v in vars(options).iteritems() :
++            for k,v in vars(options).items() :
+                 if k == "isAllHelp" : continue
+                 iniSections[primary_section][k] = v
+ 
+--- a/src/python/lib/configureUtil.py
++++ b/src/python/lib/configureUtil.py
+@@ -41,7 +41,7 @@ def argToBool(x) :
+     class FalseStrings :
+         val = ("", "0", "false", "f", "no", "n", "off")
+ 
+-    if isinstance(x, basestring) :
++    if isinstance(x, str) :
+         return (x.lower() not in FalseStrings.val)
+     return bool(x)
+ 
+@@ -88,7 +88,7 @@ def getPrimarySectionOptions(configSecti
+ 
+     options=WorkflowOptions()
+     if primarySection not in configSections : return options
+-    for (k,v) in configSections[primarySection].items() :
++    for (k,v) in list(configSections[primarySection].items()) :
+         setattr(options,k,v)
+ 
+     return options
+@@ -112,7 +112,7 @@ def dumpIniSections(iniFile,iniSections)
+     """
+     convert iniSections object, expected to be a hash or hashes, into an iniFile
+     """
+-    from ConfigParser import SafeConfigParser
++    from configparser import SafeConfigParser
+ 
+     config = SafeConfigParser()
+     config.optionxform=str
+@@ -121,9 +121,9 @@ def dumpIniSections(iniFile,iniSections)
+         if v is None : return ""
+         else :         return str(v)
+ 
+-    for section in iniSections.keys():
++    for section in list(iniSections.keys()):
+         config.add_section(section)
+-        for k,v in iniSections[section].items() :
++        for k,v in list(iniSections[section].items()) :
+             config.set(section,k,clean_value(v))
+ 
+     configfp=open(iniFile,"w")
+@@ -136,7 +136,7 @@ def getIniSections(iniFile) :
+     """
+     parse the ini iniFile and return a hash of hashes
+     """
+-    from ConfigParser import SafeConfigParser
++    from configparser import SafeConfigParser
+ 
+     if not os.path.isfile(iniFile) : return {}
+ 
+--- a/src/python/lib/makeRunScript.py
++++ b/src/python/lib/makeRunScript.py
+@@ -60,7 +60,7 @@ def makeRunScript(scriptFile, workflowMo
+     sfp=open(scriptFile,"w")
+ 
+     if pythonBin is None :
+-        pythonBin="/usr/bin/env python2"
++        pythonBin="/usr/bin/env python3"
+ 
+     sfp.write(runScript1 % (pythonBin, " ".join(sys.argv),workflowModuleDir,workflowModuleName,workflowClassName))
+ 
+@@ -73,7 +73,7 @@ def makeRunScript(scriptFile, workflowMo
+     sfp.write('main(r"%s","%s",%s)\n' % (pickleConfigFile, primaryConfigSection, workflowClassName))
+     sfp.write('\n')
+     sfp.close()
+-    os.chmod(scriptFile,0755)
++    os.chmod(scriptFile,0o755)
+ 
+ 
+ 
+@@ -83,13 +83,9 @@ runScript1="""#!%s
+ 
+ import os, sys
+ 
+-if sys.version_info >= (3,0):
++if sys.version_info < (3,6):
+     import platform
+-    raise Exception("Strelka does not currently support python3 (version %%s detected)" %% (platform.python_version()))
+-
+-if sys.version_info < (2,6):
+-    import platform
+-    raise Exception("Strelka requires python2 version 2.6+ (version %%s detected)" %% (platform.python_version()))
++    raise Exception("Strelka requires python3 version 3.6+ (version %%s detected)" %% (platform.python_version()))
+ 
+ scriptDir=os.path.abspath(os.path.dirname(__file__))
+ sys.path.append(r'%s')
+--- a/src/python/lib/sharedWorkflow.py
++++ b/src/python/lib/sharedWorkflow.py
+@@ -34,7 +34,7 @@ from workflowUtil import isWindows, preJ
+ 
+ 
+ def isString(x):
+-    return isinstance(x, basestring)
++    return isinstance(x, str)
+ 
+ 
+ def isIterable(x):
+--- a/src/python/lib/strelkaSharedOptions.py
++++ b/src/python/lib/strelkaSharedOptions.py
+@@ -42,7 +42,7 @@ def cleanLocals(locals_dict) :
+     When passed a locals() dictionary, clean out all of the hidden keys and return
+     """
+ 
+-    return dict((k,v) for (k,v) in locals_dict.items() if not k.startswith("__") and k != "self")
++    return dict((k,v) for (k,v) in list(locals_dict.items()) if not k.startswith("__") and k != "self")
+ 
+ 
+ 
+@@ -219,7 +219,7 @@ class StrelkaSharedWorkflowOptionsBase(C
+             (_, chromSizes) = getFastaChromOrderSize(referenceFastaIndex)
+ 
+             totalEstimationSize=0
+-            for chromSize in chromSizes.values() :
++            for chromSize in list(chromSizes.values()) :
+                 if chromSize < Constants.minChromSize : continue
+                 totalEstimationSize += chromSize
+ 
+--- a/src/python/lib/workflowUtil.py
++++ b/src/python/lib/workflowUtil.py
+@@ -210,7 +210,7 @@ def getChromIntervals(chromOrder, chromS
+         segmentBaseSize=chromSize/chromSegments
+         nPlusOne=chromSize%chromSegments
+         start=chromStart
+-        for i in xrange(chromSegments) :
++        for i in range(chromSegments) :
+             segSize=segmentBaseSize
+             if i<nPlusOne : segSize += 1
+             end=min(start+(segSize-1),chromStart+chromSize)
+--- a/src/python/libexec/cat.py
++++ b/src/python/libexec/cat.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+--- a/src/python/libexec/configureSequenceAlleleCountsWorkflow.py
++++ b/src/python/libexec/configureSequenceAlleleCountsWorkflow.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+@@ -24,13 +24,9 @@ This script configures the sequence erro
+ 
+ import os,sys
+ 
+-if sys.version_info >= (3,0):
++if sys.version_info < (3,6):
+     import platform
+-    raise Exception("Strelka does not currently support python3 (version %s detected)" % (platform.python_version()))
+-
+-if sys.version_info < (2,6):
+-    import platform
+-    raise Exception("Strelka requires python2 version 2.6+ (version %s detected)" % (platform.python_version()))
++    raise Exception("Strelka requires python3 version 3.6+ (version %s detected)" % (platform.python_version()))
+ 
+ 
+ scriptDir=os.path.abspath(os.path.dirname(__file__))
+--- a/src/python/libexec/configureStrelkaNoiseWorkflow.py
++++ b/src/python/libexec/configureStrelkaNoiseWorkflow.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+@@ -89,9 +89,9 @@ You must specify a BAM or CRAM file.
+ 
+ def main() :
+ 
+-    if (sys.version_info[0] != 2):
++    if (sys.version_info[0] != 3):
+         notefp=sys.stdout
+-        notefp.write("""Failed to create workflow run script.\nPyflow only supports python2. Detected python %s on the system.\n""" % sys.version_info[0])
++        notefp.write("""Failed to create workflow run script.\nPython2 is End Of Life. Detected python %s on the system.\n""" % sys.version_info[0])
+         return
+ 
+     primarySectionName="snoise"
+--- a/src/python/libexec/extractSmallIndelCandidates.py
++++ b/src/python/libexec/extractSmallIndelCandidates.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+--- a/src/python/libexec/mergeChromDepth.py
++++ b/src/python/libexec/mergeChromDepth.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+--- a/src/python/libexec/sortVcf.py
++++ b/src/python/libexec/sortVcf.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+--- a/src/python/libexec/updateNoPassedVariantGTsFilter.py
++++ b/src/python/libexec/updateNoPassedVariantGTsFilter.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+--- a/src/python/libexec/vcfCmdlineSwapper.py
++++ b/src/python/libexec/vcfCmdlineSwapper.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+--- a/src/python/scoringModelTraining/germline/bin/evs_evaluate.py
++++ b/src/python/scoringModelTraining/germline/bin/evs_evaluate.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+@@ -51,7 +51,7 @@ def parseArgs():
+     parser.add_argument("-c", "--classifier", required=True,
+                         help="Classifier pickle file name")
+     parser.add_argument("-f", "--features",
+-                        choices=evs.features.FeatureSet.sets.keys(),
++                        choices=list(evs.features.FeatureSet.sets.keys()),
+                         required=True,
+                         help="Which feature set to use (or a comma-separated list of feature names,"
+                              " e.g. -f QSS_NT,T_DP_RATE")
+@@ -85,7 +85,7 @@ def main():
+     datasets = []
+     for i in args.inputs:
+         i = os.path.abspath(i)
+-        print "Reading %s" % i
++        print("Reading %s" % i)
+         df = pandas.read_csv(i, na_values=".")
+         df.fillna("0", inplace=True)
+         datasets.append(df)
+@@ -115,7 +115,7 @@ def main():
+ 
+     result = pandas.concat(rlist)
+ 
+-    print pandas.crosstab(result['tag'], result['ptag'])
++    print(pandas.crosstab(result['tag'], result['ptag']))
+ 
+     result.to_csv(args.output)
+ 
+--- a/src/python/scoringModelTraining/germline/bin/evs_exportmodel.py
++++ b/src/python/scoringModelTraining/germline/bin/evs_exportmodel.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+--- a/src/python/scoringModelTraining/germline/bin/evs_learn.py
++++ b/src/python/scoringModelTraining/germline/bin/evs_learn.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+@@ -57,7 +57,7 @@ def parseArgs():
+                         help="Which model to use (options are: %s)" % str(modelNames))
+ 
+     parser.add_argument("--features",
+-                        choices=evs.features.FeatureSet.sets.keys(),
++                        choices=list(evs.features.FeatureSet.sets.keys()),
+                         required=True,
+                         help="Training features. Either a feature-table name or a comma-separated list of feature names."
+                              " e.g. QSS_NT,T_DP_RATE")
+@@ -109,7 +109,7 @@ def getDataSet(inputs, args) :
+     datasets = []
+     for inputFile in inputs:
+         inputFile = os.path.abspath(inputFile)
+-        print "Reading '%s'" % (inputFile)
++        print("Reading '%s'" % (inputFile))
+         df = pandas.read_csv(inputFile, na_values=".")
+         df.fillna("0", inplace=True)
+         # Remove false negatives before any subsampling:
+@@ -125,9 +125,9 @@ def getDataSet(inputs, args) :
+             fps = df[df["tag"] == "FP"]
+             if args.ambig:
+                 ambigs = df[df["tag"] == "UNK"]
+-                print "TP: %d FP: %d, UNK: %d" % (tps.shape[0], fps.shape[0], ambigs.shape[0])
++                print("TP: %d FP: %d, UNK: %d" % (tps.shape[0], fps.shape[0], ambigs.shape[0]))
+             else:
+-                print "TP: %d FP: %d" % (tps.shape[0], fps.shape[0])
++                print("TP: %d FP: %d" % (tps.shape[0], fps.shape[0]))
+             if tps.shape[0] < fps.shape[0]:
+                 rows_selected = random.sample(fps.index, tps.shape[0])
+                 fps = pandas.DataFrame(fps.ix[rows_selected])
+@@ -142,10 +142,10 @@ def getDataSet(inputs, args) :
+             if args.ambig:
+                 rows_selected = random.sample(ambigs.index, fps.shape[0])
+                 ambigs = pandas.DataFrame(ambigs.ix[rows_selected])
+-                print "Downsampled to TP: %d,  FP: %d, UNK: %d" % (tps.shape[0], fps.shape[0], ambigs.shape[0])
++                print("Downsampled to TP: %d,  FP: %d, UNK: %d" % (tps.shape[0], fps.shape[0], ambigs.shape[0]))
+                 df = pandas.concat([tps, fps, ambigs])
+             else:
+-                print "Downsampled to TP: %d FP: %d" % (tps.shape[0], fps.shape[0])
++                print("Downsampled to TP: %d FP: %d" % (tps.shape[0], fps.shape[0]))
+                 df = pandas.concat([tps, fps])
+ 
+         df["weight"] = 1
+@@ -171,9 +171,9 @@ def main():
+     pars = {}
+     if args.parameters :
+         pars = json.load(open(args.parameters))
+-        print "Using custom learning parameters: %s" % str(pars)
++        print("Using custom learning parameters: %s" % str(pars))
+     else :
+-        print "Using default learning parameters."
++        print("Using default learning parameters.")
+ 
+     model = evs.EVSModel.createNew(args.model)
+ 
+@@ -210,7 +210,7 @@ def main():
+     if args.plots and hasattr(model, "plots"):
+         model.plots(args.output + ".plots", features)
+     elif args.plots:
+-        print "No plots created, this is not supported by %s" % args.model
++        print("No plots created, this is not supported by %s" % args.model)
+ 
+ 
+ if __name__ == '__main__':
+--- a/src/python/scoringModelTraining/germline/bin/evs_pr.py
++++ b/src/python/scoringModelTraining/germline/bin/evs_pr.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+@@ -71,7 +71,7 @@ def main():
+     datasets = []
+     for i in args.inputs:
+         i = os.path.abspath(i)
+-        print "Reading %s" % i
++        print("Reading %s" % i)
+         df = pandas.read_csv(i)
+         datasets.append(df)
+ 
+@@ -190,7 +190,7 @@ def main():
+ 
+             counter += 1
+             if counter % 10 == 0:
+-                print "Processed %i / %i qual values for %s" % (counter, len(qual_vals), f)
++                print("Processed %i / %i qual values for %s" % (counter, len(qual_vals), f))
+ 
+     cols=["field", "qual", "tp", "fp", "fn","tp_filtered", "fp_filtered", "na", "na_filtered", "precision", "recall", "fracNA"]
+     if args.stratify :
+--- a/src/python/scoringModelTraining/germline/bin/evs_qq.py
++++ b/src/python/scoringModelTraining/germline/bin/evs_qq.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+@@ -72,7 +72,7 @@ def main():
+     datasets = []
+     for i in args.inputs:
+         i = os.path.abspath(i)
+-        print "Reading %s" % i
++        print("Reading %s" % i)
+         df = pandas.read_csv(i)
+         datasets.append(df)
+ 
+@@ -87,12 +87,12 @@ def main():
+     result = []
+     regression = []
+ 
+-    print "Total: %d" % len(dataset)
++    print("Total: %d" % len(dataset))
+     fns = dataset[dataset["tag"] == "FN"].shape[0]
+-    print "fn: %d" % fns
+-    print "tp: %d" % len(dataset[dataset["tag"] == "TP"])
+-    print "fp: %d" % len(dataset[dataset["tag"] == "FP"])
+-    print "unk: %d" % len(dataset[dataset["tag"] == "UNK"])
++    print("fn: %d" % fns)
++    print("tp: %d" % len(dataset[dataset["tag"] == "TP"]))
++    print("fp: %d" % len(dataset[dataset["tag"] == "FP"]))
++    print("unk: %d" % len(dataset[dataset["tag"] == "UNK"]))
+     dataset = pandas.DataFrame(dataset[dataset["tag"].isin(["TP", "FP"])])
+     data = pandas.DataFrame(dataset.dropna(subset=["qual"]))
+     data = data.iloc[numpy.random.permutation(len(data))] # shuffle before sorting: this ensures random order within tied groups
+@@ -120,7 +120,7 @@ def main():
+ 
+         counter += 1
+         if counter % 10 == 0:
+-            print "Processed %i / %i values" % (counter, len(bins))
++            print("Processed %i / %i values" % (counter, len(bins)))
+ 
+     df = pandas.DataFrame(result)
+     df["Q"] = phred(df["qual"])
+@@ -128,8 +128,8 @@ def main():
+     regr = linear_model.LinearRegression()
+     regr.fit(phred(df["qual"]).reshape(-1,1), phred(df["precision"]).reshape(-1,1))
+     df["calibratedQ"] = regr.predict(phred(df["qual"]).reshape(-1,1))
+-    print df
+-    print("Coefficient: {}, Intercept: {}".format(regr.coef_[0,0], regr.intercept_[0]))
++    print(df)
++    print(("Coefficient: {}, Intercept: {}".format(regr.coef_[0,0], regr.intercept_[0])))
+     df.to_csv(args.output)
+     json.dump({"Coefficient" : regr.coef_[0,0], "Intercept" : regr.intercept_[0]}, open(args.calibration, 'w'))
+ 
+--- a/src/python/scoringModelTraining/germline/bin/filterTrainingVcf.py
++++ b/src/python/scoringModelTraining/germline/bin/filterTrainingVcf.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+--- a/src/python/scoringModelTraining/germline/bin/parseAnnotatedTrainingVcf.py
++++ b/src/python/scoringModelTraining/germline/bin/parseAnnotatedTrainingVcf.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+--- a/src/python/scoringModelTraining/germline/lib/evs/__init__.py
++++ b/src/python/scoringModelTraining/germline/lib/evs/__init__.py
+@@ -25,11 +25,9 @@ import evs.tools.io as io
+ 
+ 
+ 
+-class EVSModel(object):
++class EVSModel(object, metaclass=abc.ABCMeta):
+     """ Base class for EVS models """
+ 
+-    __metaclass__ = abc.ABCMeta
+-
+     def __init__(self):
+         self.clf = None
+         self.mname = None
+@@ -95,8 +93,8 @@ class EVSModel(object):
+ 
+     @classmethod
+     def names(cls):
+-        return cls._models.keys()
++        return list(cls._models.keys())
+ 
+ 
+-import germline_rf   # noqa
++from . import germline_rf   # noqa
+ 
+--- a/src/python/scoringModelTraining/germline/lib/evs/features/GermlineIndel.py
++++ b/src/python/scoringModelTraining/germline/lib/evs/features/GermlineIndel.py
+@@ -17,7 +17,7 @@
+ #
+ #
+ 
+-from VcfFeatureSet import VcfFeatureSet
++from .VcfFeatureSet import VcfFeatureSet
+ 
+ 
+ @VcfFeatureSet.register("germline.indel")
+--- a/src/python/scoringModelTraining/germline/lib/evs/features/GermlineSNV.py
++++ b/src/python/scoringModelTraining/germline/lib/evs/features/GermlineSNV.py
+@@ -17,7 +17,7 @@
+ #
+ #
+ 
+-from VcfFeatureSet import VcfFeatureSet
++from .VcfFeatureSet import VcfFeatureSet
+ 
+ 
+ @VcfFeatureSet.register("germline.snv")
+--- a/src/python/scoringModelTraining/germline/lib/evs/features/RNAIndel.py
++++ b/src/python/scoringModelTraining/germline/lib/evs/features/RNAIndel.py
+@@ -17,7 +17,7 @@
+ #
+ #
+ 
+-from VcfFeatureSet import VcfFeatureSet
++from .VcfFeatureSet import VcfFeatureSet
+ 
+ 
+ @VcfFeatureSet.register("rna.indel")
+--- a/src/python/scoringModelTraining/germline/lib/evs/features/RNASNV.py
++++ b/src/python/scoringModelTraining/germline/lib/evs/features/RNASNV.py
+@@ -17,7 +17,7 @@
+ #
+ #
+ 
+-from VcfFeatureSet import VcfFeatureSet
++from .VcfFeatureSet import VcfFeatureSet
+ 
+ 
+ @VcfFeatureSet.register("rna.snv")
+--- a/src/python/scoringModelTraining/germline/lib/evs/features/__init__.py
++++ b/src/python/scoringModelTraining/germline/lib/evs/features/__init__.py
+@@ -20,11 +20,9 @@
+ import abc
+ 
+ 
+-class FeatureSet(object):
++class FeatureSet(object, metaclass=abc.ABCMeta):
+     """ VCF paired Feature set for somatic comparison """
+ 
+-    __metaclass__ = abc.ABCMeta
+-
+     def __init__(self):
+         pass
+ 
+@@ -56,7 +54,7 @@ class FeatureSet(object):
+         return FeatureSet.sets[name]()
+ 
+ 
+-import GermlineSNV   # noqa
+-import GermlineIndel   # noqa
+-import RNASNV   # noqa
+-import RNAIndel   # noqa
++from . import GermlineSNV   # noqa
++from . import GermlineIndel   # noqa
++from . import RNASNV   # noqa
++from . import RNAIndel   # noqa
+--- a/src/python/scoringModelTraining/germline/lib/evs/germline_rf.py
++++ b/src/python/scoringModelTraining/germline/lib/evs/germline_rf.py
+@@ -114,13 +114,13 @@ class GermlineRF(EVSModel):
+         indices = np.argsort(importances)[::-1]
+ 
+         # Print the feature ranking
+-        print "Feature ranking:"
++        print("Feature ranking:")
+ 
+-        for f in xrange(0, len(indices)):
+-            print "%d. feature %d:%s (%f +- %f)" % (f + 1, indices[f],
++        for f in range(0, len(indices)):
++            print("%d. feature %d:%s (%f +- %f)" % (f + 1, indices[f],
+                                                     featurenames[indices[f]],
+                                                     importances[indices[f]],
+-                                                    std[indices[f]])
++                                                    std[indices[f]]))
+ 
+     def draw_trees(self):
+         """ Draw trees in png files """
+--- a/src/python/scoringModelTraining/germline/lib/evs/tools/io.py
++++ b/src/python/scoringModelTraining/germline/lib/evs/tools/io.py
+@@ -19,7 +19,7 @@
+ 
+ import os
+ import sys
+-import cPickle
++import pickle
+ import json
+ 
+ 
+@@ -58,14 +58,14 @@ def dict_for_tree(tree):
+ def read_pickled_classifier(pickle_fn):
+     """ Read classifier from pickle file """
+     with open(pickle_fn, 'rb') as fid:
+-        clf = cPickle.load(fid)
++        clf = pickle.load(fid)
+     return clf
+ 
+ 
+ def write_classifier_pickle(clf, pickle_fn):
+     """ store classifier in pickle file """
+     with open(pickle_fn, 'wb') as fid:
+-        cPickle.dump(clf, fid)
++        pickle.dump(clf, fid)
+ 
+ 
+ def classifier_to_dict(clf):
+--- a/src/python/scoringModelTraining/somatic/bin/calc_features.py
++++ b/src/python/scoringModelTraining/somatic/bin/calc_features.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+@@ -69,7 +69,7 @@ def main():
+     datasets = []
+     for i in args.inputs:
+         i = os.path.abspath(i)
+-        print "Reading %s" % i
++        print("Reading %s" % i)
+         df = pandas.read_csv(i)
+         datasets.append(df)
+ 
+--- a/src/python/scoringModelTraining/somatic/bin/evs_evaluate.py
++++ b/src/python/scoringModelTraining/somatic/bin/evs_evaluate.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+@@ -50,7 +50,7 @@ def parseArgs():
+     parser.add_argument("-c", "--classifier", required=True,
+                         help="Classifier pickle file name")
+     parser.add_argument("-f", "--features",
+-                        choices=evs.features.FeatureSet.sets.keys(),
++                        choices=list(evs.features.FeatureSet.sets.keys()),
+                         required=True,
+                         help="Which feature set to use (or a comma-separated list of feature names,"
+                              " e.g. -f QSS_NT,T_DP_RATE")
+@@ -85,7 +85,7 @@ def main():
+     datasets = []
+     for i in args.inputs:
+         i = os.path.abspath(i)
+-        print "Reading %s" % i
++        print("Reading %s" % i)
+         df = pandas.read_csv(i)
+         datasets.append(df)
+ 
+@@ -114,7 +114,7 @@ def main():
+ 
+     result = pandas.concat(rlist)
+ 
+-    print pandas.crosstab(result['tag'], result['ptag'])
++    print(pandas.crosstab(result['tag'], result['ptag']))
+ 
+     result.to_csv(args.output)
+ 
+--- a/src/python/scoringModelTraining/somatic/bin/evs_exportmodel.py
++++ b/src/python/scoringModelTraining/somatic/bin/evs_exportmodel.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+--- a/src/python/scoringModelTraining/somatic/bin/evs_learn.py
++++ b/src/python/scoringModelTraining/somatic/bin/evs_learn.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+@@ -56,7 +56,7 @@ def parseArgs():
+                         help="Which model to use (options are: %s)" % str(modelNames))
+ 
+     parser.add_argument("--features",
+-                        choices=evs.features.FeatureSet.sets.keys(),
++                        choices=list(evs.features.FeatureSet.sets.keys()),
+                         required=True,
+                         help="Training features. Either a feature-table name or a comma-separated list of feature names."
+                              " e.g. QSS_NT,T_DP_RATE")
+@@ -110,7 +110,7 @@ def getDataSet(inputs, sample_input, bal
+ 
+     for inputFile in inputs:
+         inputFile = os.path.abspath(inputFile)
+-        print "Reading '%s'" % (inputFile)
++        print("Reading '%s'" % (inputFile))
+         df = pandas.read_csv(inputFile)
+         # Remove false negatives before any subsampling:
+         df = df[df["tag"] != "FN"]
+@@ -123,23 +123,23 @@ def getDataSet(inputs, sample_input, bal
+         if balance_per_sample:
+             tps = df[df["tag"] == "TP"]
+             fps = df[df["tag"] == "FP"]
+-            print "TP: %d FP: %d" % (tps.shape[0], fps.shape[0])
++            print("TP: %d FP: %d" % (tps.shape[0], fps.shape[0]))
+             if tps.shape[0] < fps.shape[0]:
+                 rows_selected = random.sample(fps.index, tps.shape[0])
+                 fps = pandas.DataFrame(fps.ix[rows_selected])
+             elif fps.shape[0] < tps.shape[0]:
+                 rows_selected = random.sample(tps.index, fps.shape[0])
+                 tps = pandas.DataFrame(tps.ix[rows_selected])
+-            print "Downsampled to TP: %d FP: %d" % (tps.shape[0], fps.shape[0])
++            print("Downsampled to TP: %d FP: %d" % (tps.shape[0], fps.shape[0]))
+             df = pandas.concat([tps, fps])
+ 
+         df["weight"] = 1
+         if "Admix" in inputFile:
+             df["weight"] = admixWeight
+-            print "Admixture: setting weight to %f" % admixWeight
++            print("Admixture: setting weight to %f" % admixWeight)
+         if "NN" in inputFile:
+             df["weight"] = nnWeight
+-            print "Normal-normal: setting weight to %f" % nnWeight
++            print("Normal-normal: setting weight to %f" % nnWeight)
+         datasets.append(df)
+ 
+     if len(datasets) > 1:
+@@ -163,9 +163,9 @@ def main():
+     pars = {}
+     if args.parameters :
+         pars = json.load(open(args.parameters))
+-        print "Using custom learning parameters: %s" % str(pars)
++        print("Using custom learning parameters: %s" % str(pars))
+     else :
+-        print "Using default learning parameters."
++        print("Using default learning parameters.")
+ 
+     model = evs.EVSModel.createNew(args.model)
+ 
+@@ -189,7 +189,7 @@ def main():
+     if args.plots and hasattr(model, "plots"):
+         model.plots(args.output + ".plots", features)
+     elif args.plots:
+-        print "No plots created, this is not supported by %s" % args.model
++        print("No plots created, this is not supported by %s" % args.model)
+ 
+ 
+ if __name__ == '__main__':
+--- a/src/python/scoringModelTraining/somatic/bin/evs_pr.py
++++ b/src/python/scoringModelTraining/somatic/bin/evs_pr.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+@@ -69,7 +69,7 @@ def main():
+     datasets = []
+     for i in args.inputs:
+         i = os.path.abspath(i)
+-        print "Reading %s" % i
++        print("Reading %s" % i)
+         df = pandas.read_csv(i)
+         datasets.append(df)
+ 
+@@ -121,12 +121,12 @@ def main():
+             strelka_f_fps = strelka_def_f[
+                 strelka_def_f["tag"] == "FP"].shape[0]
+ 
+-            print "Strelka default filtering:"
+-            print "NT != ref: %i" % dataset[True != strelka_f_ref].shape[0]
+-            print "iHpol: %i" % dataset[True != strelka_f_ihpol].shape[0]
+-            print "BCNoise: %i" % dataset[True != strelka_f_bcnoise].shape[0]
+-            print "Repeat: %i" % dataset[True != strelka_f_repeat].shape[0]
+-            print "Total: %i (%i TP and %i FP)" % (dataset[True != strelka_f].shape[0], strelka_f_tps, strelka_f_fps)
++            print("Strelka default filtering:")
++            print("NT != ref: %i" % dataset[True != strelka_f_ref].shape[0])
++            print("iHpol: %i" % dataset[True != strelka_f_ihpol].shape[0])
++            print("BCNoise: %i" % dataset[True != strelka_f_bcnoise].shape[0])
++            print("Repeat: %i" % dataset[True != strelka_f_repeat].shape[0])
++            print("Total: %i (%i TP and %i FP)" % (dataset[True != strelka_f].shape[0], strelka_f_tps, strelka_f_fps))
+ 
+             data_remaining = dataset[True == strelka_f]
+         else:
+@@ -158,7 +158,7 @@ def main():
+ 
+             counter += 1
+             if counter % 10 == 0:
+-                print "Processed %i / %i qual values for %s" % (counter, len(qual_vals), f)
++                print("Processed %i / %i qual values for %s" % (counter, len(qual_vals), f))
+ 
+     pandas.DataFrame(result, columns=[
+         "field", "qual", "tp", "fp", "fn",
+--- a/src/python/scoringModelTraining/somatic/bin/evs_random_sample_tpfp.py
++++ b/src/python/scoringModelTraining/somatic/bin/evs_random_sample_tpfp.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+@@ -55,7 +55,7 @@ def main():
+     datasets = []
+     for i in args.inputs:
+         i = os.path.abspath(i)
+-        print "Reading %s" % i
++        print("Reading %s" % i)
+         df = pandas.read_csv(i)
+         datasets.append(df)
+ 
+@@ -70,7 +70,7 @@ def main():
+     nrows = min([tpdata2.shape[0], fpdata2.shape[0]])
+ 
+     if nrows < args.samplesize:
+-        print >> sys.stderr, "Warning: sampling will use some records multiple times because there is not enough data!"
++        print("Warning: sampling will use some records multiple times because there is not enough data!", file=sys.stderr)
+ 
+     tp_rows_selected = random.sample(tpdata2.index, args.samplesize)
+     fp_rows_selected = random.sample(fpdata2.index, args.samplesize)
+--- a/src/python/scoringModelTraining/somatic/bin/evs_random_split_csv.py
++++ b/src/python/scoringModelTraining/somatic/bin/evs_random_split_csv.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+@@ -57,7 +57,7 @@ def main():
+     datasets = []
+     for i in args.inputs:
+         i = os.path.abspath(i)
+-        print "Reading %s" % i
++        print("Reading %s" % i)
+         df = pandas.read_csv(i)
+         datasets.append(df)
+ 
+--- a/src/python/scoringModelTraining/somatic/bin/vcf_to_feature_csv.py
++++ b/src/python/scoringModelTraining/somatic/bin/vcf_to_feature_csv.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.
+@@ -58,7 +58,7 @@ def parseArgs():
+                         help="Bed file conforming to the curium ambiguous region file format"
+                              " (may be specified more than once)")
+     parser.add_argument("--features", required=True,
+-                        choices=evs.features.FeatureSet.sets.keys(),
++                        choices=list(evs.features.FeatureSet.sets.keys()),
+                         help="Select a feature table to output.")
+ 
+     args = parser.parse_args()
+--- a/src/python/scoringModelTraining/somatic/lib/evs/__init__.py
++++ b/src/python/scoringModelTraining/somatic/lib/evs/__init__.py
+@@ -25,11 +25,9 @@ import evs.tools.io as io
+ 
+ 
+ 
+-class EVSModel(object):
++class EVSModel(object, metaclass=abc.ABCMeta):
+     """ Base class for EVS models """
+ 
+-    __metaclass__ = abc.ABCMeta
+-
+     def __init__(self):
+         self.clf = None
+         self.mname = None
+@@ -95,7 +93,7 @@ class EVSModel(object):
+ 
+     @classmethod
+     def names(cls):
+-        return cls._models.keys()
++        return list(cls._models.keys())
+ 
+ 
+-import somatic_rf   # noqa
++from . import somatic_rf   # noqa
+--- a/src/python/scoringModelTraining/somatic/lib/evs/features/PosAndAlleles.py
++++ b/src/python/scoringModelTraining/somatic/lib/evs/features/PosAndAlleles.py
+@@ -17,7 +17,7 @@
+ #
+ #
+ 
+-from VcfFeatureSet import VcfFeatureSet
++from .VcfFeatureSet import VcfFeatureSet
+ 
+ 
+ @VcfFeatureSet.register("posandalleles")
+--- a/src/python/scoringModelTraining/somatic/lib/evs/features/SomaticIndel.py
++++ b/src/python/scoringModelTraining/somatic/lib/evs/features/SomaticIndel.py
+@@ -17,7 +17,7 @@
+ #
+ #
+ 
+-from VcfFeatureSet import VcfFeatureSet
++from .VcfFeatureSet import VcfFeatureSet
+ 
+ 
+ @VcfFeatureSet.register("somatic.indel")
+--- a/src/python/scoringModelTraining/somatic/lib/evs/features/SomaticSNV.py
++++ b/src/python/scoringModelTraining/somatic/lib/evs/features/SomaticSNV.py
+@@ -17,7 +17,7 @@
+ #
+ #
+ 
+-from VcfFeatureSet import VcfFeatureSet
++from .VcfFeatureSet import VcfFeatureSet
+ 
+ 
+ @VcfFeatureSet.register("somatic.snv")
+--- a/src/python/scoringModelTraining/somatic/lib/evs/features/__init__.py
++++ b/src/python/scoringModelTraining/somatic/lib/evs/features/__init__.py
+@@ -20,11 +20,9 @@
+ import abc
+ 
+ 
+-class FeatureSet(object):
++class FeatureSet(object, metaclass=abc.ABCMeta):
+     """ VCF paired Feature set for somatic comparison """
+ 
+-    __metaclass__ = abc.ABCMeta
+-
+     def __init__(self):
+         pass
+ 
+@@ -56,6 +54,6 @@ class FeatureSet(object):
+         return FeatureSet.sets[name]()
+ 
+ 
+-import SomaticSNV   # noqa
+-import SomaticIndel  # noqa
+-import PosAndAlleles  # noqa
++from . import SomaticSNV   # noqa
++from . import SomaticIndel  # noqa
++from . import PosAndAlleles  # noqa
+--- a/src/python/scoringModelTraining/somatic/lib/evs/somatic_rf.py
++++ b/src/python/scoringModelTraining/somatic/lib/evs/somatic_rf.py
+@@ -108,12 +108,12 @@ class SomaticRF(EVSModel):
+         indices = np.argsort(importances)[::-1]
+ 
+         # Print the feature ranking
+-        print "Feature ranking:"
++        print("Feature ranking:")
+ 
+-        for f in xrange(0, len(indices)):
+-            print "%d. feature %d:%s (%f +- %f)" % (f + 1, indices[f],
++        for f in range(0, len(indices)):
++            print("%d. feature %d:%s (%f +- %f)" % (f + 1, indices[f],
+                                                     featurenames[indices[f]],
+                                                     importances[indices[f]],
+-                                                    std[indices[f]])
++                                                    std[indices[f]]))
+ 
+ EVSModel.register("somatic.rf", SomaticRF)
+--- a/src/python/scoringModelTraining/somatic/lib/evs/strelka_rf_indel.py
++++ b/src/python/scoringModelTraining/somatic/lib/evs/strelka_rf_indel.py
+@@ -112,12 +112,12 @@ class StrelkaRFIndel(EVSModel):
+             indices = np.argsort(importances)[::-1]
+ 
+             # Print the feature ranking
+-            print "Feature ranking for INDELTYPE == %s:" % str(it)
++            print("Feature ranking for INDELTYPE == %s:" % str(it))
+ 
+-            for f in xrange(0, len(indices)):
+-                print "%d. feature %d:%s (%f +- %f)" % (f + 1, indices[f],
++            for f in range(0, len(indices)):
++                print("%d. feature %d:%s (%f +- %f)" % (f + 1, indices[f],
+                                                         featurenames[indices[f]],
+                                                         importances[indices[f]],
+-                                                        std[indices[f]])
++                                                        std[indices[f]]))
+ 
+ EVSModel.register("strelka.rf.indel", StrelkaRFIndel)
+--- a/src/python/scoringModelTraining/somatic/lib/evs/tools/io.py
++++ b/src/python/scoringModelTraining/somatic/lib/evs/tools/io.py
+@@ -19,7 +19,7 @@
+ 
+ import os
+ import sys
+-import cPickle
++import pickle
+ import json
+ 
+ 
+@@ -58,14 +58,14 @@ def dict_for_tree(tree):
+ def read_pickled_classifier(pickle_fn):
+     """ Read classifier from pickle file """
+     with open(pickle_fn, 'rb') as fid:
+-        clf = cPickle.load(fid)
++        clf = pickle.load(fid)
+     return clf
+ 
+ 
+ def write_classifier_pickle(clf, pickle_fn):
+     """ store classifier in pickle file """
+     with open(pickle_fn, 'wb') as fid:
+-        cPickle.dump(clf, fid)
++        pickle.dump(clf, fid)
+ 
+ 
+ def classifier_to_dict(clf):
+--- a/src/srcqc/run_cppcheck.py
++++ b/src/srcqc/run_cppcheck.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ #
+ # Strelka - Small Variant Caller
+ # Copyright (c) 2009-2018 Illumina, Inc.


=====================================
debian/patches/series
=====================================
@@ -0,0 +1 @@
+2to3.patch


=====================================
debian/rules
=====================================
@@ -17,16 +17,11 @@ include /usr/share/dpkg/default.mk
 # for hardening you might like to uncomment this:
 # export DEB_BUILD_MAINT_OPTIONS=hardening=+all
 
-CMAKE_EXTRA_FLAGS += \
-		     FULL_PREFIX=/usr \
-		     THIS_DATADIR=share/$(DEB_SOURCE) \
-		     THIS_MODULE_DIR=cmake
-
 %:
-	dh $@ --sourcedirectory=src
+	dh $@ --buildsystem=cmake
 
 override_dh_auto_configure:
-	dh_auto_configure -- $(CMAKE_EXTRA_FLAGS)
+	dh_auto_configure -- -DCMAKE_BUILD_TYPE=RelWithDebInfo
 
 ### When overriding auto_test make sure DEB_BUILD_OPTIONS will be respected
 #override_dh_auto_test:



View it on GitLab: https://salsa.debian.org/med-team/strelka/-/compare/8f85277cf3b3cb42417a2bd3fad7748f39f45b63...7fbdd9e5cf6633fe93e43b3e7e8e753a3a5a30f3

-- 
View it on GitLab: https://salsa.debian.org/med-team/strelka/-/compare/8f85277cf3b3cb42417a2bd3fad7748f39f45b63...7fbdd9e5cf6633fe93e43b3e7e8e753a3a5a30f3
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20200514/f1098e87/attachment-0001.html>


More information about the debian-med-commit mailing list