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
c584714f
Unverified
Commit
c584714f
authored
Mar 09, 2022
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ion radii
parent
f5016403
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
13 deletions
+81
-13
include/cif++/AtomType.hpp
+41
-13
include/cif++/Structure.hpp
+2
-0
src/AtomType.cpp
+0
-0
src/Structure.cpp
+38
-0
No files found.
include/cif++/AtomType.hpp
View file @
c584714f
...
@@ -172,19 +172,26 @@ enum AtomType : uint8_t
...
@@ -172,19 +172,26 @@ enum AtomType : uint8_t
// --------------------------------------------------------------------
// --------------------------------------------------------------------
// AtomTypeInfo
// AtomTypeInfo
enum
RadiusType
enum
class
RadiusType
{
{
eRadius
Calculated
,
Calculated
,
eRadius
Empirical
,
Empirical
,
eRadius
CovalentEmpirical
,
CovalentEmpirical
,
eRadius
SingleBond
,
SingleBond
,
eRadius
DoubleBond
,
DoubleBond
,
eRadius
TripleBond
,
TripleBond
,
eRadius
VanderWaals
,
VanderWaals
,
eRadiusTypeCount
TypeCount
};
constexpr
size_t
RadiusTypeCount
=
static_cast
<
size_t
>
(
RadiusType
::
TypeCount
);
enum
class
IonicRadiusType
{
Effective
,
Crystal
};
};
struct
AtomTypeInfo
struct
AtomTypeInfo
...
@@ -194,7 +201,7 @@ struct AtomTypeInfo
...
@@ -194,7 +201,7 @@ struct AtomTypeInfo
std
::
string
symbol
;
std
::
string
symbol
;
float
weight
;
float
weight
;
bool
metal
;
bool
metal
;
float
radii
[
e
RadiusTypeCount
];
float
radii
[
RadiusTypeCount
];
};
};
extern
const
AtomTypeInfo
kKnownAtoms
[];
extern
const
AtomTypeInfo
kKnownAtoms
[];
...
@@ -218,11 +225,32 @@ class AtomTypeTraits
...
@@ -218,11 +225,32 @@ class AtomTypeTraits
static
bool
isElement
(
const
std
::
string
&
symbol
);
static
bool
isElement
(
const
std
::
string
&
symbol
);
static
bool
isMetal
(
const
std
::
string
&
symbol
);
static
bool
isMetal
(
const
std
::
string
&
symbol
);
float
radius
(
RadiusType
type
=
eRadius
SingleBond
)
const
float
radius
(
RadiusType
type
=
RadiusType
::
SingleBond
)
const
{
{
if
(
type
>=
eRadius
TypeCount
)
if
(
type
>=
RadiusType
::
TypeCount
)
throw
std
::
invalid_argument
(
"invalid radius requested"
);
throw
std
::
invalid_argument
(
"invalid radius requested"
);
return
mInfo
->
radii
[
type
]
/
100.
f
;
return
mInfo
->
radii
[
static_cast
<
size_t
>
(
type
)]
/
100.
f
;
}
/// \brief Return the radius for a charged version of this atom in a solid crystal
///
/// \param charge The charge of the ion
/// \return The radius of the ion
float
crystal_ionic_radius
(
int
charge
)
const
;
/// \brief Return the radius for a charged version of this atom in a non-solid environment
///
/// \param charge The charge of the ion
/// \return The radius of the ion
float
effective_ionic_radius
(
int
charge
)
const
;
/// \brief Return the radius for a charged version of this atom, returns the effective radius by default
///
/// \param charge The charge of the ion
/// \return The radius of the ion
float
ionic_radius
(
int
charge
,
IonicRadiusType
type
=
IonicRadiusType
::
Effective
)
const
{
return
type
==
IonicRadiusType
::
Effective
?
effective_ionic_radius
(
charge
)
:
crystal_ionic_radius
(
charge
);
}
}
// data type encapsulating the Waasmaier & Kirfel scattering factors
// data type encapsulating the Waasmaier & Kirfel scattering factors
...
...
include/cif++/Structure.hpp
View file @
c584714f
...
@@ -312,6 +312,8 @@ class Residue
...
@@ -312,6 +312,8 @@ class Residue
virtual
~
Residue
();
virtual
~
Residue
();
const
Compound
&
compound
()
const
;
const
Compound
&
compound
()
const
;
AtomView
&
atoms
();
const
AtomView
&
atoms
()
const
;
const
AtomView
&
atoms
()
const
;
void
addAtom
(
const
Atom
&
atom
)
void
addAtom
(
const
Atom
&
atom
)
...
...
src/AtomType.cpp
View file @
c584714f
This diff is collapsed.
Click to expand it.
src/Structure.cpp
View file @
c584714f
...
@@ -444,6 +444,14 @@ const Compound &Residue::compound() const
...
@@ -444,6 +444,14 @@ const Compound &Residue::compound() const
return
*
result
;
return
*
result
;
}
}
AtomView
&
Residue
::
atoms
()
{
if
(
mStructure
==
nullptr
)
throw
std
::
runtime_error
(
"Invalid Residue object"
);
return
mAtoms
;
}
const
AtomView
&
Residue
::
atoms
()
const
const
AtomView
&
Residue
::
atoms
()
const
{
{
if
(
mStructure
==
nullptr
)
if
(
mStructure
==
nullptr
)
...
@@ -1990,6 +1998,21 @@ std::string Structure::createNonpoly(const std::string &entity_id, const std::ve
...
@@ -1990,6 +1998,21 @@ std::string Structure::createNonpoly(const std::string &entity_id, const std::ve
res
.
addAtom
(
newAtom
);
res
.
addAtom
(
newAtom
);
}
}
auto
&
pdbx_nonpoly_scheme
=
db
[
"pdbx_nonpoly_scheme"
];
int
ndb_nr
=
pdbx_nonpoly_scheme
.
find
(
"asym_id"
_key
==
asym_id
and
"entity_id"
_key
==
entity_id
).
size
()
+
1
;
pdbx_nonpoly_scheme
.
emplace
({
{
"asym_id"
,
asym_id
},
{
"entity_id"
,
entity_id
},
{
"mon_id"
,
comp_id
},
{
"ndb_seq_num"
,
ndb_nr
},
{
"pdb_seq_num"
,
res
.
authSeqID
()
},
{
"auth_seq_num"
,
res
.
authSeqID
()
},
{
"pdb_mon_id"
,
comp_id
},
{
"auth_mon_id"
,
comp_id
},
{
"pdb_strand_id"
,
asym_id
},
{
"pdb_ins_code"
,
"."
},
});
return
asym_id
;
return
asym_id
;
}
}
...
@@ -2041,6 +2064,21 @@ std::string Structure::createNonpoly(const std::string &entity_id, std::vector<s
...
@@ -2041,6 +2064,21 @@ std::string Structure::createNonpoly(const std::string &entity_id, std::vector<s
res
.
addAtom
(
newAtom
);
res
.
addAtom
(
newAtom
);
}
}
auto
&
pdbx_nonpoly_scheme
=
db
[
"pdbx_nonpoly_scheme"
];
int
ndb_nr
=
pdbx_nonpoly_scheme
.
find
(
"asym_id"
_key
==
asym_id
and
"entity_id"
_key
==
entity_id
).
size
()
+
1
;
pdbx_nonpoly_scheme
.
emplace
({
{
"asym_id"
,
asym_id
},
{
"entity_id"
,
entity_id
},
{
"mon_id"
,
comp_id
},
{
"ndb_seq_num"
,
ndb_nr
},
{
"pdb_seq_num"
,
res
.
authSeqID
()
},
{
"auth_seq_num"
,
res
.
authSeqID
()
},
{
"pdb_mon_id"
,
comp_id
},
{
"auth_mon_id"
,
comp_id
},
{
"pdb_strand_id"
,
asym_id
},
{
"pdb_ins_code"
,
"."
},
});
return
asym_id
;
return
asym_id
;
}
}
...
...
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