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
fa8c653c
Commit
fa8c653c
authored
1 year ago
by
Studer Gabriel
Browse files
Options
Downloads
Patches
Plain Diff
mmcif writer: simplify
parent
f013fe21
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/io/src/mol/mmcif_writer.cc
+6
-32
6 additions, 32 deletions
modules/io/src/mol/mmcif_writer.cc
with
6 additions
and
32 deletions
modules/io/src/mol/mmcif_writer.cc
+
6
−
32
View file @
fa8c653c
...
...
@@ -194,7 +194,9 @@ namespace {
// - polymer
// - water
// this function won't identify macrolid
// this function is overly simplistic and won't identify macrolid or
// branched => explicitely checks for water, everything else is either
// non-polymer or polymer depending on number of residues
std
::
set
<
char
>
chem_classes
;
for
(
auto
res
:
res_list
)
{
...
...
@@ -207,41 +209,13 @@ namespace {
return
"water"
;
}
// check for non-polymer
if
(
res_list
.
size
()
==
1
)
{
return
"non-polymer"
;
}
// check for branched
std
::
set
<
char
>
sweet_set
;
sweet_set
.
insert
(
ost
::
mol
::
ChemClass
::
L_SACCHARIDE
);
sweet_set
.
insert
(
ost
::
mol
::
ChemClass
::
D_SACCHARIDE
);
sweet_set
.
insert
(
ost
::
mol
::
ChemClass
::
SACCHARIDE
);
// if the union of chem_classes and sweet_set has 3 elements, chem_classes
// only has sugars.
sweet_set
.
insert
(
chem_classes
.
begin
(),
chem_classes
.
end
());
if
(
sweet_set
.
size
()
==
3
)
{
return
"branched"
;
}
// DISCUSS THIS OVER A BEER...
// when arriving here, we excluded the possibility of branched and single
// residue chains.
// BUT: entities must have at least 3 residues to be considered polymers
// for now, we just set entities with 2 residues as non-polymer
if
(
res_list
.
size
()
==
2
)
{
// Entities must have at least 3 residues to be considered polymers
// for now, we just set entities with 1 or 2 residues as non-polymer
if
(
res_list
.
size
()
==
1
||
res_list
.
size
()
==
2
)
{
return
"non-polymer"
;
}
// If res_list represents a valid mmcif chain, chem_classes should only
// contain peptide- and nucleotide linking items
for
(
auto
it
:
chem_classes
)
{
ost
::
mol
::
ChemClass
chem_class
(
it
);
if
(
!
(
chem_class
.
IsPeptideLinking
()
||
chem_class
.
IsNucleotideLinking
()))
{
throw
ost
::
io
::
IOException
(
"Could not guess entity type"
);
}
}
return
"polymer"
;
}
...
...
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