ihmwg / python-ihm

Python package for handling IHM mmCIF and BinaryCIF files
MIT License
14 stars 7 forks source link

EM map header for unreleased entries in EMDB #93

Closed brindakv closed 1 year ago

brindakv commented 1 year ago

User email: The map used is a new EM map that has been submitted to EMDB and been assigned an ID but not yet released. So we are not able to generate an mmCIF file since python-ihm complains that map header is not found.

benmwebb commented 1 year ago

We would need to see a Python traceback in order to figure out what's going on here. This sounds like an issue with ihm.metadata.MRCParser but python-ihm doesn't care whether a map is in EMDB or not - it will just skip adding metadata from EMDB if there's no EMDB ID in the header.

shreyas-arvindekar commented 1 year ago

I am running the IMP mmcif generation scipt which returns the following error. This is from a print statement which if commented, runs fine.

The output cif file shows '3DEM volume' NO and contains no EM header (EMDB ID and title) but it has the EM restraint (_ihm_3dem_restraint.id); is that fine? You can find the cif file here

Traceback (most recent call last):
  File "/home/shreyas/Projects/nurd/scripts/mmcif/mhr_mmcif.py", line 353, in <module>
    print("is derived from EMDB entry", d.parents[0].location.access_code)
AttributeError: 'InputFileLocation' object has no attribute 'access_code'
benmwebb commented 1 year ago
Traceback (most recent call last):
  File "/home/shreyas/Projects/nurd/scripts/mmcif/mhr_mmcif.py", line 353, in <module>
    print("is derived from EMDB entry", d.parents[0].location.access_code)
AttributeError: 'InputFileLocation' object has no attribute 'access_code'

Sure, if you ask python-ihm to print the EMDB accession of something that isn't in EMDB, it'll report an error. So... don't do that! (Looks like this print statement is from the IMP deposition tutorial, where the dataset is in EMDB. In this case, your dataset is a file on disk instead, InputFileLocation.)

The output cif file shows '3DEM volume' NO and contains no EM header (EMDB ID and title) but it has the EM restraint (_ihm_3dem_restraint.id); is that fine? You can find the cif file here

I think what you mean is that the restraint refers back to a 3DEM dataset which is not deposited in a database. That is fine (but also outside of the scope of this python-ihm issue). It would - ideally - need to be modified to point to EMDB at deposition time, or pointed to a file in another public location, like Zenodo.