Skip to content
Snippets Groups Projects
Verified Commit 5e2626ed authored by Xavier Robin's avatar Xavier Robin
Browse files

fix: SCHWED-6108 read other as CHAINTYPE_POLY

This allows the mmCIF writer to save the entity_poly.type as "other"
rater than error on an unknown type.
We can do this because there is no "other" in _entity_poly.type.
Added a comment about the risks of chain_type for reading/writing mmCIF
files.
parent 87ceb277
No related branches found
Tags 2.3.1-rc
No related merge requests found
......@@ -59,7 +59,9 @@ ChainType ChainTypeFromString(StringRef identifier)
} else if (StringRef("oligosaccharide", 15) == identifier) {
return CHAINTYPE_OLIGOSACCHARIDE;
} else if (StringRef("other", 5) == identifier) {
return CHAINTYPE_UNKNOWN;
// According to the mmCIF dictionary, "other" only exists in
// _entity_poly.type. Therefore, "other" can only be a generic polymer.
return CHAINTYPE_POLY;
}
throw Error("Unrecognised chain type descriptor found: '" +
......
......@@ -28,6 +28,11 @@
namespace ost { namespace mol {
/// \enum different kinds of chains
///
/// Warning: this class mixes vocabulary from _entity.type and
// _entity_poly.type, which is more detailed. As a result it cannot be used to
/// to read/write mmCIF entity types accurately.
typedef enum {
CHAINTYPE_POLY, ///< polymer
CHAINTYPE_NON_POLY, ///< non-polymer
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment