kssdtree 2.0.5__tar.gz → 2.0.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. {kssdtree-2.0.5/kssdtree.egg-info → kssdtree-2.0.6}/PKG-INFO +3 -6
  2. {kssdtree-2.0.5 → kssdtree-2.0.6/kssdtree.egg-info}/PKG-INFO +3 -6
  3. {kssdtree-2.0.5 → kssdtree-2.0.6}/kssdtree.py +0 -4
  4. {kssdtree-2.0.5 → kssdtree-2.0.6}/setup.py +1 -1
  5. {kssdtree-2.0.5 → kssdtree-2.0.6}/toolutils.py +25 -13
  6. {kssdtree-2.0.5 → kssdtree-2.0.6}/MANIFEST.in +0 -0
  7. {kssdtree-2.0.5 → kssdtree-2.0.6}/README.md +0 -0
  8. {kssdtree-2.0.5 → kssdtree-2.0.6}/align.c +0 -0
  9. {kssdtree-2.0.5 → kssdtree-2.0.6}/buildtree.c +0 -0
  10. {kssdtree-2.0.5 → kssdtree-2.0.6}/bytescale.c +0 -0
  11. {kssdtree-2.0.5 → kssdtree-2.0.6}/cluster.c +0 -0
  12. {kssdtree-2.0.5 → kssdtree-2.0.6}/co2mco.c +0 -0
  13. {kssdtree-2.0.5 → kssdtree-2.0.6}/command_composite.c +0 -0
  14. {kssdtree-2.0.5 → kssdtree-2.0.6}/command_dist.c +0 -0
  15. {kssdtree-2.0.5 → kssdtree-2.0.6}/command_dist_wrapper.c +0 -0
  16. {kssdtree-2.0.5 → kssdtree-2.0.6}/command_set.c +0 -0
  17. {kssdtree-2.0.5 → kssdtree-2.0.6}/command_shuffle.c +0 -0
  18. {kssdtree-2.0.5 → kssdtree-2.0.6}/distancemat.c +0 -0
  19. {kssdtree-2.0.5 → kssdtree-2.0.6}/dnj.c +0 -0
  20. {kssdtree-2.0.5 → kssdtree-2.0.6}/dnjheaders/bytescale.h +0 -0
  21. {kssdtree-2.0.5 → kssdtree-2.0.6}/dnjheaders/dnj.h +0 -0
  22. {kssdtree-2.0.5 → kssdtree-2.0.6}/dnjheaders/filebuff.h +0 -0
  23. {kssdtree-2.0.5 → kssdtree-2.0.6}/dnjheaders/hclust.h +0 -0
  24. {kssdtree-2.0.5 → kssdtree-2.0.6}/dnjheaders/matrix.h +0 -0
  25. {kssdtree-2.0.5 → kssdtree-2.0.6}/dnjheaders/mman.h +0 -0
  26. {kssdtree-2.0.5 → kssdtree-2.0.6}/dnjheaders/nj.h +0 -0
  27. {kssdtree-2.0.5 → kssdtree-2.0.6}/dnjheaders/nwck.h +0 -0
  28. {kssdtree-2.0.5 → kssdtree-2.0.6}/dnjheaders/pherror.h +0 -0
  29. {kssdtree-2.0.5 → kssdtree-2.0.6}/dnjheaders/phy.h +0 -0
  30. {kssdtree-2.0.5 → kssdtree-2.0.6}/dnjheaders/qseqs.h +0 -0
  31. {kssdtree-2.0.5 → kssdtree-2.0.6}/dnjheaders/str.h +0 -0
  32. {kssdtree-2.0.5 → kssdtree-2.0.6}/dnjheaders/threader.h +0 -0
  33. {kssdtree-2.0.5 → kssdtree-2.0.6}/dnjheaders/tmp.h +0 -0
  34. {kssdtree-2.0.5 → kssdtree-2.0.6}/dnjheaders/vector.h +0 -0
  35. {kssdtree-2.0.5 → kssdtree-2.0.6}/filebuff.c +0 -0
  36. {kssdtree-2.0.5 → kssdtree-2.0.6}/global_basic.c +0 -0
  37. {kssdtree-2.0.5 → kssdtree-2.0.6}/hclust.c +0 -0
  38. {kssdtree-2.0.5 → kssdtree-2.0.6}/iseq2comem.c +0 -0
  39. {kssdtree-2.0.5 → kssdtree-2.0.6}/kssdheaders/co2mco.h +0 -0
  40. {kssdtree-2.0.5 → kssdtree-2.0.6}/kssdheaders/command_composite.h +0 -0
  41. {kssdtree-2.0.5 → kssdtree-2.0.6}/kssdheaders/command_dist.h +0 -0
  42. {kssdtree-2.0.5 → kssdtree-2.0.6}/kssdheaders/command_dist_wrapper.h +0 -0
  43. {kssdtree-2.0.5 → kssdtree-2.0.6}/kssdheaders/command_set.h +0 -0
  44. {kssdtree-2.0.5 → kssdtree-2.0.6}/kssdheaders/command_shuffle.h +0 -0
  45. {kssdtree-2.0.5 → kssdtree-2.0.6}/kssdheaders/global_basic.h +0 -0
  46. {kssdtree-2.0.5 → kssdtree-2.0.6}/kssdheaders/iseq2comem.h +0 -0
  47. {kssdtree-2.0.5 → kssdtree-2.0.6}/kssdheaders/mman.h +0 -0
  48. {kssdtree-2.0.5 → kssdtree-2.0.6}/kssdheaders/mytime.h +0 -0
  49. {kssdtree-2.0.5 → kssdtree-2.0.6}/kssdtree.egg-info/SOURCES.txt +0 -0
  50. {kssdtree-2.0.5 → kssdtree-2.0.6}/kssdtree.egg-info/dependency_links.txt +0 -0
  51. {kssdtree-2.0.5 → kssdtree-2.0.6}/kssdtree.egg-info/not-zip-safe +0 -0
  52. {kssdtree-2.0.5 → kssdtree-2.0.6}/kssdtree.egg-info/requires.txt +0 -0
  53. {kssdtree-2.0.5 → kssdtree-2.0.6}/kssdtree.egg-info/top_level.txt +0 -0
  54. {kssdtree-2.0.5 → kssdtree-2.0.6}/matrix.c +0 -0
  55. {kssdtree-2.0.5 → kssdtree-2.0.6}/mman.c +0 -0
  56. {kssdtree-2.0.5 → kssdtree-2.0.6}/mytime.c +0 -0
  57. {kssdtree-2.0.5 → kssdtree-2.0.6}/nj.c +0 -0
  58. {kssdtree-2.0.5 → kssdtree-2.0.6}/njheaders/align.h +0 -0
  59. {kssdtree-2.0.5 → kssdtree-2.0.6}/njheaders/buildtree.h +0 -0
  60. {kssdtree-2.0.5 → kssdtree-2.0.6}/njheaders/cluster.h +0 -0
  61. {kssdtree-2.0.5 → kssdtree-2.0.6}/njheaders/distancemat.h +0 -0
  62. {kssdtree-2.0.5 → kssdtree-2.0.6}/njheaders/sequence.h +0 -0
  63. {kssdtree-2.0.5 → kssdtree-2.0.6}/njheaders/tree.h +0 -0
  64. {kssdtree-2.0.5 → kssdtree-2.0.6}/njheaders/util.h +0 -0
  65. {kssdtree-2.0.5 → kssdtree-2.0.6}/nwck.c +0 -0
  66. {kssdtree-2.0.5 → kssdtree-2.0.6}/pherror.c +0 -0
  67. {kssdtree-2.0.5 → kssdtree-2.0.6}/phy.c +0 -0
  68. {kssdtree-2.0.5 → kssdtree-2.0.6}/pydnj.c +0 -0
  69. {kssdtree-2.0.5 → kssdtree-2.0.6}/pykssd.c +0 -0
  70. {kssdtree-2.0.5 → kssdtree-2.0.6}/pynj.c +0 -0
  71. {kssdtree-2.0.5 → kssdtree-2.0.6}/qseqs.c +0 -0
  72. {kssdtree-2.0.5 → kssdtree-2.0.6}/sequence.c +0 -0
  73. {kssdtree-2.0.5 → kssdtree-2.0.6}/setup.cfg +0 -0
  74. {kssdtree-2.0.5 → kssdtree-2.0.6}/str.c +0 -0
  75. {kssdtree-2.0.5 → kssdtree-2.0.6}/tmp.c +0 -0
  76. {kssdtree-2.0.5 → kssdtree-2.0.6}/tree.c +0 -0
  77. {kssdtree-2.0.5 → kssdtree-2.0.6}/util.c +0 -0
  78. {kssdtree-2.0.5 → kssdtree-2.0.6}/vector.c +0 -0
@@ -1,11 +1,8 @@
1
- Metadata-Version: 1.1
1
+ Metadata-Version: 2.1
2
2
  Name: kssdtree
3
- Version: 2.0.5
3
+ Version: 2.0.6
4
4
  Summary: Kssdtree is a versatile Python package for phylogenetic analysis. It also provides one-stop tree construction and visualization. It can handle DNA sequences of both fasta or fastq format, whether gzipped or not.
5
5
  Home-page: https://github.com/yhlink/kssdtree
6
+ Download-URL: https://pypi.org/project/kssdtree
6
7
  Author: Hang Yang
7
8
  Author-email: yhlink1207@gmail.com
8
- License: UNKNOWN
9
- Download-URL: https://pypi.org/project/kssdtree
10
- Description: UNKNOWN
11
- Platform: UNKNOWN
@@ -1,11 +1,8 @@
1
- Metadata-Version: 1.1
1
+ Metadata-Version: 2.1
2
2
  Name: kssdtree
3
- Version: 2.0.5
3
+ Version: 2.0.6
4
4
  Summary: Kssdtree is a versatile Python package for phylogenetic analysis. It also provides one-stop tree construction and visualization. It can handle DNA sequences of both fasta or fastq format, whether gzipped or not.
5
5
  Home-page: https://github.com/yhlink/kssdtree
6
+ Download-URL: https://pypi.org/project/kssdtree
6
7
  Author: Hang Yang
7
8
  Author-email: yhlink1207@gmail.com
8
- License: UNKNOWN
9
- Download-URL: https://pypi.org/project/kssdtree
10
- Description: UNKNOWN
11
- Platform: UNKNOWN
@@ -336,7 +336,6 @@ def quick(shuf_file=None, genome_files=None, output=None, reference=None, databa
336
336
  if not s3:
337
337
  return False
338
338
  print('Step4...')
339
- print('Tree visualization finished!')
340
339
  visualize(newick=output, mode=mode)
341
340
  if platform.system() == 'Linux':
342
341
  current_directory = os.getcwd()
@@ -367,7 +366,6 @@ def quick(shuf_file=None, genome_files=None, output=None, reference=None, databa
367
366
  s2 = retrieve(database=database, genome_sketch=qry_sketch, output=output, N=N, method=method)
368
367
  if not s2:
369
368
  return False
370
- print('Tree visualization finished!')
371
369
  visualize(newick=os.path.join(output, 'output.newick'),
372
370
  taxonomy=os.path.join(output, 'output_accession_taxonomy.txt'), mode=None)
373
371
  if platform.system() == 'Linux':
@@ -434,7 +432,6 @@ def quick(shuf_file=None, genome_files=None, output=None, reference=None, databa
434
432
  os.remove('ref.txt')
435
433
  os.remove('qry.txt')
436
434
  os.remove(temp_phy)
437
- print('Tree visualization finished!')
438
435
  visualize(newick=output, taxonomy='ref_qry.txt', mode='r')
439
436
  if platform.system() == 'Linux':
440
437
  current_directory = os.getcwd()
@@ -507,7 +504,6 @@ def quick(shuf_file=None, genome_files=None, output=None, reference=None, databa
507
504
  if not s6:
508
505
  return False
509
506
  print('Step5...')
510
- print('Tree visualization finished!')
511
507
  visualize(newick=output, mode=mode)
512
508
  if platform.system() == 'Linux':
513
509
  current_directory = os.getcwd()
@@ -87,7 +87,7 @@ require_pakages = [
87
87
 
88
88
  setup(
89
89
  name='kssdtree',
90
- version='2.0.5',
90
+ version='2.0.6',
91
91
  author='Hang Yang',
92
92
  author_email='yhlink1207@gmail.com',
93
93
  description="Kssdtree is a versatile Python package for phylogenetic analysis. It also provides one-stop tree construction and visualization. It can handle DNA sequences of both fasta or fastq format, whether gzipped or not. ",
@@ -1,6 +1,8 @@
1
1
  import random
2
2
  import operator
3
3
  import os
4
+ import re
5
+
4
6
  import requests
5
7
  import json
6
8
  import zipfile
@@ -174,6 +176,7 @@ def view_tree(newick, taxonomy, mode):
174
176
  branch_name_face = TextFace(node.dist, fsize=8, fgcolor='black', tight_text=False,
175
177
  bold=False)
176
178
  node.add_face(branch_name_face, column=0, position='branch-top')
179
+ print('Tree visualization finished!')
177
180
  t.show(tree_style=ts)
178
181
  else:
179
182
  mode = 'r'
@@ -203,35 +206,43 @@ def view_tree(newick, taxonomy, mode):
203
206
  current_directory = os.getcwd()
204
207
  taxonomy_path = os.path.join(current_directory, taxonomy)
205
208
  if not os.path.exists(taxonomy_path):
206
- print('"The file taxonomy txt does not exist."')
207
- return
209
+ print('The file taxonomy txt does not exist!')
208
210
 
209
211
  all_accessions = []
210
212
  accession_taxonomy = {}
211
213
  with open(taxonomy_path, 'r') as file:
212
214
  for line in file:
213
215
  columns = line.split()
214
- column_1 = columns[0]
215
- column_2 = columns[1:]
216
- tempfile = ''
217
- for x in column_2:
218
- tempfile = tempfile + x + ' '
219
- tempfile = tempfile[:-1]
220
- all_accessions.append(column_1)
221
- accession_taxonomy[column_1] = tempfile
222
-
216
+ if len(columns) == 2:
217
+ column_1 = columns[0]
218
+ column_2 = columns[1:]
219
+ tempfile = ''
220
+ for x in column_2:
221
+ tempfile = tempfile + x + ' '
222
+ tempfile = tempfile[:-1]
223
+ if column_1 in all_accessions:
224
+ print('Tree visualization failed!')
225
+ print('Tip: There are same genome names between the query genome and the reference genome.')
226
+ return False
227
+ all_accessions.append(column_1)
228
+ accession_taxonomy[column_1] = tempfile
223
229
  known_species = []
224
230
  for x in all_accessions:
225
231
  if accession_taxonomy[x] != 'Unknown':
226
232
  known_species.append(accession_taxonomy[x])
227
-
228
233
  temp_nwk = 'temp_kssdtree.newick'
229
234
 
230
235
  with open(newick, 'r') as f:
231
236
  lines = f.readlines()[0]
232
237
  for x in all_accessions:
238
+ # print(x)
239
+ pattern = r'\b{}\b'.format(re.escape(x))
240
+ # print(pattern)
241
+ match = re.search(pattern, lines)
242
+ if match:
243
+ x_index = match.start()
233
244
  x_len = len(x)
234
- x_index = lines.index(x)
245
+ # print(x_index)
235
246
  loc_index = x_index + x_len + 8
236
247
  if x in accession_taxonomy.keys():
237
248
  lines = str_insert(lines, loc_index, '[&&NHX:species=' + accession_taxonomy.get(x) + ']')
@@ -290,6 +301,7 @@ def view_tree(newick, taxonomy, mode):
290
301
  node.img_style = nst
291
302
  node.set_style(nst)
292
303
  # t.render("bubble_map.png", w=600, dpi=300, tree_style=ts)
304
+ print('Tree visualization finished!')
293
305
  t.show(tree_style=ts)
294
306
 
295
307
  def deal_gtdb_txt(temp_dist_output):
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes