kssdtree 1.1.8__tar.gz → 1.1.9__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-1.1.8/kssdtree.egg-info → kssdtree-1.1.9}/PKG-INFO +1 -1
  2. {kssdtree-1.1.8 → kssdtree-1.1.9/kssdtree.egg-info}/PKG-INFO +1 -1
  3. {kssdtree-1.1.8 → kssdtree-1.1.9}/kssdtree.py +31 -15
  4. {kssdtree-1.1.8 → kssdtree-1.1.9}/setup.py +1 -1
  5. {kssdtree-1.1.8 → kssdtree-1.1.9}/toolutils.py +7 -1
  6. {kssdtree-1.1.8 → kssdtree-1.1.9}/MANIFEST.in +0 -0
  7. {kssdtree-1.1.8 → kssdtree-1.1.9}/README.md +0 -0
  8. {kssdtree-1.1.8 → kssdtree-1.1.9}/align.c +0 -0
  9. {kssdtree-1.1.8 → kssdtree-1.1.9}/buildtree.c +0 -0
  10. {kssdtree-1.1.8 → kssdtree-1.1.9}/bytescale.c +0 -0
  11. {kssdtree-1.1.8 → kssdtree-1.1.9}/cluster.c +0 -0
  12. {kssdtree-1.1.8 → kssdtree-1.1.9}/co2mco.c +0 -0
  13. {kssdtree-1.1.8 → kssdtree-1.1.9}/command_composite.c +0 -0
  14. {kssdtree-1.1.8 → kssdtree-1.1.9}/command_dist.c +0 -0
  15. {kssdtree-1.1.8 → kssdtree-1.1.9}/command_dist_wrapper.c +0 -0
  16. {kssdtree-1.1.8 → kssdtree-1.1.9}/command_set.c +0 -0
  17. {kssdtree-1.1.8 → kssdtree-1.1.9}/command_shuffle.c +0 -0
  18. {kssdtree-1.1.8 → kssdtree-1.1.9}/distancemat.c +0 -0
  19. {kssdtree-1.1.8 → kssdtree-1.1.9}/dnj.c +0 -0
  20. {kssdtree-1.1.8 → kssdtree-1.1.9}/dnjheaders/bytescale.h +0 -0
  21. {kssdtree-1.1.8 → kssdtree-1.1.9}/dnjheaders/dnj.h +0 -0
  22. {kssdtree-1.1.8 → kssdtree-1.1.9}/dnjheaders/filebuff.h +0 -0
  23. {kssdtree-1.1.8 → kssdtree-1.1.9}/dnjheaders/hclust.h +0 -0
  24. {kssdtree-1.1.8 → kssdtree-1.1.9}/dnjheaders/matrix.h +0 -0
  25. {kssdtree-1.1.8 → kssdtree-1.1.9}/dnjheaders/mman.h +0 -0
  26. {kssdtree-1.1.8 → kssdtree-1.1.9}/dnjheaders/nj.h +0 -0
  27. {kssdtree-1.1.8 → kssdtree-1.1.9}/dnjheaders/nwck.h +0 -0
  28. {kssdtree-1.1.8 → kssdtree-1.1.9}/dnjheaders/pherror.h +0 -0
  29. {kssdtree-1.1.8 → kssdtree-1.1.9}/dnjheaders/phy.h +0 -0
  30. {kssdtree-1.1.8 → kssdtree-1.1.9}/dnjheaders/qseqs.h +0 -0
  31. {kssdtree-1.1.8 → kssdtree-1.1.9}/dnjheaders/str.h +0 -0
  32. {kssdtree-1.1.8 → kssdtree-1.1.9}/dnjheaders/threader.h +0 -0
  33. {kssdtree-1.1.8 → kssdtree-1.1.9}/dnjheaders/tmp.h +0 -0
  34. {kssdtree-1.1.8 → kssdtree-1.1.9}/dnjheaders/vector.h +0 -0
  35. {kssdtree-1.1.8 → kssdtree-1.1.9}/filebuff.c +0 -0
  36. {kssdtree-1.1.8 → kssdtree-1.1.9}/global_basic.c +0 -0
  37. {kssdtree-1.1.8 → kssdtree-1.1.9}/hclust.c +0 -0
  38. {kssdtree-1.1.8 → kssdtree-1.1.9}/iseq2comem.c +0 -0
  39. {kssdtree-1.1.8 → kssdtree-1.1.9}/kssdheaders/co2mco.h +0 -0
  40. {kssdtree-1.1.8 → kssdtree-1.1.9}/kssdheaders/command_composite.h +0 -0
  41. {kssdtree-1.1.8 → kssdtree-1.1.9}/kssdheaders/command_dist.h +0 -0
  42. {kssdtree-1.1.8 → kssdtree-1.1.9}/kssdheaders/command_dist_wrapper.h +0 -0
  43. {kssdtree-1.1.8 → kssdtree-1.1.9}/kssdheaders/command_set.h +0 -0
  44. {kssdtree-1.1.8 → kssdtree-1.1.9}/kssdheaders/command_shuffle.h +0 -0
  45. {kssdtree-1.1.8 → kssdtree-1.1.9}/kssdheaders/global_basic.h +0 -0
  46. {kssdtree-1.1.8 → kssdtree-1.1.9}/kssdheaders/iseq2comem.h +0 -0
  47. {kssdtree-1.1.8 → kssdtree-1.1.9}/kssdheaders/mman.h +0 -0
  48. {kssdtree-1.1.8 → kssdtree-1.1.9}/kssdheaders/mytime.h +0 -0
  49. {kssdtree-1.1.8 → kssdtree-1.1.9}/kssdtree.egg-info/SOURCES.txt +0 -0
  50. {kssdtree-1.1.8 → kssdtree-1.1.9}/kssdtree.egg-info/dependency_links.txt +0 -0
  51. {kssdtree-1.1.8 → kssdtree-1.1.9}/kssdtree.egg-info/not-zip-safe +0 -0
  52. {kssdtree-1.1.8 → kssdtree-1.1.9}/kssdtree.egg-info/requires.txt +0 -0
  53. {kssdtree-1.1.8 → kssdtree-1.1.9}/kssdtree.egg-info/top_level.txt +0 -0
  54. {kssdtree-1.1.8 → kssdtree-1.1.9}/matrix.c +0 -0
  55. {kssdtree-1.1.8 → kssdtree-1.1.9}/mman.c +0 -0
  56. {kssdtree-1.1.8 → kssdtree-1.1.9}/mytime.c +0 -0
  57. {kssdtree-1.1.8 → kssdtree-1.1.9}/nj.c +0 -0
  58. {kssdtree-1.1.8 → kssdtree-1.1.9}/njheaders/align.h +0 -0
  59. {kssdtree-1.1.8 → kssdtree-1.1.9}/njheaders/buildtree.h +0 -0
  60. {kssdtree-1.1.8 → kssdtree-1.1.9}/njheaders/cluster.h +0 -0
  61. {kssdtree-1.1.8 → kssdtree-1.1.9}/njheaders/distancemat.h +0 -0
  62. {kssdtree-1.1.8 → kssdtree-1.1.9}/njheaders/sequence.h +0 -0
  63. {kssdtree-1.1.8 → kssdtree-1.1.9}/njheaders/tree.h +0 -0
  64. {kssdtree-1.1.8 → kssdtree-1.1.9}/njheaders/util.h +0 -0
  65. {kssdtree-1.1.8 → kssdtree-1.1.9}/nwck.c +0 -0
  66. {kssdtree-1.1.8 → kssdtree-1.1.9}/pherror.c +0 -0
  67. {kssdtree-1.1.8 → kssdtree-1.1.9}/phy.c +0 -0
  68. {kssdtree-1.1.8 → kssdtree-1.1.9}/pydnj.c +0 -0
  69. {kssdtree-1.1.8 → kssdtree-1.1.9}/pykssd.c +0 -0
  70. {kssdtree-1.1.8 → kssdtree-1.1.9}/pynj.c +0 -0
  71. {kssdtree-1.1.8 → kssdtree-1.1.9}/qseqs.c +0 -0
  72. {kssdtree-1.1.8 → kssdtree-1.1.9}/sequence.c +0 -0
  73. {kssdtree-1.1.8 → kssdtree-1.1.9}/setup.cfg +0 -0
  74. {kssdtree-1.1.8 → kssdtree-1.1.9}/str.c +0 -0
  75. {kssdtree-1.1.8 → kssdtree-1.1.9}/tmp.c +0 -0
  76. {kssdtree-1.1.8 → kssdtree-1.1.9}/tree.c +0 -0
  77. {kssdtree-1.1.8 → kssdtree-1.1.9}/util.c +0 -0
  78. {kssdtree-1.1.8 → kssdtree-1.1.9}/vector.c +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kssdtree
3
- Version: 1.1.8
3
+ Version: 1.1.9
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
6
  Download-URL: https://pypi.org/project/kssdtree
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kssdtree
3
- Version: 1.1.8
3
+ Version: 1.1.9
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
6
  Download-URL: https://pypi.org/project/kssdtree
@@ -270,9 +270,17 @@ def quick(shuf_file=None, genome_files=None, output=None, reference=None, taxono
270
270
  if reference is None and taxonomy is None:
271
271
  if shuf_file is not None and genome_files is not None and output is not None:
272
272
  timeStamp = int(time.mktime(time.localtime(time.time())))
273
- temp_sketch = genome_files + '_sketch_' + str(timeStamp)
274
- temp_phy = 'temp.phy'
273
+ temp_sketch = toolutils.rs() + '_sketch_' + str(timeStamp)
274
+ temp_phy = toolutils.rs() + '_temp.phy'
275
275
  print('Step1...')
276
+ if not toolutils.allowed_file(genome_files):
277
+ num = toolutils.get_file_num(genome_files)
278
+ if num == 1:
279
+ print('genome_files is a folder containing at least two . fasta or .fastq files!!!')
280
+ return False
281
+ else:
282
+ print('genome_files is a folder containing at least two . fasta or .fastq files, not a file!!!')
283
+ return False
276
284
  s1 = sketch(shuf_file=shuf_file, genome_files=genome_files, output=temp_sketch, set_opt=False)
277
285
  if not s1:
278
286
  return False
@@ -301,7 +309,7 @@ def quick(shuf_file=None, genome_files=None, output=None, reference=None, taxono
301
309
  if os.path.exists(temp_phy):
302
310
  os.remove(temp_phy)
303
311
  else:
304
- print('Args error!!!')
312
+ print('Args error, please see https://kssdtree.readthedocs.io/en/latest!!!')
305
313
  return False
306
314
 
307
315
  elif reference == 'gtdbr214_sketch' and taxonomy is None:
@@ -310,10 +318,10 @@ def quick(shuf_file=None, genome_files=None, output=None, reference=None, taxono
310
318
  print("N must >0 !!!")
311
319
  return False
312
320
  if shuf_file != 'L3K9.shuf':
313
- print("shuffle file must be set to 'L3K9.shuf'")
321
+ print("shuf_file must be set to 'L3K9.shuf'")
314
322
  return False
315
323
  timeStamp = int(time.mktime(time.localtime(time.time())))
316
- qry_sketch = 'sketch_' + str(timeStamp)
324
+ qry_sketch = toolutils.rs() + '_sketch_' + str(timeStamp)
317
325
  s1 = sketch(shuf_file=shuf_file, genome_files=genome_files, output=qry_sketch, set_opt=True)
318
326
  if not s1:
319
327
  return False
@@ -332,26 +340,34 @@ def quick(shuf_file=None, genome_files=None, output=None, reference=None, taxono
332
340
  if os.path.exists(temp_dir2):
333
341
  os.remove(temp_dir2)
334
342
  else:
335
- print('Args error!!!')
343
+ print('Args error, please see https://kssdtree.readthedocs.io/en/latest!!!')
336
344
  return False
337
345
  else:
338
346
  if shuf_file is not None and genome_files is not None and output is not None and method in ['nj', 'dnj']:
339
347
  if shuf_file is not None and genome_files is not None and output is not None and method in ['nj', 'dnj']:
348
+ if not toolutils.allowed_file(genome_files):
349
+ num = toolutils.get_file_num(genome_files)
350
+ if num == 1:
351
+ print('genome_files is a folder containing at least two . fasta or .fastq files!!!')
352
+ return False
353
+ else:
354
+ print('genome_files is a folder containing at least two . fasta or .fastq files, not a file!!!')
355
+ return False
340
356
  timeStamp = int(time.mktime(time.localtime(time.time())))
341
- temp_reference_sketch = 'ref_sketch_' + str(timeStamp)
342
- temp_genomes_sketch = genome_files + '_sketch_' + str(timeStamp)
357
+ temp_reference_sketch = toolutils.rs() + '_ref_sketch_' + str(timeStamp)
358
+ temp_genomes_sketch = toolutils.rs() + '_sketch_' + str(timeStamp)
343
359
  if not toolutils.allowed_file(reference):
344
- cur_path = os.getcwd()
345
- ref_path = os.path.join(cur_path, reference)
346
- num = toolutils.get_file_num(ref_path)
360
+ # cur_path = os.getcwd()
361
+ # ref_path = os.path.join(cur_path, reference)
362
+ num = toolutils.get_file_num(reference)
347
363
  if num == 1:
348
364
  temp_union_sketch = temp_reference_sketch
349
365
  else:
350
- temp_union_sketch = 'ref_union_sketch_' + str(timeStamp)
366
+ temp_union_sketch = toolutils.rs() + '_ref_union_sketch_' + str(timeStamp)
351
367
  else:
352
368
  temp_union_sketch = temp_reference_sketch
353
- temp_subtract_sketch = genome_files + '_subtract_sketch_' + str(timeStamp)
354
- temp_phy = 'temp.phy'
369
+ temp_subtract_sketch = toolutils.rs() + '_subtract_sketch_' + str(timeStamp)
370
+ temp_phy = toolutils.rs() +'_temp.phy'
355
371
  print('Step1...')
356
372
  s1 = sketch(shuf_file=shuf_file, genome_files=reference, output=temp_reference_sketch, set_opt=True)
357
373
  if not s1:
@@ -403,5 +419,5 @@ def quick(shuf_file=None, genome_files=None, output=None, reference=None, taxono
403
419
  if os.path.exists(temp_phy):
404
420
  os.remove(temp_phy)
405
421
  else:
406
- print('Args error!!!')
422
+ print('Args error, please see https://kssdtree.readthedocs.io/en/latest!!!')
407
423
  return False
@@ -90,7 +90,7 @@ require_pakages = [
90
90
 
91
91
  setup(
92
92
  name='kssdtree',
93
- version='1.1.8',
93
+ version='1.1.9',
94
94
  author='Hang Yang',
95
95
  author_email='yhlink1207@gmail.com',
96
96
  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. ",
@@ -5,12 +5,18 @@ import requests
5
5
  import json
6
6
  import zipfile
7
7
  import pandas as pd
8
-
8
+ import string
9
9
 
10
10
  def allowed_file(filename):
11
11
  allowed_extensions = ['.fa', '.fa.gz', '.fasta', '.fasta.gz', '.fna', '.fna.gz', '.fastq', '.fastq.gz']
12
12
  return any(filename.endswith(ext) for ext in allowed_extensions)
13
13
 
14
+ def rs():
15
+ letters = string.ascii_lowercase
16
+ numbers = string.digits
17
+ random_letters = ''.join(random.choice(letters) for i in range(6))
18
+ random_numbers = ''.join(random.choice(numbers) for i in range(3))
19
+ return random_letters + random_numbers
14
20
 
15
21
  def is_positive_integer(num):
16
22
  if isinstance(num, int) and num > 0:
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