From ad93bf36745b1f773853ca040eb6b40e2bbe593a Mon Sep 17 00:00:00 2001 From: Cezar Pendarovski Date: Fri, 9 Jul 2021 06:45:56 +0100 Subject: [PATCH 1/4] Replace tabs with spaces in add_tax.py --- scripts/add_tax.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/add_tax.py b/scripts/add_tax.py index cbcc478..b608b60 100755 --- a/scripts/add_tax.py +++ b/scripts/add_tax.py @@ -94,19 +94,19 @@ if rank[l] == 'kingdom': k = names[l] - if rank[l] == 'phylum': + if rank[l] == 'phylum': p = names[l] - if rank[l] == 'class': + if rank[l] == 'class': c = names[l] - if rank[l] == 'order': + if rank[l] == 'order': o = names[l] - if rank[l] == 'family': + if rank[l] == 'family': f = names[l] - if rank[l] == 'genus': + if rank[l] == 'genus': g = names[l] # print it all out From 5c98cc4872f27dcc24a553186b7398a915e8187d Mon Sep 17 00:00:00 2001 From: Cezar Pendarovski Date: Sun, 11 Jul 2021 12:30:43 +0100 Subject: [PATCH 2/4] Fix more whitespace --- scripts/add_tax.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/add_tax.py b/scripts/add_tax.py index b608b60..1130823 100755 --- a/scripts/add_tax.py +++ b/scripts/add_tax.py @@ -45,7 +45,7 @@ "genus" ] -print('\t'.join(map(str,titles))) +print('\t'.join(map(str, titles))) # iterate over file for row in checkm_file: @@ -92,7 +92,7 @@ sk = names[l] if rank[l] == 'kingdom': - k = names[l] + k = names[l] if rank[l] == 'phylum': p = names[l] @@ -108,10 +108,10 @@ if rank[l] == 'genus': g = names[l] - + # print it all out - print('\t'.join(map(str,arr)),'\t',end='') - print("%s\t%s\t%s\t%s\t%s\t%s\t%s" % (sk,k,p,c,o,f,g)) + print('\t'.join(map(str, arr)), '\t', end='') + print("%s\t%s\t%s\t%s\t%s\t%s\t%s" % (sk, k, p, c, o, f, g)) # close file checkm_file.close() From ccf00eee3e6f46239dcc7cabdc2181eaaeaf844c Mon Sep 17 00:00:00 2001 From: Cezar Pendarovski Date: Sun, 11 Jul 2021 12:33:16 +0100 Subject: [PATCH 3/4] Remove unnecessary parentheses --- scripts/add_tax.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/add_tax.py b/scripts/add_tax.py index 1130823..836e3b5 100755 --- a/scripts/add_tax.py +++ b/scripts/add_tax.py @@ -53,9 +53,9 @@ arr = row.split() # only consider data lines - if (len(arr) > 1): + if len(arr) > 1: # get taxonomy free of the k__ bit - if (arr[1] == "root"): + if arr[1] == "root": tax = "root" else: tax = arr[1].split("__")[1] From 9f8c06e2cbb06b1e7fb83fe6653aa94877dc20be Mon Sep 17 00:00:00 2001 From: Cezar Pendarovski Date: Sun, 11 Jul 2021 12:34:29 +0100 Subject: [PATCH 4/4] Remove duplicate whitespace before assignment --- scripts/add_tax.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/add_tax.py b/scripts/add_tax.py index 836e3b5..be4eb18 100755 --- a/scripts/add_tax.py +++ b/scripts/add_tax.py @@ -65,12 +65,12 @@ # empty variables unless we change them sk = '' - k = '' - p = '' - c = '' - o = '' - f = '' - g = '' + k = '' + p = '' + c = '' + o = '' + f = '' + g = '' # check we got what we asked for if tax in name2taxid.keys():