Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17 +/- ##
==========================================
- Coverage 82.58% 77.42% -5.17%
==========================================
Files 14 14
Lines 1654 1772 +118
Branches 229 258 +29
==========================================
+ Hits 1366 1372 +6
- Misses 227 339 +112
Partials 61 61
🚀 New features to boost your workflow:
|
|
bug가 좀 있습니다..! 다시 쓰는 과정에서 없어지는 field가 있어서 읽을 때 에러가 나요....! @jnooree |
|
Bugbot Autofix prepared fixes for 3 of the 3 bugs found in the latest run.
Or push these changes by commenting: Preview (e941e73c8a)diff --git a/src/gmol/base/data/mmcif/assembly.py b/src/gmol/base/data/mmcif/assembly.py
--- a/src/gmol/base/data/mmcif/assembly.py
+++ b/src/gmol/base/data/mmcif/assembly.py
@@ -549,7 +549,12 @@
"""
from nuri.fmt import cif_ddl2_frame_as_dict, read_cif
- data = next(read_cif(cif_file)).data
+ try:
+ data = next(read_cif(cif_file)).data
+ except StopIteration:
+ raise ValueError(
+ f"Empty or invalid CIF file: {cif_file}"
+ ) from None
mmcif_dict = cif_ddl2_frame_as_dict(data)
# Build CCD from embedded chem_comp data
@@ -644,9 +649,11 @@
for chain_id, seq_infos in poly_seq_scheme.items():
chain_types[chain_id] = polymer_mol_type(seq_infos, ccd)
for chain_id in branch_scheme:
- chain_types[chain_id] = MolType.Ligand
+ if chain_id not in chain_types:
+ chain_types[chain_id] = MolType.Ligand
for chain_id in nonpoly_scheme:
- chain_types[chain_id] = MolType.Ligand
+ if chain_id not in chain_types:
+ chain_types[chain_id] = MolType.Ligand
# Fallback for chains with no scheme data
for chain_id in struct_asym:
@@ -691,10 +698,15 @@
# Set seqres and branches for each chain
for cid, chain in chains.items():
+ poly_schemes = poly_seq_scheme.get(cid, [])
+ poly_seq_ids = {s.seq_id for s in poly_schemes}
+ branch_schemes = [
+ s
+ for s in branch_scheme.get(cid, [])
+ if s.seq_id not in poly_seq_ids
+ ]
chain.seqres = _select_het_seq_scheme(
- poly_seq_scheme.get(cid, [])
- + branch_scheme.get(cid, [])
- + nonpoly_scheme.get(cid, []),
+ poly_schemes + branch_schemes + nonpoly_scheme.get(cid, []),
residues,
)
chain.branches = _map_branches( |
|
원래 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| "0.0", | ||
| ) | ||
| ], | ||
| ) |
There was a problem hiding this comment.
Missing pdbx_struct_assembly_gen block in Assembly.to_mmcif()
High Severity
Assembly.to_mmcif() writes pdbx_struct_assembly and pdbx_struct_oper_list blocks but never writes the required pdbx_struct_assembly_gen block that links them together. When the output is read back, the _join_bioassembly validator finds no pdbx_struct_assembly_gen entries, leaving each BioAssembly with an empty assembly_gens list. This causes mmcif_assemblies() to call _apply_transforms with an empty generators list, ultimately crashing in Assembly.join([]) via np.concatenate on an empty list. The analogous Mmcif.to_mmcif() method correctly writes pdbx_struct_assembly_gen.



Checklist
If the change is related to the source code, tests, or build environments, please also check the following:
pytest -vspass without any errors and warnings (at the project root)?mypy --prettypass without any errors and warnings (at the project root)?If you added new feature(s), then also check the following:
Linked Issues
Link the tracking issue(s) of this PR, with the auto-close keywords here:
Note
Medium Risk
Touches core mmCIF export and introduces non-trivial filtering that must keep multiple interdependent tables consistent; mistakes could silently produce invalid or incomplete mmCIF output.
Overview
Assemblynow stores the originatingMmcif(metadata) and propagates it throughfilter,transform, andjoin, so derived assemblies retain mmCIF context.Assembly.to_mmcifis expanded to emit additional mmCIF header/experimental blocks and more completeatom_site/struct_connfields, including placeholderpdbx_struct_assembly/pdbx_struct_oper_listidentity data.Mmcifgainsfilter/filter_chainsto subset a structure while consistently pruning dependent tables (entities, schemes, connections, assembly gens, branch links), plus a newMmcif.to_mmcif()writer to round-trip the parsed model back to mmCIF text.Written by Cursor Bugbot for commit 1b19fc2. This will update automatically on new commits. Configure here.