Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
openstructure
Commits
c7f3da8a
Commit
c7f3da8a
authored
1 year ago
by
Studer Gabriel
Browse files
Options
Downloads
Patches
Plain Diff
mmcif writer: allow to pre-define entities in io.SaveMMCIF
parent
a855a571
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/io/doc/mmcif.rst
+4
-2
4 additions, 2 deletions
modules/io/doc/mmcif.rst
modules/io/pymod/__init__.py
+7
-2
7 additions, 2 deletions
modules/io/pymod/__init__.py
with
11 additions
and
4 deletions
modules/io/doc/mmcif.rst
+
4
−
2
View file @
c7f3da8a
...
...
@@ -1956,7 +1956,9 @@ To see it all in action:
(:class:`ost.StringList`) Asym chain names that are assigned to this entity
.. class:: MMCifWriterEntityList
A list for :class:`MMCifWriterEntity`
.. class:: MMCifWriter
...
...
@@ -1979,11 +1981,11 @@ To see it all in action:
starting point, i.e. chains in *ent* are matched to
entities in *entity_info*. In case of no match, this
list gets extended. Starts from empty list if not given.
:type entity_info:
:class:`list` of
:class:`MMCifWriterEntity`
:type entity_info: :class:`MMCifWriterEntity
List
`
.. method:: GetEntities()
Returns
:class:`list` of
:class:`MMCifWriterEntity`. Useful to check after
Returns :class:`MMCifWriterEntity
List
`. Useful to check after
:func:`SetStructure` has been called. Order in this list defines entity
ids in written mmCIF file with zero based indexing.
...
...
This diff is collapsed.
Click to expand it.
modules/io/pymod/__init__.py
+
7
−
2
View file @
c7f3da8a
...
...
@@ -457,7 +457,8 @@ def LoadMMCIF(filename, fault_tolerant=None, calpha_only=None,
raise
def
SaveMMCIF
(
ent
,
filename
,
data_name
=
"
OST_structure
"
,
mmcif_conform
=
True
):
def
SaveMMCIF
(
ent
,
filename
,
data_name
=
"
OST_structure
"
,
mmcif_conform
=
True
,
entity_info
=
MMCifWriterEntityList
()):
"""
Save OpenStructure entity in mmCIF format
...
...
@@ -477,12 +478,16 @@ def SaveMMCIF(ent, filename, data_name="OST_structure", mmcif_conform = True):
to identify and separate mmCIF entities based on
:class:`ost.mol.ChemClass` of the residues in a chain.
:type ent: :class:`ost.mol.EntityHandle`/:class:`ost.mol.EntityView`
:param entity_info: Advanced usage - passed as *entity_info* parameter to
:func:`MMCifWriter.SetStructure`
:type filename: :class:`str`
:type data_name: :class:`str`
:type mmcif_conform: :class:`bool`
:type entity_info: :class:`MMCifWriterEntityList`
"""
writer
=
MMCifWriter
()
writer
.
SetStructure
(
ent
,
mmcif_conform
=
mmcif_conform
)
writer
.
SetStructure
(
ent
,
mmcif_conform
=
mmcif_conform
,
entity_info
=
entity_info
)
writer
.
Write
(
data_name
,
filename
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment