From 61996f089c1a4620e25cd06955f06147d04b2b6e Mon Sep 17 00:00:00 2001 From: Jon Palmer Date: Fri, 21 Feb 2020 07:41:26 -0800 Subject: [PATCH] initialize tree for xml --- funannotate/aux_scripts/iprscan-local.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/funannotate/aux_scripts/iprscan-local.py b/funannotate/aux_scripts/iprscan-local.py index f4d0208e..9964c9fd 100755 --- a/funannotate/aux_scripts/iprscan-local.py +++ b/funannotate/aux_scripts/iprscan-local.py @@ -47,7 +47,9 @@ def combine_xml(files, output): first = data else: first.extend(data.getchildren()) - tree._setroot(first) + #generate new tree + tree = et.ElementTree() + tree._setroot(first) et.register_namespace("", "http://www.ebi.ac.uk/interpro/resources/schemas/interproscan5") tree.write(output, encoding='utf-8', xml_declaration=True) @@ -370,8 +372,8 @@ def runMultiProgress(function, inputList, cpus): if doublecheck: # check output file, if present and not empty, then delete temporary directory if not args.debug: - if os.path.isfile(finalOut): - shutil.rmtree(tmpdir) + if os.path.isfile(finalOut): + shutil.rmtree(tmpdir) print('InterProScan5 search has completed successfully!') print('Results are here: %s' % finalOut) else: