rcsb.workflow 0.45__tar.gz → 0.47__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 (23) hide show
  1. {rcsb_workflow-0.45 → rcsb_workflow-0.47}/HISTORY.txt +3 -0
  2. {rcsb_workflow-0.45/rcsb.workflow.egg-info → rcsb_workflow-0.47}/PKG-INFO +6 -5
  3. {rcsb_workflow-0.45 → rcsb_workflow-0.47}/rcsb/workflow/chem/__init__.py +1 -1
  4. {rcsb_workflow-0.45 → rcsb_workflow-0.47}/rcsb/workflow/targets/ProteinTargetSequenceExecutionWorkflow.py +98 -8
  5. {rcsb_workflow-0.45 → rcsb_workflow-0.47}/rcsb/workflow/targets/ProteinTargetSequenceWorkflow.py +13 -4
  6. {rcsb_workflow-0.45 → rcsb_workflow-0.47/rcsb.workflow.egg-info}/PKG-INFO +6 -5
  7. {rcsb_workflow-0.45 → rcsb_workflow-0.47}/rcsb.workflow.egg-info/requires.txt +3 -3
  8. {rcsb_workflow-0.45 → rcsb_workflow-0.47}/requirements.txt +3 -3
  9. {rcsb_workflow-0.45 → rcsb_workflow-0.47}/setup.py +2 -1
  10. {rcsb_workflow-0.45 → rcsb_workflow-0.47}/LICENSE +0 -0
  11. {rcsb_workflow-0.45 → rcsb_workflow-0.47}/MANIFEST.in +0 -0
  12. {rcsb_workflow-0.45 → rcsb_workflow-0.47}/README.md +0 -0
  13. {rcsb_workflow-0.45 → rcsb_workflow-0.47}/rcsb/__init__.py +0 -0
  14. {rcsb_workflow-0.45 → rcsb_workflow-0.47}/rcsb/workflow/__init__.py +0 -0
  15. {rcsb_workflow-0.45 → rcsb_workflow-0.47}/rcsb/workflow/chem/ChemCompFileWorkflow.py +0 -0
  16. {rcsb_workflow-0.45 → rcsb_workflow-0.47}/rcsb/workflow/chem/ChemCompImageWorkflow.py +0 -0
  17. {rcsb_workflow-0.45 → rcsb_workflow-0.47}/rcsb/workflow/chem/ChemCompSearchIndexWorkflow.py +0 -0
  18. {rcsb_workflow-0.45 → rcsb_workflow-0.47}/rcsb/workflow/targets/__init__.py +0 -0
  19. {rcsb_workflow-0.45 → rcsb_workflow-0.47}/rcsb.workflow.egg-info/SOURCES.txt +0 -0
  20. {rcsb_workflow-0.45 → rcsb_workflow-0.47}/rcsb.workflow.egg-info/dependency_links.txt +0 -0
  21. {rcsb_workflow-0.45 → rcsb_workflow-0.47}/rcsb.workflow.egg-info/not-zip-safe +0 -0
  22. {rcsb_workflow-0.45 → rcsb_workflow-0.47}/rcsb.workflow.egg-info/top_level.txt +0 -0
  23. {rcsb_workflow-0.45 → rcsb_workflow-0.47}/setup.cfg +0 -0
@@ -37,3 +37,6 @@
37
37
  21-May-2024 - V0.43 Fix pylinting
38
38
  20-Aug-2024 - V0.44 Add step for loading target cofactor data to MongoDB
39
39
  27-Aug-2024 - V0.45 Update usage of CARDTargetOntologyProvider
40
+ 22-Oct-2024 - V0.46 Update requirements and CI/CD (to use python 3.10)
41
+ 10-Dec-2024 - V0.47 Add support for 'max-seqs' flag in mmseqs database search;
42
+ Update Azure pipelines to run on latest macOS and ubuntu version
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rcsb.workflow
3
- Version: 0.45
3
+ Version: 0.47
4
4
  Summary: RCSB Python data processing and ETL/ELT workflow entry points
5
5
  Home-page: https://github.com/rcsb/py-rcsb_workflow
6
6
  Author: John Westbrook
@@ -12,15 +12,16 @@ Classifier: Natural Language :: English
12
12
  Classifier: License :: OSI Approved :: Apache Software License
13
13
  Classifier: Programming Language :: Python
14
14
  Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
16
17
  Description-Content-Type: text/markdown
17
18
  License-File: LICENSE
18
- Requires-Dist: OpenEye-toolkits>=2020.2.2
19
+ Requires-Dist: OpenEye-toolkits>=2024.1.1
19
20
  Requires-Dist: rcsb.utils.chem>=0.79
20
21
  Requires-Dist: rcsb.utils.seq>=0.82
21
22
  Requires-Dist: rcsb.utils.targets>=0.82
22
- Requires-Dist: rcsb.utils.seqalign>=0.29
23
- Requires-Dist: rcsb.exdb>=1.23
23
+ Requires-Dist: rcsb.utils.seqalign>=0.31
24
+ Requires-Dist: rcsb.exdb>=1.25
24
25
  Requires-Dist: rcsb.utils.io>=1.48
25
26
  Provides-Extra: dev
26
27
  Requires-Dist: check-manifest; extra == "dev"
@@ -2,4 +2,4 @@ __docformat__ = "google en"
2
2
  __author__ = "John Westbrook"
3
3
  __email__ = "john.westbrook@rcsb.org"
4
4
  __license__ = "Apache 2.0"
5
- __version__ = "0.45"
5
+ __version__ = "0.47"
@@ -8,6 +8,7 @@
8
8
  # 21-Mar-2023 Allow backing up Pharos-targets to stash, more __init__ improvement
9
9
  # 5-May-2023 Pass in fromDbPharos and reloadPharos parameters to exportFasta()
10
10
  # 12-Jun-2023 dwp Set useTaxonomy filter to False for CARD annotations
11
+ # 10-Dec-2024 dwp Specify 'max-seqs' for mmseqs search to override default value
11
12
  ##
12
13
  """
13
14
  Execution workflow for protein target data ETL operations.
@@ -103,7 +104,9 @@ class ProteinTargetSequenceExecutionWorkflow(object):
103
104
  return ok
104
105
 
105
106
  def fetchProteinEntityData(self):
106
- """Export RCSB protein entity sequence FASTA, taxonomy, and sequence details"""
107
+ """Export RCSB protein entity sequence FASTA, taxonomy, and sequence details
108
+ by fetching from 'pdbx_core_polymer_entity'.
109
+ """
107
110
  logger.info("Running fetchProteinEntityData...")
108
111
  ok = False
109
112
  try:
@@ -114,7 +117,13 @@ class ProteinTargetSequenceExecutionWorkflow(object):
114
117
  return ok
115
118
 
116
119
  def fetchChemicalReferenceMappingData(self):
117
- """Export RCSB chemical reference identifier mapping details"""
120
+ """Export RCSB chemical reference identifier mapping details.
121
+
122
+ Fetch/prepare mapping of all chemical references from 'bird_chem_comp_core' (for DrugBank and ChEMBL)
123
+ (e.g., all CCs where {'rcsb_chem_comp_related.resource_name': 'DrugBank'}).
124
+
125
+ --> Creates file: CACHE/chemref-mapping/chemref-mapping-data.json
126
+ """
118
127
  logger.info("Running fetchChemicalReferenceMappingData...")
119
128
  ok = False
120
129
  try:
@@ -125,7 +134,14 @@ class ProteinTargetSequenceExecutionWorkflow(object):
125
134
  return ok
126
135
 
127
136
  def fetchLigandNeighborMappingData(self):
128
- """Export RCSB ligand neighbor mapping details"""
137
+ """Export RCSB ligand neighbor mapping details.
138
+
139
+ Fetch/prepare mapping of all polymer_entities and their associated ligands (e.g., "2E1B_1": ["ZN"]).
140
+ This is done by extracting out all "rcsb_ligand_neighbors" from all polymer_entity_instances, and then
141
+ grouping them together on a per-entity basis.
142
+
143
+ --> Creates file: CACHE/ligand-neighbor-mapping/ligand-neighbor-mapping-data.json
144
+ """
129
145
  logger.info("Running fetchLigandNeighborMappingData...")
130
146
  ok = False
131
147
  try:
@@ -136,7 +152,19 @@ class ProteinTargetSequenceExecutionWorkflow(object):
136
152
  return ok
137
153
 
138
154
  def exportFasta(self, reloadPharos=True, fromDbPharos=True):
139
- """Export FASTA target files (and load Pharos from source)"""
155
+ """Export FASTA files for each target resource (and load Pharos from source).
156
+
157
+ --> Creates files:
158
+ - CACHE/SAbDab-features/sabdab-data.json (e.g., (1074) Thera-SAbDab data records and (31152) SAbDab assignments)
159
+ - CACHE/FASTA/sabdab-targets.fa (e.g., SAbDab 2120 fasta sequences)
160
+ - CACHE/FASTA/card-targets.fa
161
+ - CACHE/FASTA/card-targets-taxon.tdd (TDD is taxonomy database)
162
+ - CACHE/FASTA/chembl-targets.fa
163
+ - CACHE/FASTA/chembl-targets-taxon.tdd
164
+ - CACHE/FASTA/pharos-targets.fa
165
+ - CACHE/FASTA/pharos-targets-taxon.tdd
166
+ - ...and more...
167
+ """
140
168
  logger.info("Running exportFasta...")
141
169
  ok = False
142
170
  try:
@@ -155,7 +183,16 @@ class ProteinTargetSequenceExecutionWorkflow(object):
155
183
  return ok
156
184
 
157
185
  def createSearchDatabases(self):
158
- """Create search databases"""
186
+ """Create search databases for each target resource.
187
+
188
+ --> Creates directories/files:
189
+ - CACHE/sequence-databases/sabdab/ (SABDAB is only non-taxonomy database; no TDD)
190
+ - CACHE/sequence-databases/card/ (incl. taxonomy database, and all below)
191
+ - CACHE/sequence-databases/chembl/ (file 'chembl' contains all sequences)
192
+ - CACHE/sequence-databases/pharos/
193
+ - CACHE/sequence-databases/pdbprent/
194
+ - ...and more...
195
+ """
159
196
  logger.info("Running createSearchDatabases...")
160
197
  ok = False
161
198
  try:
@@ -166,15 +203,50 @@ class ProteinTargetSequenceExecutionWorkflow(object):
166
203
  return ok
167
204
 
168
205
  def searchDatabases(self):
169
- """Search sequence databases"""
206
+ """Perform a search for each target resource DB against the 'pdbprent' database.
207
+
208
+ Args (provided below):
209
+ maxSeqs (int): Maximum results per query sequence allowed to pass the prefilter (affects sensitivity).
210
+ This corresponds to the '--max-seqs' flag in MMseqs2 (default: 300).
211
+ The higher the value, the fewer sequences will be filtered out (in cases of high sequence redundancy).
212
+ Note: Use with caution--this can dramatically increase disk usage (https://github.com/soedinglab/MMseqs2/wiki#disk-space).
213
+
214
+ --> Creates files:
215
+ - CACHE/sequence-search-results/card-vs-pdbprent-filtered-results.json (number of keys represents number of query sequences with matches)
216
+ - CACHE/sequence-search-results/card-vs-pdbprent-raw-results.json
217
+ - CACHE/sequence-search-results/card-vs-pdbprent-raw-results.txt
218
+ - CACHE/sequence-search-results/chembl-vs-pdbprent-filtered-results.json
219
+ - CACHE/sequence-search-results/chembl-vs-pdbprent-raw-results.json
220
+ - CACHE/sequence-search-results/chembl-vs-pdbprent-raw-results.txt
221
+ - CACHE/sequence-search-results/pharos-vs-pdbprent-filtered-results.json
222
+ - CACHE/sequence-search-results/pharos-vs-pdbprent-raw-results.json
223
+ - CACHE/sequence-search-results/pharos-vs-pdbprent-raw-results.txt
224
+ - CACHE/sequence-search-results/sabdab-vs-pdbprent-filtered-results.json
225
+ - CACHE/sequence-search-results/sabdab-vs-pdbprent-raw-results.json
226
+ - CACHE/sequence-search-results/sabdab-vs-pdbprent-raw-results.txt
227
+ - ...and more...
228
+ """
170
229
  logger.info("Running searchDatabases...")
171
230
  ok = False
172
231
  try:
173
232
  ptsW = ProteinTargetSequenceWorkflow(self.__cfgOb, self.__cachePath)
174
233
  ok1 = ptsW.search(
175
- referenceResourceName="pdbprent", resourceNameList=["sabdab", "card", "drugbank", "chembl", "pharos"], identityCutoff=0.95, sensitivity=4.5, timeOutSeconds=1000
234
+ referenceResourceName="pdbprent",
235
+ resourceNameList=["sabdab", "drugbank", "chembl", "pharos"],
236
+ identityCutoff=0.95,
237
+ sensitivity=4.5,
238
+ timeOutSeconds=1000,
239
+ maxSeqs=750, # number of seqs permitted past the prefilter (default 300; use caution when increasing w.r.t. disk usage)
240
+ )
241
+ ok2 = ptsW.search(
242
+ referenceResourceName="pdbprent",
243
+ resourceNameList=["card"],
244
+ identityCutoff=0.95,
245
+ sensitivity=4.5,
246
+ timeOutSeconds=1000,
247
+ useBitScore=True,
248
+ maxSeqs=750,
176
249
  )
177
- ok2 = ptsW.search(referenceResourceName="pdbprent", resourceNameList=["card"], identityCutoff=0.95, sensitivity=4.5, timeOutSeconds=1000, useBitScore=True)
178
250
  ok = ok1 and ok2
179
251
  except Exception as e:
180
252
  logger.exception("Failing with %s", str(e))
@@ -237,29 +309,47 @@ class ProteinTargetSequenceExecutionWorkflow(object):
237
309
  def fullWorkflow():
238
310
  """Entry point for the full targets sequence and cofactor update workflow."""
239
311
  ptsWf = ProteinTargetSequenceExecutionWorkflow()
312
+ #
313
+ # Fetch taxonomy data
240
314
  ok = ptsWf.cacheTaxonomy()
241
315
  logger.info("cacheTaxonomy status %r", ok)
242
316
  ok = ptsWf.updateUniProtTaxonomy() and ok
243
317
  logger.info("updateUniProtTaxonomy status %r", ok)
318
+ #
319
+ # Fetch all PDB entity sequences from 'pdbx_core_polymer_entity'
244
320
  ok = ptsWf.fetchProteinEntityData() and ok
245
321
  logger.info("fetchProteinEntityData status %r", ok)
322
+ #
323
+ # Fetch/prepare mapping of all chemical references from 'bird_chem_comp_core' (for DrugBank and ChEMBL)
246
324
  ok = ptsWf.fetchChemicalReferenceMappingData() and ok
247
325
  logger.info("fetchChemicalReferenceMappingData status %r", ok)
326
+ #
327
+ # Fetch/prepare mapping of all polymer_entities and their associated ligands (e.g., "2E1B_1": ["ZN"])
248
328
  ok = ptsWf.fetchLigandNeighborMappingData() and ok
249
329
  logger.info("fetchLigandNeighborMappingData status %r", ok)
330
+ #
331
+ # Export FASTA files for each target resource
250
332
  ok = ptsWf.exportFasta() and ok
251
333
  logger.info("exportFasta status %r", ok)
334
+ #
335
+ # Create search databases for each target resource
252
336
  ok = ptsWf.createSearchDatabases() and ok
253
337
  logger.info("createSearchDatabases status %r", ok)
338
+ #
339
+ # Search each target resource DB against the 'pdbprent' database...
254
340
  ok = ptsWf.searchDatabases() and ok
255
341
  logger.info("searchDatabases status %r", ok)
342
+ #
256
343
  ok = ptsWf.buildFeatures() and ok
257
344
  logger.info("buildFeatures status %r", ok)
345
+ #
258
346
  # To rebuild ChEMBL-target-activity data from scratch (non-incremental), set skip=None in fetchTargetActivityDataMulti()
259
347
  ok = ptsWf.buildActivityData() and ok
260
348
  logger.info("buildActivityData status %r", ok)
349
+ #
261
350
  ok = ptsWf.buildCofactorData() and ok
262
351
  logger.info("buildCofactorData status %r", ok)
352
+ #
263
353
  ptsWf.resourceCheck()
264
354
  return ok
265
355
 
@@ -17,6 +17,7 @@
17
17
  # 6-Jul-2023 aae Don't overwrite Buildlocker files if there is no data
18
18
  # 20-Aug-2024 dwp Add step for loading target cofactor data to MongoDB
19
19
  # 27-Aug-2024 dwp Update usage of CARDTargetOntologyProvider
20
+ # 10-Dec-2024 dwp Add support for 'max-seqs' flag in mmseqs search
20
21
  ##
21
22
  __docformat__ = "google en"
22
23
  __author__ = "John Westbrook"
@@ -252,7 +253,7 @@ class ProteinTargetSequenceWorkflow(object):
252
253
  retOk = False
253
254
  return retOk
254
255
 
255
- def search(self, referenceResourceName, resourceNameList=None, identityCutoff=0.90, timeOutSeconds=10, sensitivity=4.5, useBitScore=False, formatOutput=None):
256
+ def search(self, referenceResourceName, resourceNameList=None, identityCutoff=0.90, timeOutSeconds=10, sensitivity=4.5, useBitScore=False, formatOutput=None, maxSeqs=300):
256
257
  """Search for similar sequences in the reference resource and the input sequence resources.
257
258
 
258
259
  Args:
@@ -264,6 +265,7 @@ class ProteinTargetSequenceWorkflow(object):
264
265
  useBitScore (bool, optional): use bitscore value as an additional comparison threshold. Defaults to False.
265
266
  formatOutput(str, optional): mmseq2 search fields exported. Defaults to "query,target,taxid,taxname,pident,alnlen,mismatch,
266
267
  gapopen,qstart,qend,tstart,tend,evalue,raw,bits,qlen,tlen,qaln,taln,cigar".
268
+ maxSeqs (int): Maximum results per query sequence allowed to pass the prefilter (affects sensitivity). Defaults to 300.
267
269
 
268
270
  Returns:
269
271
  bool: True for success or False otherwise
@@ -275,7 +277,14 @@ class ProteinTargetSequenceWorkflow(object):
275
277
  continue
276
278
  startTime = time.time()
277
279
  ok = self.__searchSimilar(
278
- referenceResourceName, resourceName, identityCutoff=identityCutoff, timeOut=timeOutSeconds, sensitivity=sensitivity, useBitScore=useBitScore, formatOutput=formatOutput
280
+ referenceResourceName,
281
+ resourceName,
282
+ identityCutoff=identityCutoff,
283
+ timeOut=timeOutSeconds,
284
+ sensitivity=sensitivity,
285
+ useBitScore=useBitScore,
286
+ formatOutput=formatOutput,
287
+ maxSeqs=maxSeqs,
279
288
  )
280
289
  logger.info(
281
290
  "Completed searching %s targets (status %r) (cutoff=%r) at %s (%.4f seconds)",
@@ -289,7 +298,7 @@ class ProteinTargetSequenceWorkflow(object):
289
298
  #
290
299
  return retOk
291
300
 
292
- def __searchSimilar(self, referenceResourceName, resourceName, identityCutoff=0.90, timeOut=10, sensitivity=4.5, useBitScore=False, formatOutput=None):
301
+ def __searchSimilar(self, referenceResourceName, resourceName, identityCutoff=0.90, timeOut=10, sensitivity=4.5, useBitScore=False, formatOutput=None, maxSeqs=300):
293
302
  """Search for similar sequences in reference resource and input resources"""
294
303
  try:
295
304
  resultDirPath = self.__getResultDirPath()
@@ -302,7 +311,7 @@ class ProteinTargetSequenceWorkflow(object):
302
311
  rawPath = self.__getSearchResultPath(resourceName, referenceResourceName)
303
312
  resultPath = self.__getFilteredSearchResultPath(resourceName, referenceResourceName)
304
313
  ok = mmS.searchDatabase(
305
- resourceName, seqDbTopPath, referenceResourceName, rawPath, minSeqId=identityCutoff, timeOut=timeOut, sensitivity=sensitivity, formatOutput=formatOutput
314
+ resourceName, seqDbTopPath, referenceResourceName, rawPath, minSeqId=identityCutoff, timeOut=timeOut, sensitivity=sensitivity, formatOutput=formatOutput, maxSeqs=maxSeqs
306
315
  )
307
316
  #
308
317
  if taxonPath and mU.exists(taxonPath):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rcsb.workflow
3
- Version: 0.45
3
+ Version: 0.47
4
4
  Summary: RCSB Python data processing and ETL/ELT workflow entry points
5
5
  Home-page: https://github.com/rcsb/py-rcsb_workflow
6
6
  Author: John Westbrook
@@ -12,15 +12,16 @@ Classifier: Natural Language :: English
12
12
  Classifier: License :: OSI Approved :: Apache Software License
13
13
  Classifier: Programming Language :: Python
14
14
  Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
16
17
  Description-Content-Type: text/markdown
17
18
  License-File: LICENSE
18
- Requires-Dist: OpenEye-toolkits>=2020.2.2
19
+ Requires-Dist: OpenEye-toolkits>=2024.1.1
19
20
  Requires-Dist: rcsb.utils.chem>=0.79
20
21
  Requires-Dist: rcsb.utils.seq>=0.82
21
22
  Requires-Dist: rcsb.utils.targets>=0.82
22
- Requires-Dist: rcsb.utils.seqalign>=0.29
23
- Requires-Dist: rcsb.exdb>=1.23
23
+ Requires-Dist: rcsb.utils.seqalign>=0.31
24
+ Requires-Dist: rcsb.exdb>=1.25
24
25
  Requires-Dist: rcsb.utils.io>=1.48
25
26
  Provides-Extra: dev
26
27
  Requires-Dist: check-manifest; extra == "dev"
@@ -1,9 +1,9 @@
1
- OpenEye-toolkits>=2020.2.2
1
+ OpenEye-toolkits>=2024.1.1
2
2
  rcsb.utils.chem>=0.79
3
3
  rcsb.utils.seq>=0.82
4
4
  rcsb.utils.targets>=0.82
5
- rcsb.utils.seqalign>=0.29
6
- rcsb.exdb>=1.23
5
+ rcsb.utils.seqalign>=0.31
6
+ rcsb.exdb>=1.25
7
7
  rcsb.utils.io>=1.48
8
8
 
9
9
  [dev]
@@ -1,8 +1,8 @@
1
1
  --extra-index-url https://pypi.anaconda.org/OpenEye/simple
2
- OpenEye-toolkits >= 2020.2.2
2
+ OpenEye-toolkits >= 2024.1.1
3
3
  rcsb.utils.chem >= 0.79
4
4
  rcsb.utils.seq >= 0.82
5
5
  rcsb.utils.targets >= 0.82
6
- rcsb.utils.seqalign >= 0.29
7
- rcsb.exdb >= 1.23
6
+ rcsb.utils.seqalign >= 0.31
7
+ rcsb.exdb >= 1.25
8
8
  rcsb.utils.io >= 1.48
@@ -45,7 +45,8 @@ setup(
45
45
  "License :: OSI Approved :: Apache Software License",
46
46
  "Programming Language :: Python",
47
47
  "Programming Language :: Python :: 3",
48
- "Programming Language :: Python :: 3.8",
48
+ "Programming Language :: Python :: 3.9",
49
+ "Programming Language :: Python :: 3.10",
49
50
  ],
50
51
  # entry_points={"console_scripts": ["cactvs_annotate_mol=rcsb.workflow.cactvsAnnotateMol:main"]},
51
52
  # The following is somewhat flakey --
File without changes
File without changes
File without changes
File without changes