[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
As far as I can tell, programmatically the only way to fix the 'missing parent' problem you identify is indeed to go through the entire dictionary processing 'item_linked.parent_name' and '_item_linked.child_name' loops, which are usually found at the top of the pointer tree (in this case in the _atom_site save frame). This same save frame also contains a list of category ids for each of the 'id' values. My approach in PyCIFRW is to repopulate the individual definitions when ingesting the dictionary, to save time later. The PyCIFRW code and comments for this can be found at https://bitbucket.org/jamesrhester/pycifrw/src/78576030f75bb4f8cb52d84a60e603815ad38afb/pycifrw/CifFile.nw?at=stable
starting at line 839, with lines 854-862 describing and discussing your issue. Note also subsequent lines discussing PDBX.
There is a school of thought that the category name is 'implicit' in a DDL2 dataname or save frame name, however IT Vol G states that this is conventional rather than required so I prefer (like you it seems) never to assume this unless given no alternative.
An mmCIF/PDB person may wish to comment on the philosophical reasons behind these decisions, which I gather have something to do with taking a relational database view of a CIF file.
all the best,
James.
--
T +61 (02) 9717 9907
F +61 (02) 9717 3145
M +61 (04) 0249 4148
Reply to: [list | sender only]
Re: Absence of _item.category_id or _item_linked.parent_name in somemmcif definitions
- Subject: Re: Absence of _item.category_id or _item_linked.parent_name in somemmcif definitions
- From: James Hester <jamesrhester@xxxxxxxxx>
- Date: Fri, 21 Dec 2012 17:26:14 +1100
- DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;h=mime-version:in-reply-to:references:date:message-id:subject:from:to:content-type; bh=a14tigsr2j27NxOvgLRYKbAw+9m3CHme3MWplLlPSGw=;b=ozONuvqmDOSt3kjeRo44X+Akl0/IOWo1vb/0VWBRLNCo87/Xh6pPaWH/uRQIqIwhVQLvx2uZUoNRuHEaOnkSJOFvKCR77jNgIKdouOwZe+/pR7tsFOo39mYC0EsluasC0+ITYUTeY72g2wUrvl1VKgiIexnmasU8GuGkE/bClgh6SWVG8AFtXMX0iNsYA5qG0WA4sACu8DIWqWhvAZS0XtGICtI2M7PNKrgpig2aluIgHR+pkkSF1vpfEinw346s0p1vVWEs4E3lMK3qNT9LrcFsUEPNmo7aTKgxHSMKNbB+rdS76bwdNaXV14s9wZBvd+gZTY0bOgOc2ZwmiIN2dQ==
- In-Reply-To: <CACCG97GtT4pdy+2NwmDrwPqCcLzhQMMqQaQuD2-uLggKDi-P-A@mail.gmail.com>
- References: <CACCG97GtT4pdy+2NwmDrwPqCcLzhQMMqQaQuD2-uLggKDi-P-A@mail.gmail.com>
As far as I can tell, programmatically the only way to fix the 'missing parent' problem you identify is indeed to go through the entire dictionary processing 'item_linked.parent_name' and '_item_linked.child_name' loops, which are usually found at the top of the pointer tree (in this case in the _atom_site save frame). This same save frame also contains a list of category ids for each of the 'id' values. My approach in PyCIFRW is to repopulate the individual definitions when ingesting the dictionary, to save time later. The PyCIFRW code and comments for this can be found at https://bitbucket.org/jamesrhester/pycifrw/src/78576030f75bb4f8cb52d84a60e603815ad38afb/pycifrw/CifFile.nw?at=stable
starting at line 839, with lines 854-862 describing and discussing your issue. Note also subsequent lines discussing PDBX.
There is a school of thought that the category name is 'implicit' in a DDL2 dataname or save frame name, however IT Vol G states that this is conventional rather than required so I prefer (like you it seems) never to assume this unless given no alternative.
An mmCIF/PDB person may wish to comment on the philosophical reasons behind these decisions, which I gather have something to do with taking a relational database view of a CIF file.
all the best,
James.
On Thu, Dec 20, 2012 at 1:32 PM, Richard Gildea <rgildea@gmail.com> wrote:
Dear All,Certain definitions in the mmcif dictionary (e.g. _atom_site_anisotrop.id) do not contain the items _item.category_id or _item_linked.parent_name. Without these data items, how is it possible to identify programmatically that _atom_site_anisotrop.id belongs to the _atom_site_anisotrop category and that it is a pointer to _atom_site.id (without examining every save frame?For quick reference here is the definition in question:save__atom_site_anisotrop.id _item_description.description ; This data item is a pointer to _atom_site.id in the ATOM_SITE category. ; _item.name '_atom_site_anisotrop.id' _item.mandatory_code yes _item_aliases.alias_name '_atom_site_aniso_label' _item_aliases.dictionary cif_core.dic _item_aliases.version 2.0.1 save_Cheers,Richard
_______________________________________________
cif-developers mailing list
cif-developers@iucr.org
http://mailman.iucr.org/mailman/listinfo/cif-developers
--
T +61 (02) 9717 9907
F +61 (02) 9717 3145
M +61 (04) 0249 4148
_______________________________________________ cif-developers mailing list cif-developers@iucr.org http://mailman.iucr.org/mailman/listinfo/cif-developers
Reply to: [list | sender only]
- Follow-Ups:
- References:
- Prev by Date: Absence of _item.category_id or _item_linked.parent_name in somemmcif definitions
- Next by Date: Re: Absence of _item.category_id or _item_linked.parent_name in somemmcif definitions
- Prev by thread: Absence of _item.category_id or _item_linked.parent_name in somemmcif definitions
- Next by thread: Re: Absence of _item.category_id or _item_linked.parent_name in somemmcif definitions
- Index(es):