tabtk 1.0.1__tar.gz → 1.0.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tabtk
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: tabtk: A toolkit for sequence similarity analysis based on tabular data
5
5
  Author-email: Chrispin Chaguza <chrispin.chaguza@gmail.com>
6
6
  Maintainer-email: Chrispin Chaguza <chrispin.chaguza@gmail.com>
@@ -1,4 +1,4 @@
1
1
  """tabkit: A toolkit for sequence similarity analysis based on tabular data"""
2
2
 
3
- __version__ = "1.0.1"
3
+ __version__ = "1.0.2"
4
4
 
@@ -57,7 +57,7 @@ def pairwiseSimilarity(firstRecord,secondRecord):
57
57
  return(similarityData)
58
58
 
59
59
 
60
- def alignmentSimilarity(ij):
60
+ def alignmentSimilarity(i,j):
61
61
  seqMatch=0
62
62
  seqMisMatch=0
63
63
 
@@ -89,6 +89,11 @@ def mashSimilarity(cmdValues):
89
89
  else:
90
90
  pass
91
91
 
92
+ if int(cmdValues["length"])>=16:
93
+ print("Note: use shorter k-mers ≤16 when working diverse sequences")
94
+ else:
95
+ pass
96
+
92
97
  tmpOut = f"mash.{str(datetime.datetime.now()).replace(" ","").replace("-",".").replace(":",".")}"
93
98
  tmpOutR = f"mash.{str(datetime.datetime.now()).replace(" ","").replace("-",".").replace(":",".")}"
94
99
 
@@ -168,7 +173,7 @@ def blastSimilarity(cmdValues):
168
173
  tmpOut2 = f"blast.{str(datetime.datetime.now()).replace(" ","").replace("-",".").replace(":",".")}"
169
174
 
170
175
  blastCmd1 = f"echo \'qseqid sseqid length pident qcovs\' | tr \' \' \'\\t\' > {tmpOut2}"
171
- blastCmd2 = f"blastn -db {tmpOut} -query {tmpOut} -num_threads {cmdValues["threads"]} -outfmt \'6 qseqid sseqid length pident qcovs\' -evalue 0.001 >> {tmpOut2}"
176
+ blastCmd2 = f"blastn -db {tmpOut} -query {tmpOut} -word_size {cmdValues["length"]} -num_threads {cmdValues["threads"]} -outfmt \'6 qseqid sseqid length pident qcovs\' -evalue 0.001 >> {tmpOut2}"
172
177
 
173
178
  subprocess.call(blastCmd1,shell=True,stdout=subprocess.DEVNULL,stderr=subprocess.STDOUT)
174
179
  subprocess.call(blastCmd2,shell=True,stdout=subprocess.DEVNULL,stderr=subprocess.STDOUT)
@@ -225,6 +230,11 @@ def fastaniSimilarity(cmdValues):
225
230
  else:
226
231
  pass
227
232
 
233
+ if int(cmdValues["length"])>=16:
234
+ print("Note: use shorter k-mers ≤16 when working diverse sequences")
235
+ else:
236
+ pass
237
+
228
238
  tmpOut = f"mash.{str(datetime.datetime.now()).replace(" ","").replace("-",".").replace(":",".")}"
229
239
 
230
240
  fastaniCmd = f"fastANI --rl {cmdValues["data"]} --ql {cmdValues["data"]} -k {cmdValues["length"]} --matrix --fragLen {cmdValues["fragment"]} --minFraction {cmdValues["fraction"]} --output {tmpOut} -t {cmdValues["threads"]}"
@@ -237,11 +247,8 @@ def fastaniSimilarity(cmdValues):
237
247
 
238
248
  with open(tmpOut,"r") as fastaniFile:
239
249
  for itemPos,fastaniOutput in enumerate(fastaniFile):
240
- if itemPos == 0:
241
- pass
242
- else:
243
- item = fastaniOutput.strip().split("\t")
244
- fastaniResults.append(f"{Path(item[0]).stem}\t{Path(item[1]).stem}\t{float(item[2])}")
250
+ item = fastaniOutput.strip().split("\t")
251
+ fastaniResults.append(f"{Path(item[0]).stem}\t{Path(item[1]).stem}\t{float(item[2])}")
245
252
 
246
253
  if os.path.exists(tmpOut):
247
254
  os.remove(tmpOut)
@@ -1210,7 +1217,7 @@ def table(cmdValues):
1210
1217
  args = [(seqFileNum,seqFileName,kmersFile,cmdValues) for seqFileNum,seqFileName in seqFileDF]
1211
1218
  kmerResults = pool.starmap(queryKmers, args)
1212
1219
 
1213
- with open(f"{Path(cmdValues["output"]).stem}.table.tsv","w") as kmerData:
1220
+ with open(f"{cmdValues["output"]}","w") as kmerData:
1214
1221
  kmerFiles = []
1215
1222
  kmerHeaderFiles = []
1216
1223
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tabtk
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: tabtk: A toolkit for sequence similarity analysis based on tabular data
5
5
  Author-email: Chrispin Chaguza <chrispin.chaguza@gmail.com>
6
6
  Maintainer-email: Chrispin Chaguza <chrispin.chaguza@gmail.com>
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes