Skip to content

Commit c6e6ded

Browse files
committed
added source_file property to crystallographic_files entries
1 parent 46f2df1 commit c6e6ded

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/xchemalign/aligner.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import gemmi
2121

2222
from rich.traceback import install
23-
install(show_locals=True)
2423

2524
# Local alignment imports
2625
from ligand_neighbourhood_alignment import constants as lna_constants
@@ -66,6 +65,8 @@
6665
from xchemalign.utils import Constants
6766
from xchemalign.pdb_xtal import PDBXtal
6867

68+
install(show_locals=True)
69+
6970

7071
def try_make(path):
7172
if not Path(path).exists():
@@ -461,10 +462,7 @@ def _perform_alignments(self, meta):
461462

462463
# Get the assembly transforms
463464
if working_fs_model.assembly_transforms.exists():
464-
assembly_transforms = ah.load_yaml(
465-
working_fs_model.assembly_transforms,
466-
lambda x: x
467-
)
465+
assembly_transforms = ah.load_yaml(working_fs_model.assembly_transforms, lambda x: x)
468466
else:
469467
assembly_transforms = {}
470468

@@ -489,7 +487,6 @@ def _perform_alignments(self, meta):
489487
assembly_landmarks,
490488
assembly_transforms,
491489
self.version_dir.name[7:],
492-
493490
)
494491

495492
# Update the metadata_file with aligned file locations and site information

src/xchemalign/collator.py

+4
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,7 @@ def _copy_files(self, meta):
869869
data_to_add[Constants.META_XTAL_PDB] = {
870870
Constants.META_FILE: str(fdata[1]),
871871
Constants.META_SHA256: fdata[2],
872+
Constants.META_SOURCE_FILE: str(fdata[0]),
872873
}
873874
# copy MTZ file
874875
fdata = files_to_copy.get(Constants.META_XTAL_MTZ)
@@ -882,6 +883,7 @@ def _copy_files(self, meta):
882883
data_to_add[Constants.META_XTAL_MTZ] = {
883884
Constants.META_FILE: str(fdata[1]),
884885
Constants.META_SHA256: fdata[2],
886+
Constants.META_SOURCE_FILE: str(fdata[0]),
885887
}
886888
fdata = files_to_copy.get(Constants.META_XTAL_CIF)
887889

@@ -896,6 +898,7 @@ def _copy_files(self, meta):
896898
data_to_add[Constants.META_XTAL_CIF] = {
897899
Constants.META_FILE: str(fdata[1]),
898900
Constants.META_SHA256: fdata[2],
901+
Constants.META_SOURCE_FILE: str(fdata[0]),
899902
}
900903
try:
901904
mol = utils.gen_mol_from_cif(str(self.output_path / fdata[1]))
@@ -938,6 +941,7 @@ def _copy_files(self, meta):
938941
data = {
939942
Constants.META_FILE: str(attested_ligand_event_data[1]),
940943
Constants.META_SHA256: attested_ligand_event_data[2],
944+
Constants.META_SOURCE_FILE: str(attested_ligand_event_data[0]),
941945
Constants.META_PROT_MODEL: ligand_key[0],
942946
Constants.META_PROT_CHAIN: ligand_key[1],
943947
Constants.META_PROT_RES: ligand_key[2],

src/xchemalign/utils.py

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ class Constants:
7878
META_REFERENCE = "reference"
7979
META_FILE = "file"
8080
META_SHA256 = "sha256"
81+
META_SOURCE_FILE = "source_file"
8182
META_XTAL_FILES = "crystallographic_files"
8283
META_ALIGNED_FILES = "aligned_files"
8384
META_REFERENCE_ALIGNMENTS = "reference_aligned_files"

0 commit comments

Comments
 (0)