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
b7330c07
Unverified
Commit
b7330c07
authored
Nov 16, 2021
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Structure::changeResidue to actually change the residue itself as well.
parent
e8f41230
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
include/cif++/Structure.hpp
+9
-1
src/Structure.cpp
+13
-1
No files found.
include/cif++/Structure.hpp
View file @
b7330c07
...
...
@@ -236,6 +236,8 @@ class Residue
Atom
atomByID
(
const
std
::
string
&
atomID
)
const
;
const
std
::
string
&
compoundID
()
const
{
return
mCompoundID
;
}
void
setCompoundID
(
const
std
::
string
&
id
)
{
mCompoundID
=
id
;
}
const
std
::
string
&
asymID
()
const
{
return
mAsymID
;
}
int
seqID
()
const
{
return
mSeqID
;
}
std
::
string
entityID
()
const
;
...
...
@@ -470,9 +472,15 @@ class Structure
/// \brief Get a residue, if \a seqID is zero, the non-polymers are searched
const
Residue
&
getResidue
(
const
std
::
string
&
asymID
,
const
std
::
string
&
compID
,
int
seqID
=
0
)
const
;
/// \brief Get a residue, if \a seqID is zero, the non-polymers are searched
Residue
&
getResidue
(
const
std
::
string
&
asymID
,
const
std
::
string
&
compID
,
int
seqID
=
0
);
/// \brief Get a the single residue for an asym with id \a asymID
const
Residue
&
getResidue
(
const
std
::
string
&
asymID
)
const
;
/// \brief Get a the single residue for an asym with id \a asymID
Residue
&
getResidue
(
const
std
::
string
&
asymID
);
// map between auth and label locations
std
::
tuple
<
std
::
string
,
int
,
std
::
string
>
MapAuthToLabel
(
const
std
::
string
&
asymID
,
...
...
@@ -497,7 +505,7 @@ class Structure
void
removeAtom
(
Atom
&
a
);
void
swapAtoms
(
Atom
&
a1
,
Atom
&
a2
);
// swap the labels for these atoms
void
moveAtom
(
Atom
&
a
,
Point
p
);
// move atom to a new location
void
changeResidue
(
const
Residue
&
res
,
const
std
::
string
&
newCompound
,
void
changeResidue
(
Residue
&
res
,
const
std
::
string
&
newCompound
,
const
std
::
vector
<
std
::
tuple
<
std
::
string
,
std
::
string
>>
&
remappedAtoms
);
/// \brief Create a new non-polymer entity, returns new ID
...
...
src/Structure.cpp
View file @
b7330c07
...
...
@@ -2075,6 +2075,11 @@ const Residue &Structure::getResidue(const std::string &asymID, const std::strin
throw
std
::
out_of_range
(
"Could not find residue "
+
asymID
+
'/'
+
std
::
to_string
(
seqID
));
}
Residue
&
Structure
::
getResidue
(
const
std
::
string
&
asymID
,
const
std
::
string
&
compID
,
int
seqID
)
{
return
const_cast
<
Residue
&>
(
const_cast
<
Structure
const
&>
(
*
this
).
getResidue
(
asymID
,
compID
,
seqID
));
}
const
Residue
&
Structure
::
getResidue
(
const
std
::
string
&
asymID
)
const
{
for
(
auto
&
res
:
mNonPolymers
)
...
...
@@ -2088,6 +2093,11 @@ const Residue &Structure::getResidue(const std::string &asymID) const
throw
std
::
out_of_range
(
"Could not find residue "
+
asymID
);
}
Residue
&
Structure
::
getResidue
(
const
std
::
string
&
asymID
)
{
return
const_cast
<
Residue
&>
(
const_cast
<
Structure
const
&>
(
*
this
).
getResidue
(
asymID
));
}
File
&
Structure
::
getFile
()
const
{
return
mFile
;
...
...
@@ -2426,7 +2436,7 @@ void Structure::moveAtom(Atom &a, Point p)
a
.
location
(
p
);
}
void
Structure
::
changeResidue
(
const
Residue
&
res
,
const
std
::
string
&
newCompound
,
void
Structure
::
changeResidue
(
Residue
&
res
,
const
std
::
string
&
newCompound
,
const
std
::
vector
<
std
::
tuple
<
std
::
string
,
std
::
string
>>
&
remappedAtoms
)
{
using
namespace
cif
::
literals
;
...
...
@@ -2490,6 +2500,8 @@ void Structure::changeResidue(const Residue &res, const std::string &newCompound
else
insertCompound
(
newCompound
,
false
);
res
.
setCompoundID
(
newCompound
);
auto
&
atomSites
=
db
[
"atom_site"
];
auto
atoms
=
res
.
atoms
();
...
...
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