Comments (4)
This cif file from MMDB is different from cif files from the PDB, and not conforming to the spec, in many ways.
The particular problem here is that _atom_site.label_entity_id
is set to 1
for all atoms. In mmCIF files, each so-called entity is explicitly assigned one of the types: polymer, branched, non-polymer, water. Here, this is missing, but since all residues are explicitly assigned the same entity_id, it means that they are all of the same type – gemmi assumes that this type is polymer. I'd need to add a sanity check to detect when entity_id is a dummy value.
As a workaround, you can call:
structure.add_entity_types(overwrite=True)
which re-assigns entity types. Then removing ligands/waters should work. The overwrite
option was fixed recently, it might not work in 0.6.3.
Anyway, it'd be better to not use mmCIF files like this.
from gemmi.
Thanks for the information. I agree that ideally it would be better to not use such mmCIF files but I have no other option at the moment. Regarding the suggested fix structure.add_entity_types(overwrite=True)
, is this in anyway similar to gemmi::setup_entities
from v0.6.2? We are currently using gemmi::setup_entities
with the newly created structures but the problem persists. Also the approach you suggested in pumble mmdb->gemmi->mmCIF->gemmi seems not to solve the issue. It might be that we need to wait until serialization format is available...
from gemmi.
Hi @wojdyr, sorry to bother you with this again. I've got another file (also originating from mmdb) where the _atom_site.label_entity_id
is set to 1 for atoms in residues, 2 for waters and 3 for the ligand, link to the file here. In this case, gemmi::remove_ligands_and_waters
can remove the waters but it seems unable to remove the ligands? Any idea why?
from gemmi.
add_entity_types(overwrite=True)
overwrites entity types that were assigned before.
setup_entities()
calls add_entity_types()
, but without the overwrite flag, which doesn't change the types that were assigned previously.
I changed now how mmcif is read: if entity types are not specified explicitly in the file, they are not assigned automatically inside read_structure()
. The PDB has conventions in its files that distinguish polymers from non-polymers and branched entities: label_seq_id is null for all residues except polymers, and each non-polymer residue has separate label_asym_id. But other programs may not observe these conventions, so let's not rely on it.
from gemmi.
Related Issues (20)
- auto completion for gemmi grep HOT 1
- Uses of graph isomorphism and pynauty? HOT 2
- Segfault when importing `gemmi.cif` HOT 2
- crash with very large mmCIF files (and large number of datablock) in gemmi grep HOT 11
- Missing _struct_ref_seq in cif generated from PDB without optional TER. HOT 2
- Apparent sudden extra dependency for gemmi (zlib) HOT 5
- sequence aligning with align_sequence_to_polymer HOT 10
- TER's effecting aligning HOT 4
- Adding additional properties to the Structure object present in the cif atom_site table HOT 1
- [FEATURE REQUEST] Add Python typing for `Vec3.__iter__` HOT 2
- crash with set_extent HOT 4
- Bug in `get_all_unit_cell_sites()` HOT 5
- pdb/cif entity subchain comparisons HOT 1
- Advice to deal with AF3's broken CIF files HOT 1
- Gemmi read_ccp4_map fails to correctly set the correct spacing from a .MAP file HOT 2
- [Bug Report] read_pdb mishandle the columns of extreme wild pdb files HOT 5
- [Question] bulk reading mmcif coordinates into a numpy array HOT 2
- Creating a structure from list of residues and their coordinates HOT 2
- Float comparison fails `static_assert(weights[static_cast<int>(El::D)] == 2.0141, "Hmm")` on some architectures HOT 7
- Segfault when iterating over multiple structures HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gemmi.