From 9e290dd98a9ae4dbb8e5e8c812e83ce4775f577b Mon Sep 17 00:00:00 2001
From: Gabriel Studer <gabriel.studer@unibas.ch>
Date: Tue, 2 Jan 2024 15:20:38 +0100
Subject: [PATCH] mmcif writer: basic SaveMMCIF function in ost.io

no documentation or fancy features yet
---
 modules/io/pymod/__init__.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/modules/io/pymod/__init__.py b/modules/io/pymod/__init__.py
index ca619a156..98314f2e5 100644
--- a/modules/io/pymod/__init__.py
+++ b/modules/io/pymod/__init__.py
@@ -462,6 +462,17 @@ def LoadMMCIF(filename, fault_tolerant=None, calpha_only=None,
   except:
     raise
 
+
+def SaveMMCIF(ent, filename, data_name="OST_structure"):
+  """
+  Save entity - All fantastic documentation comes here
+  """
+  writer = MMCifWriter()
+  writer.SetStructure(ent)
+  writer.Write(data_name, filename)
+
+
+
 # this function uses a dirty trick: should be a member of MMCifInfoBioUnit
 # which is totally C++, but we want the method in Python... so we define it
 # here (__init__) and add it as a member to the class. With this, the first
-- 
GitLab