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
cf6facd1
Commit
cf6facd1
authored
1 year ago
by
Studer Gabriel
Browse files
Options
Downloads
Patches
Plain Diff
mmcif writer: introduce EntityToMMCifString
parent
7f9090e4
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
modules/io/pymod/export_mmcif_io.cc
+20
-0
20 additions, 0 deletions
modules/io/pymod/export_mmcif_io.cc
modules/io/src/mol/mmcif_str.cc
+19
-0
19 additions, 0 deletions
modules/io/src/mol/mmcif_str.cc
modules/io/src/mol/mmcif_str.hh
+8
-0
8 additions, 0 deletions
modules/io/src/mol/mmcif_str.hh
with
47 additions
and
0 deletions
modules/io/pymod/export_mmcif_io.cc
+
20
−
0
View file @
cf6facd1
...
...
@@ -57,6 +57,18 @@ boost::python::tuple WrapMMCifStringToEntity(const String& mmcif,
std
::
get
<
2
>
(
res
));
}
String
WrapEntityToMMCifStringEnt
(
const
ost
::
mol
::
EntityHandle
&
ent
,
const
String
&
data_name
,
bool
mmcif_conform
)
{
return
EntityToMMCifString
(
ent
,
data_name
,
mmcif_conform
);
}
String
WrapEntityToMMCifStringView
(
const
ost
::
mol
::
EntityView
&
ent
,
const
String
&
data_name
,
bool
mmcif_conform
)
{
return
EntityToMMCifString
(
ent
,
data_name
,
mmcif_conform
);
}
void
WrapStarLoopAddData
(
StarWriterLoop
&
sl
,
const
boost
::
python
::
list
&
l
)
{
std
::
vector
<
StarWriterValue
>
v
;
for
(
int
i
=
0
;
i
<
boost
::
python
::
len
(
l
);
++
i
){
...
...
@@ -516,4 +528,12 @@ void export_mmcif_io()
def
(
"MMCifStrToEntity"
,
&
WrapMMCifStringToEntity
,
(
arg
(
"pdb_string"
),
arg
(
"profile"
)
=
IOProfile
(),
arg
(
"process"
)
=
false
));
def
(
"EntityToMMCifString"
,
&
WrapEntityToMMCifStringEnt
,
(
arg
(
"ent"
),
arg
(
"data_name"
)
=
"OST_structure"
,
arg
(
"mmcif_conform"
)
=
true
));
def
(
"EntityToMMCifString"
,
&
WrapEntityToMMCifStringView
,
(
arg
(
"ent"
),
arg
(
"data_name"
)
=
"OST_structure"
,
arg
(
"mmcif_conform"
)
=
true
));
}
This diff is collapsed.
Click to expand it.
modules/io/src/mol/mmcif_str.cc
+
19
−
0
View file @
cf6facd1
...
...
@@ -19,9 +19,28 @@
#include
<sstream>
#include
<ost/io/mol/mmcif_str.hh>
#include
<ost/io/mol/mmcif_reader.hh>
#include
<ost/io/mmcif_writer.hh>
namespace
ost
{
namespace
io
{
String
EntityToMMCifString
(
const
ost
::
mol
::
EntityHandle
&
ent
,
const
String
&
data_name
,
bool
mmcif_conform
)
{
std
::
stringstream
ss
;
MMCifWriter
writer
;
writer
.
SetStructure
(
ent
,
mmcif_conform
);
writer
.
Write
(
data_name
,
ss
);
return
ss
.
str
();
}
String
EntityToMMCifString
(
const
ost
::
mol
::
EntityView
&
ent
,
const
String
&
data_name
,
bool
mmcif_conform
)
{
std
::
stringstream
ss
;
MMCifWriter
writer
;
writer
.
SetStructure
(
ent
,
mmcif_conform
);
writer
.
Write
(
data_name
,
ss
);
return
ss
.
str
();
}
std
::
tuple
<
mol
::
EntityHandle
,
MMCifInfo
,
ost
::
seq
::
SequenceList
>
MMCifStringToEntity
(
const
String
&
mmcif
,
const
IOProfile
&
profile
,
bool
process
)
{
std
::
stringstream
stream
(
mmcif
);
...
...
This diff is collapsed.
Click to expand it.
modules/io/src/mol/mmcif_str.hh
+
8
−
0
View file @
cf6facd1
...
...
@@ -27,6 +27,14 @@
namespace
ost
{
namespace
io
{
String
DLLEXPORT_OST_IO
EntityToMMCifString
(
const
ost
::
mol
::
EntityHandle
&
ent
,
const
String
&
data_name
,
bool
mmcif_conform
);
String
DLLEXPORT_OST_IO
EntityToMMCifString
(
const
ost
::
mol
::
EntityView
&
ent
,
const
String
&
data_name
,
bool
mmcif_conform
);
std
::
tuple
<
mol
::
EntityHandle
,
MMCifInfo
,
ost
::
seq
::
SequenceList
>
DLLEXPORT_OST_IO
MMCifStringToEntity
(
const
String
&
mmcif
,
const
IOProfile
&
profile
,
bool
process
);
...
...
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