wwpdb.apps.seqmodule 0.27.0__tar.gz → 0.27.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.
Files changed (73) hide show
  1. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/PKG-INFO +1 -1
  2. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/__init__.py +1 -1
  3. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/control/SequenceDataAssemble_v2.py +1 -1
  4. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/io/FetchSeqInfoUtils.py +84 -47
  5. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/update/UpdatePolymerEntityPartitions.py +0 -1
  6. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/util/FetchReferenceSequenceUtils.py +17 -23
  7. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb.apps.seqmodule.egg-info/PKG-INFO +1 -1
  8. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/README.md +0 -0
  9. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/setup.cfg +0 -0
  10. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/setup.py +0 -0
  11. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/__init__.py +0 -0
  12. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/__init__.py +0 -0
  13. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/align/AlignmentBackEndEditingTools.py +0 -0
  14. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/align/AlignmentDepictionTools.py +0 -0
  15. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/align/AlignmentExport.py +0 -0
  16. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/align/AlignmentFrontEndUIEditor.py +0 -0
  17. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/align/AlignmentStatistics.py +0 -0
  18. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/align/AlignmentStatisticsTests.py +0 -0
  19. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/align/AlignmentToolUtils.py +0 -0
  20. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/align/AlignmentTools.py +0 -0
  21. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/align/__init__.py +0 -0
  22. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/control/DataImporter.py +0 -0
  23. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/control/SequenceDataAssembleExample.py +0 -0
  24. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/control/SequenceDataAssembleTests.py +0 -0
  25. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/control/SequenceDataPrepTests.py +0 -0
  26. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/control/SummaryViewDepiction.py +0 -0
  27. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/control/SummaryViewTests.py +0 -0
  28. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/control/SummaryView_v2.py +0 -0
  29. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/control/__init__.py +0 -0
  30. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/io/AlignmentDataStore.py +0 -0
  31. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/io/BlastPlusReader.py +0 -0
  32. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/io/ModelSequenceUtils.py +0 -0
  33. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/io/ModelSequenceUtilsTests.py +0 -0
  34. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/io/PdbxIoUtils.py +0 -0
  35. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/io/SequenceDataExportTests.py +0 -0
  36. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/io/SequenceDataExport_v2.py +0 -0
  37. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/io/SequenceDataStore.py +0 -0
  38. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/io/SequenceDataStoreTests.py +0 -0
  39. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/io/SequenceEditStore.py +0 -0
  40. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/io/SequenceEditStoreTests.py +0 -0
  41. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/io/TaxonomyDbUtils.py +0 -0
  42. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/io/TaxonomyUtils.py +0 -0
  43. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/io/TaxonomyUtilsTests.py +0 -0
  44. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/io/__init__.py +0 -0
  45. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/io/testAuto.py +0 -0
  46. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/link/PolymerLinkageDepict.py +0 -0
  47. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/link/__init__.py +0 -0
  48. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/update/UpdatePolymerEntityReference_v2.py +0 -0
  49. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/update/UpdatePolymerEntitySourceDetails.py +0 -0
  50. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/update/__init__.py +0 -0
  51. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/util/Autodict.py +0 -0
  52. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/util/GetSameSeqAnnotationWithTaxIdOnly.py +0 -0
  53. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/util/LocalBlastSearchUtils.py +0 -0
  54. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/util/MultiProcLimit.py +0 -0
  55. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/util/SearchEntityPolySeqs.py +0 -0
  56. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/util/SeqReferenceSearchUtils.py +0 -0
  57. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/util/SequenceAssign.py +0 -0
  58. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/util/SequenceExamples.py +0 -0
  59. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/util/SequenceFeatureDepict.py +0 -0
  60. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/util/SequenceLabel.py +0 -0
  61. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/util/SequenceReferenceData.py +0 -0
  62. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/util/UpdateSequenceDataStoreUtils.py +0 -0
  63. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/util/__init__.py +0 -0
  64. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/view3d/ModelViewer3D.py +0 -0
  65. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/view3d/__init__.py +0 -0
  66. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/webapp/SeqModWebApp_v2.py +0 -0
  67. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/webapp/SeqModWebRequest.py +0 -0
  68. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb/apps/seqmodule/webapp/__init__.py +0 -0
  69. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb.apps.seqmodule.egg-info/SOURCES.txt +0 -0
  70. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb.apps.seqmodule.egg-info/dependency_links.txt +0 -0
  71. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb.apps.seqmodule.egg-info/not-zip-safe +0 -0
  72. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb.apps.seqmodule.egg-info/requires.txt +0 -0
  73. {wwpdb.apps.seqmodule-0.27.0 → wwpdb_apps_seqmodule-0.27.2}/wwpdb.apps.seqmodule.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wwpdb.apps.seqmodule
3
- Version: 0.27.0
3
+ Version: 0.27.2
4
4
  Summary: wwPDB sequence module
5
5
  Home-page: https://github.com/wwPDB/py-wwpdb_apps_seqmodule
6
6
  Author: Ezra Peisach
@@ -2,4 +2,4 @@ __docformat__ = "restructuredtext en"
2
2
  __author__ = "Ezra Peisach"
3
3
  __email__ = "ezra.peisach@rcsb.org"
4
4
  __license__ = "Apache 2.0"
5
- __version__ = "0.27.0"
5
+ __version__ = "0.27.2"
@@ -114,7 +114,7 @@ class SequenceDataAssemble(UpdateSequenceDataStoreUtils):
114
114
  #
115
115
  if self._verbose:
116
116
  self._lfh.write("\n+SequenceDataAssemble.doAssemble() STARTING with depId %r calPolyLink %r doRefSearch %r doAutoProcess %r\n" %
117
- (self.__dataSetId, calPolyLink, doRefSearch, doAutoProcess))
117
+ (self.__dataSetId, calPolyLink, doRefSearch, doAutoProcess))
118
118
  #
119
119
  pdbxFilePath = self.__pI.getModelPdbxFilePath(self.__dataSetId, fileSource="session", versionId="1")
120
120
  polyLinkPath = self.__pI.getFilePath(self.__dataSetId, contentType="polymer-linkage-distances", formatType="json", fileSource="session")
@@ -21,6 +21,7 @@
21
21
  # 29-Sep-2022 zf Added input 'begin' & 'end' values checking from idTupleList in fetchUniProt() method.
22
22
  # 11-Nov-2022 zf Create FetchSeqInfoUtils class with fetchUniProt(), fetchNcbiGi(), fetchNcbiSummary(), and getRefInfo() methods.
23
23
  # getRefInfo() method is moved from FetchReferenceSequenceUtils.__getRefInfo() method.
24
+ # 2-Jun-2024 zf Added persistent objects self.__resultDicts & self.__multiResultDicts. Fixed the bug related to missing start & end sequence numbers.
24
25
  ##
25
26
  """
26
27
  Utility methods to retrieve information from NCBI & Uniprot databases
@@ -54,6 +55,8 @@ class FetchSeqInfoUtils(object):
54
55
  if not self.__srd:
55
56
  self.__srd = SequenceReferenceData(self.__verbose, self.__lfh)
56
57
  #
58
+ self.__resultDicts = {}
59
+ self.__multiResultDicts = {}
57
60
 
58
61
  def getRefInfo(self, dbName, dbAccession, dbIsoform, start, end, addMissingKeyFlag=True):
59
62
  """Fetch sequence data from Uniprot or GeneBank database.
@@ -115,54 +118,72 @@ class FetchSeqInfoUtils(object):
115
118
  """
116
119
  if idTupleList is None:
117
120
  idTupleList = []
121
+ #
118
122
  d = {}
119
123
  if not idTupleList:
120
124
  return d
121
125
  #
122
126
  idCodeList = []
127
+ foundCache = False
123
128
  for idTuple in idTupleList:
129
+ if idTuple[0] in self.__resultDicts:
130
+ foundCache = True
131
+ continue
132
+ #
124
133
  if idTuple[0] not in idCodeList:
125
134
  idCodeList.append(idTuple[0])
126
135
  #
127
136
  #
128
- if not idCodeList:
137
+ if (not foundCache) and (not idCodeList):
129
138
  return d
130
139
  #
131
- fobj = FetchUnpXml(verbose=self.__verbose, log=self.__lfh)
132
- ok = fobj.fetchList(idCodeList)
133
- if filePath is not None:
134
- fobj.writeUnpXml(filePath)
140
+ self.__fetchUniProtXmlFile(idCodeList, filePath)
135
141
  #
136
- if ok:
137
- resultDicts = fobj.getResult()
138
- multiResultDicts = fobj.getMultipleResultDict()
139
- # filter any redundant annotations --
142
+ # filter any redundant annotations --
143
+ #
144
+ for idTuple in idTupleList:
145
+ if idTuple[0] not in self.__resultDicts:
146
+ continue
140
147
  #
141
- for idTuple in idTupleList:
142
- if idTuple[0] not in resultDicts:
143
- continue
148
+ vd = self.__resultDicts[idTuple[0]]
149
+ seqLength = 0
150
+ if ("sequence" in vd) and vd["sequence"] and (len(vd["sequence"]) > 1):
151
+ seqLength = len(vd["sequence"])
152
+ #
153
+ if (idTuple[0] in self.__multiResultDicts) and self.__multiResultDicts[idTuple[0]]:
154
+ try:
155
+ idTuple1 = int(idTuple[1])
156
+ except: # noqa: E722 pylint: disable=bare-except
157
+ idTuple1 = 0
158
+ #
159
+ try:
160
+ idTuple2 = int(idTuple[2])
161
+ except: # noqa: E722 pylint: disable=bare-except
162
+ idTuple2 = 0
144
163
  #
145
- vd = resultDicts[idTuple[0]]
164
+ if ((idTuple1 == 0) or (idTuple2 == 0)) and (seqLength > 1):
165
+ idTuple1 = 1
166
+ idTuple2 = seqLength
146
167
  #
147
- if (idTuple[0] in multiResultDicts) and multiResultDicts[idTuple[0]]:
148
- found = False
168
+ found = False
169
+ if (idTuple1 > 0) and (idTuple2 > 0) and (idTuple1 <= idTuple2):
149
170
  diff = -1
150
- for retD in multiResultDicts[idTuple[0]]:
151
- if ("begin" not in retD) or ("end" not in retD) or (idTuple[1] and (idTuple[1] < retD["begin"])) or \
152
- (idTuple[2] and (idTuple[2] > retD["end"])):
171
+ for retD in self.__multiResultDicts[idTuple[0]]:
172
+ if ("begin" not in retD) or ("end" not in retD) or (idTuple1 and (idTuple1 < retD["begin"])) or \
173
+ (idTuple2 and (idTuple2 > retD["end"])):
153
174
  continue
154
175
  #
155
176
  if diff == -1:
156
177
  found = True
157
178
  vd = retD
158
179
  try:
159
- diff = (int(idTuple[1]) - int(retD["begin"])) + (int(retD["end"]) - int(idTuple[2]))
180
+ diff = (int(idTuple1) - int(retD["begin"])) + (int(retD["end"]) - int(idTuple2))
160
181
  except: # noqa: E722 pylint: disable=bare-except
161
182
  pass
162
183
  #
163
184
  else:
164
185
  try:
165
- diff1 = (int(idTuple[1]) - int(retD["begin"])) + (int(retD["end"]) - int(idTuple[2]))
186
+ diff1 = (int(idTuple1) - int(retD["begin"])) + (int(retD["end"]) - int(idTuple2))
166
187
  if diff1 < diff:
167
188
  diff = diff1
168
189
  vd = retD
@@ -172,40 +193,40 @@ class FetchSeqInfoUtils(object):
172
193
  #
173
194
  #
174
195
  #
175
- if (not found) and ("all" in multiResultDicts[idTuple[0]][-1]) and (multiResultDicts[idTuple[0]][-1]["all"] == "yes"):
176
- vd = multiResultDicts[idTuple[0]][-1]
177
- #
178
196
  #
179
- for k in vd.keys():
180
- if k in ["ec", "comments", "synonyms"]:
181
- v = vd[k]
182
- oL = []
183
- tL = v.split(",")
184
- for it in tL:
185
- sV = str(it).strip()
186
- if k == "ec":
187
- sVL = sV.split(".")
188
- oL1 = []
189
- for s1 in sVL:
190
- if str(s1).startswith("n"):
191
- oL1.append("-")
192
- else:
193
- oL1.append(s1)
194
- #
197
+ if (not found) and ("all" in self.__multiResultDicts[idTuple[0]][-1]) and (self.__multiResultDicts[idTuple[0]][-1]["all"] == "yes"):
198
+ vd = self.__multiResultDicts[idTuple[0]][-1]
199
+ #
200
+ #
201
+ for k in vd.keys():
202
+ if k in ["ec", "comments", "synonyms"]:
203
+ v = vd[k]
204
+ oL = []
205
+ tL = v.split(",")
206
+ for it in tL:
207
+ sV = str(it).strip()
208
+ if k == "ec":
209
+ sVL = sV.split(".")
210
+ oL1 = []
211
+ for s1 in sVL:
212
+ if str(s1).startswith("n"):
213
+ oL1.append("-")
214
+ else:
215
+ oL1.append(s1)
195
216
  #
196
- sV = ".".join(oL1)
197
- #
198
- if sV in oL:
199
- continue
200
- else:
201
- oL.append(sV)
202
217
  #
218
+ sV = ".".join(oL1)
219
+ #
220
+ if sV in oL:
221
+ continue
222
+ else:
223
+ oL.append(sV)
203
224
  #
204
- vd[k] = ",".join(oL)
205
225
  #
226
+ vd[k] = ",".join(oL)
206
227
  #
207
- d[idTuple] = vd
208
228
  #
229
+ d[idTuple] = vd
209
230
  #
210
231
  return d
211
232
 
@@ -255,3 +276,19 @@ class FetchSeqInfoUtils(object):
255
276
  #
256
277
  #
257
278
  return myD
279
+
280
+ def __fetchUniProtXmlFile(self, idCodeList=[], filePath=None):
281
+ """ Fetch Uniprot Xml File
282
+ """
283
+ if not idCodeList:
284
+ return;
285
+ #
286
+ fobj = FetchUnpXml(verbose=self.__verbose, log=self.__lfh)
287
+ ok = fobj.fetchList(idCodeList)
288
+ if filePath is not None:
289
+ fobj.writeUnpXml(filePath)
290
+ #
291
+ if ok:
292
+ self.__resultDicts.update(fobj.getResult())
293
+ self.__multiResultDicts.update(fobj.getMultipleResultDict())
294
+ #
@@ -375,7 +375,6 @@ class UpdatePolymerEntityPartitions(object):
375
375
  dbIsoform = dbAccession
376
376
  dbAcc = tL[0]
377
377
  #
378
- fetchUtil.reset()
379
378
  fetchErr, refFeatureDict, _refSeqList = fetchUtil.fetchReferenceSequence("UNP", dbAcc, dbIsoform, polyTypeCode="AA",
380
379
  refSeqBeg=dbSeqBegin, refSeqEnd=dbSeqEnd)
381
380
  #
@@ -6,7 +6,7 @@
6
6
  # 3-Oct-2022 zf update fetchReferenceSequenceWithSeqMatch() methods for better handling author provided reference sequence cases.
7
7
  # add runSeqAlignment() & __toList() methods
8
8
  # 11-Nov-2022 zf move __getRefInfo() method to FetchSeqInfoUtils class.
9
- # 6-Jan-2024 zf add reset() method
9
+ # 2-Jun-2024 zf add persistent object self.__fetchSeqUtil.
10
10
  ##
11
11
  """
12
12
  Methods to get reference sequence data from reference database based database name and identifier.
@@ -40,27 +40,22 @@ class FetchReferenceSequenceUtils(object):
40
40
  self.__accCode = ""
41
41
  self.__refInfoD = {}
42
42
  #
43
- self.reset()
44
-
45
- def reset(self):
46
- self.__accCode = ""
47
- self.__refInfoD = {}
43
+ self.__fetchSeqUtil = FetchSeqInfoUtils(siteId=self.__siteId, seqReferenceData=self.__srd, verbose=self.__verbose, log=self.__lfh)
48
44
 
49
45
  def fetchReferenceSequence(self, dbName, dbAccession, dbIsoform, polyTypeCode="AA", refSeqBeg=None, refSeqEnd=None):
50
- """return error message, sequence feature dictionary, sequence list"""
51
- if not self.__refInfoD:
52
- try:
53
- start = int(str(refSeqBeg))
54
- except: # noqa: E722 pylint: disable=bare-except
55
- start = 0
56
- #
57
- try:
58
- end = int(str(refSeqEnd))
59
- except: # noqa: E722 pylint: disable=bare-except
60
- end = 0
61
- #
62
- fetchSeqUtil = FetchSeqInfoUtils(siteId=self.__siteId, seqReferenceData=self.__srd, verbose=self.__verbose, log=self.__lfh)
63
- self.__accCode, self.__refInfoD = fetchSeqUtil.getRefInfo(dbName, dbAccession, dbIsoform, start, end)
46
+ """return error message, sequence feature dictionary, sequence list
47
+ """
48
+ try:
49
+ start = int(str(refSeqBeg))
50
+ except: # noqa: E722 pylint: disable=bare-except
51
+ start = 0
52
+ #
53
+ try:
54
+ end = int(str(refSeqEnd))
55
+ except: # noqa: E722 pylint: disable=bare-except
56
+ end = 0
57
+ #
58
+ self.__accCode, self.__refInfoD = self.__fetchSeqUtil.getRefInfo(dbName, dbAccession, dbIsoform, start, end)
64
59
  #
65
60
  if (not self.__refInfoD) or ("sequence" not in self.__refInfoD):
66
61
  error = "Fetch reference sequence [ dbName=" + dbName + ", Accession=" + self.__accCode + "] failed."
@@ -137,12 +132,11 @@ class FetchReferenceSequenceUtils(object):
137
132
  dbAccession = tL[0]
138
133
  #
139
134
  #
140
- fetchSeqUtil = FetchSeqInfoUtils(siteId=self.__siteId, seqReferenceData=self.__srd, verbose=self.__verbose, log=self.__lfh)
141
- self.__accCode, self.__refInfoD = fetchSeqUtil.getRefInfo(dbName, dbAccession, dbIsoform, 0, 0)
135
+ self.__accCode, self.__refInfoD = self.__fetchSeqUtil.getRefInfo(dbName, dbAccession, dbIsoform, 0, 0)
142
136
  #
143
137
  if (not self.__refInfoD) or ("sequence" not in self.__refInfoD) or (not self.__refInfoD["sequence"]):
144
138
  if dbCode:
145
- self.__accCode, self.__refInfoD = fetchSeqUtil.getRefInfo(dbName, dbCode, "", 0, 0)
139
+ self.__accCode, self.__refInfoD = self.__fetchSeqUtil.getRefInfo(dbName, dbCode, "", 0, 0)
146
140
  if (not self.__refInfoD) or ("sequence" not in self.__refInfoD) or (not self.__refInfoD["sequence"]):
147
141
  return False, {}
148
142
  #
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wwpdb.apps.seqmodule
3
- Version: 0.27.0
3
+ Version: 0.27.2
4
4
  Summary: wwPDB sequence module
5
5
  Home-page: https://github.com/wwPDB/py-wwpdb_apps_seqmodule
6
6
  Author: Ezra Peisach