Skip to content

Commit 4b10674

Browse files
committed
add exluded to outpout, remove manual deprecation
1 parent fa5d4e7 commit 4b10674

File tree

3 files changed

+13
-29
lines changed

3 files changed

+13
-29
lines changed

docs/source/USER-GUIDE.md

+3-13
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ _XChemAlign_ is a small suite of tools for preparing PDB models for loading into
1212
There are a few steps involved.
1313
1. [**Enable**](#enabling-the-xchemalign-environment) the XChemAlign environment
1414
2. [**Declare**](#declaring-things) a few things about your data in two structured files in `yaml`[^1]
15+
2. [**Declare**](#declaring-things) a few things about your data in two structured files in `yaml`[^1]
1516
3. [**Collate**](#collating-files) your files in a new (specific) directory structure
1617
4. [**Align**](#aligning-everything) all binding sites to common origins
1718
5. [**Release**](#upload-to-fragalysis) the data to Fragalysis
@@ -347,19 +348,8 @@ one for each ligand).
347348

348349
#### Overriding status
349350

350-
There is a mechanism to manually override the status of any crystal. Typically you would use this to deprecate a crystal
351-
that had previously been included, but you now want to exclude from analysis in Fragalysis. To do this add a section like
352-
this at the top level of your `config.yaml` file:
353-
354-
```yaml
355-
overrides:
356-
crystals:
357-
A71EV2A-x0202:
358-
status: deprecated
359-
status_reason: bad karma
360-
```
361-
362-
That example would mark the crystal `A71EV2A-x0202` as being of `deprecated` status.
351+
There was previously a mechanism to manually override the status of any crystal. This feature has now been removed.
352+
Instead you should set the status is soakDB to `7 - Analysed & Rejected`.
363353

364354
### 2.3. The assemblies YAML
365355

src/xchemalign/collator.py

+9-16
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ def __init__(self, working_dir, log_file=None, log_level=0, include_git_info=Fal
167167
self.meta_history = []
168168
self.all_xtals = None
169169
self.rejected_xtals = set()
170+
self.all_excludes = set()
170171
self.new_or_updated_xtals = None
171172
self.compound_codes = {}
172173
self.compound_smiles = {}
@@ -185,7 +186,10 @@ def __init__(self, working_dir, log_file=None, log_level=0, include_git_info=Fal
185186
for input in inputs:
186187
# Determine which datasets to exclude
187188
excluded_datasets = utils.find_property(input, Constants.CONFIG_EXCLUDE)
188-
if not excluded_datasets:
189+
if excluded_datasets:
190+
for excl in excluded_datasets:
191+
self.all_excludes.add(excl)
192+
else:
189193
excluded_datasets = []
190194

191195
input_path = utils.find_path(input, Constants.CONFIG_DIR)
@@ -386,6 +390,9 @@ def validate_data(self):
386390
if git_info:
387391
meta[Constants.META_GIT_INFO] = git_info
388392

393+
if self.all_excludes:
394+
meta[Constants.META_EXClUDES] = list(self.all_excludes)
395+
389396
tooltips = {}
390397
for input in self.inputs:
391398
code_prefix = input.code_prefix
@@ -1242,21 +1249,6 @@ def _munge_history(self, meta):
12421249
new_or_updated_xtals[xtal_name] = xtal_data
12431250
all_xtals[xtal_name] = xtal_data
12441251

1245-
# look for any user defined deprecations
1246-
xtal_override = overrides.get(Constants.META_XTALS, {}).get(xtal_name, {})
1247-
if xtal_override:
1248-
status_override = xtal_override.get(Constants.META_STATUS)
1249-
if status_override:
1250-
xtal_data[Constants.META_STATUS] = status_override
1251-
reason = xtal_override.get(Constants.META_STATUS_REASON)
1252-
self.logger.info(
1253-
"status for xtal {} is overridden by user to be {}".format(xtal_name, status_override)
1254-
)
1255-
if reason:
1256-
xtal_data[Constants.META_STATUS_REASON] = reason
1257-
else:
1258-
self.logger.warn("status is overridden, but no reason was given")
1259-
12601252
self.logger.info("metadata {} has {} items".format(count, total))
12611253
self.logger.info(
12621254
"munging resulted in {} total xtals, {} are new or updated".format(
@@ -1453,6 +1445,7 @@ def main():
14531445
+ str(wd)
14541446
)
14551447
else: # couldn't even create the Collator object so log file will contain nothing useful
1448+
print(tb)
14561449
print(
14571450
"Unexpected fatal error occurred, most likely the configuration is wrong or collator was invoked "
14581451
+ "incorrectly. Please send the command you ran and your current directory to the developers."

src/xchemalign/utils.py

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ class Constants:
7676
META_STATUS_NEW = "new"
7777
META_STATUS_DEPRECATED = "deprecated"
7878
META_STATUS_REASON = "status_reason"
79+
META_EXClUDES = "excluded_crystals"
7980
META_XTALS = "crystals"
8081
META_REFERENCE = "reference"
8182
META_FILE = "file"

0 commit comments

Comments
 (0)