Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
libcifpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
libcifpp
Commits
821895bb
Unverified
Commit
821895bb
authored
Sep 05, 2023
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
backup of documentation
parent
3f437277
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
9 deletions
+38
-9
include/cif++/compound.hpp
+11
-5
include/cif++/condition.hpp
+0
-0
src/compound.cpp
+27
-4
No files found.
include/cif++/compound.hpp
View file @
821895bb
...
...
@@ -72,10 +72,10 @@ enum class bond_type
};
/// @brief return the string representation of @ref bond_type @a bondType
std
::
string
to_string
(
bond_type
bondType
);
std
::
string
bond_type_
to_string
(
bond_type
bondType
);
/// @brief return the @ref bond_type for the string representation @a bondType
bond_type
from_string
(
const
std
::
string
&
bondType
);
bond_type
parse_bond_type_
from_string
(
const
std
::
string
&
bondType
);
/// \brief The possible stereo config values for a compound_atom.
///
...
...
@@ -89,11 +89,17 @@ bond_type from_string(const std::string &bondType);
/// > referred to ‘S isomers’.
enum
class
stereo_config_type
:
uint8_t
{
N
=
'N'
,
R
=
'R'
,
S
=
'S'
N
=
'N'
,
///< Not polarizing
R
=
'R'
,
///< Rectus
S
=
'S'
///< Sinister
};
/// @brief return the string representation of @ref stereo_config_type @a stereo_config
std
::
string
to_string
(
stereo_config_type
stereo_config
);
/// @brief return the @ref stereo_config_type for the string representation @a stereo_config
stereo_config_type
parse_stereo_config_from_string
(
const
std
::
string
&
stereo_config
);
/// --------------------------------------------------------------------
/// \brief struct containing information about an atom in a chemical compound.
/// This is a subset of the available information. Contact the author if you need more fields.
...
...
include/cif++/condition.hpp
View file @
821895bb
This diff is collapsed.
Click to expand it.
src/compound.cpp
View file @
821895bb
...
...
@@ -56,7 +56,7 @@ std::string to_string(bond_type bondType)
throw
std
::
invalid_argument
(
"Invalid bondType"
);
}
bond_type
from_string
(
const
std
::
string
&
bondType
)
bond_type
parse_bond_type_
from_string
(
const
std
::
string
&
bondType
)
{
if
(
cif
::
iequals
(
bondType
,
"sing"
))
return
bond_type
::
sing
;
...
...
@@ -77,6 +77,28 @@ bond_type from_string(const std::string &bondType)
throw
std
::
invalid_argument
(
"Invalid bondType: "
+
bondType
);
}
std
::
string
to_string
(
stereo_config_type
stereoConfig
)
{
switch
(
stereoConfig
)
{
case
stereo_config_type
:
:
N
:
return
"N"
;
case
stereo_config_type
:
:
R
:
return
"R"
;
case
stereo_config_type
:
:
S
:
return
"S"
;
}
throw
std
::
invalid_argument
(
"Invalid stereoConfig"
);
}
stereo_config_type
parse_stereo_config_from_string
(
const
std
::
string
&
stereoConfig
)
{
if
(
cif
::
iequals
(
stereoConfig
,
"N"
))
return
stereo_config_type
::
N
;
if
(
cif
::
iequals
(
stereoConfig
,
"R"
))
return
stereo_config_type
::
R
;
if
(
cif
::
iequals
(
stereoConfig
,
"S"
))
return
stereo_config_type
::
S
;
throw
std
::
invalid_argument
(
"Invalid stereoConfig: "
+
stereoConfig
);
}
// --------------------------------------------------------------------
// compound helper classes
...
...
@@ -126,11 +148,12 @@ compound::compound(cif::datablock &db)
for
(
auto
row
:
chemCompAtom
)
{
compound_atom
atom
;
std
::
string
type_symbol
;
cif
::
tie
(
atom
.
id
,
type_symbol
,
atom
.
charge
,
atom
.
aromatic
,
atom
.
leaving_atom
,
atom
.
stereo_config
,
atom
.
x
,
atom
.
y
,
atom
.
z
)
=
std
::
string
type_symbol
,
stereo_config
;
cif
::
tie
(
atom
.
id
,
type_symbol
,
atom
.
charge
,
atom
.
aromatic
,
atom
.
leaving_atom
,
stereo_config
,
atom
.
x
,
atom
.
y
,
atom
.
z
)
=
row
.
get
(
"atom_id"
,
"type_symbol"
,
"charge"
,
"pdbx_aromatic_flag"
,
"pdbx_leaving_atom_flag"
,
"pdbx_stereo_config"
,
"model_Cartn_x"
,
"model_Cartn_y"
,
"model_Cartn_z"
);
atom
.
type_symbol
=
atom_type_traits
(
type_symbol
).
type
();
atom
.
stereo_config
=
parse_stereo_config_from_string
(
stereo_config
);
m_atoms
.
push_back
(
std
::
move
(
atom
));
}
...
...
@@ -140,7 +163,7 @@ compound::compound(cif::datablock &db)
compound_bond
bond
;
std
::
string
valueOrder
;
cif
::
tie
(
bond
.
atom_id
[
0
],
bond
.
atom_id
[
1
],
valueOrder
,
bond
.
aromatic
,
bond
.
stereo_config
)
=
row
.
get
(
"atom_id_1"
,
"atom_id_2"
,
"value_order"
,
"pdbx_aromatic_flag"
,
"pdbx_stereo_config"
);
bond
.
type
=
from_string
(
valueOrder
);
bond
.
type
=
parse_bond_type_
from_string
(
valueOrder
);
m_bonds
.
push_back
(
std
::
move
(
bond
));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment