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
cfa46ec9
Unverified
Commit
cfa46ec9
authored
Mar 23, 2023
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added model::has_atom_id
parent
90973dc5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
11 deletions
+41
-11
include/cif++/model.hpp
+1
-0
src/model.cpp
+36
-7
src/symop-map-generator.cpp
+4
-4
No files found.
include/cif++/model.hpp
View file @
cfa46ec9
...
...
@@ -752,6 +752,7 @@ class structure
const
std
::
vector
<
residue
>
&
non_polymers
()
const
{
return
m_non_polymers
;
}
bool
has_atom_id
(
const
std
::
string
&
id
)
const
;
atom
get_atom_by_id
(
const
std
::
string
&
id
)
const
;
// atom getAtomByLocation(point pt, float maxDistance) const;
...
...
src/model.cpp
View file @
cfa46ec9
...
...
@@ -290,12 +290,17 @@ int atom::atom_impl::get_charge() const
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
atom
&
atom
)
{
os
<<
atom
.
get_label_comp_id
()
<<
' '
<<
atom
.
get_label_asym_id
()
<<
':'
<<
atom
.
get_label_seq_id
()
<<
' '
<<
atom
.
get_label_atom_id
();
if
(
atom
.
is_water
())
os
<<
atom
.
get_label_comp_id
()
<<
' '
<<
atom
.
get_label_asym_id
()
<<
':'
<<
atom
.
get_auth_seq_id
()
<<
' '
<<
atom
.
get_label_atom_id
();
else
{
os
<<
atom
.
get_label_comp_id
()
<<
' '
<<
atom
.
get_label_asym_id
()
<<
':'
<<
atom
.
get_label_seq_id
()
<<
' '
<<
atom
.
get_label_atom_id
();
if
(
atom
.
is_alternate
())
os
<<
'('
<<
atom
.
get_label_alt_id
()
<<
')'
;
if
(
atom
.
get_auth_asym_id
()
!=
atom
.
get_label_asym_id
()
or
atom
.
get_auth_seq_id
()
!=
std
::
to_string
(
atom
.
get_label_seq_id
())
or
atom
.
get_pdb_ins_code
().
empty
()
==
false
)
os
<<
" ["
<<
atom
.
get_auth_asym_id
()
<<
':'
<<
atom
.
get_auth_seq_id
()
<<
atom
.
get_pdb_ins_code
()
<<
']'
;
if
(
atom
.
is_alternate
())
os
<<
'('
<<
atom
.
get_label_alt_id
()
<<
')'
;
if
(
atom
.
get_auth_asym_id
()
!=
atom
.
get_label_asym_id
()
or
atom
.
get_auth_seq_id
()
!=
std
::
to_string
(
atom
.
get_label_seq_id
())
or
atom
.
get_pdb_ins_code
().
empty
()
==
false
)
os
<<
" ["
<<
atom
.
get_auth_asym_id
()
<<
':'
<<
atom
.
get_auth_seq_id
()
<<
atom
.
get_pdb_ins_code
()
<<
']'
;
}
return
os
;
}
...
...
@@ -1545,6 +1550,20 @@ EntityType structure::get_entity_type_for_asym_id(const std::string asym_id) con
// return result;
// }
bool
structure
::
has_atom_id
(
const
std
::
string
&
id
)
const
{
bool
result
=
true
;
try
{
get_atom_by_id
(
id
);
}
catch
(...)
{
result
=
false
;
}
return
result
;
}
atom
structure
::
get_atom_by_id
(
const
std
::
string
&
id
)
const
{
assert
(
m_atoms
.
size
()
==
m_atom_index
.
size
());
...
...
@@ -1853,7 +1872,17 @@ void structure::remove_atom(atom &a, bool removeFromResidue)
auto
&
atomSite
=
m_db
[
"atom_site"
];
if
(
removeFromResidue
)
if
(
a
.
is_water
())
{
auto
ra
=
atomSite
.
find1
(
"id"
_key
==
a
.
id
());
if
(
ra
)
{
auto
&
nps
=
m_db
[
"pdbx_nonpoly_scheme"
];
for
(
auto
rnp
:
atomSite
.
get_children
(
ra
,
nps
))
nps
.
erase
(
rnp
);
}
}
else
if
(
removeFromResidue
)
{
try
{
...
...
@@ -2454,7 +2483,7 @@ void structure::create_water(row_initializer atom)
emplace_atom
(
std
::
make_shared
<
atom
::
atom_impl
>
(
m_db
,
atom_id
));
auto
&
pdbx_nonpoly_scheme
=
m_db
[
"pdbx_nonpoly_scheme"
];
size_t
ndb_nr
=
pdbx_nonpoly_scheme
.
find
(
"asym_id"
_key
==
asym_id
and
"entity_id"
_key
==
entity_id
).
size
(
)
+
1
;
int
ndb_nr
=
pdbx_nonpoly_scheme
.
find_max
<
int
>
(
"ndb_seq_num"
)
+
1
;
pdbx_nonpoly_scheme
.
emplace
({
{
"asym_id"
,
asym_id
},
{
"entity_id"
,
entity_id
},
...
...
src/symop-map-generator.cpp
View file @
cfa46ec9
...
...
@@ -261,7 +261,7 @@ int main(int argc, char* const argv[])
};
std
::
map
<
int
,
SymInfoBlock
>
symInfo
;
int
symopnr
,
mysymnr
=
10000
;
int
symopnr
=
0
,
mysymnr
=
10000
;
std
::
ifstream
file
(
input
);
if
(
not
file
.
is_open
())
...
...
@@ -383,10 +383,10 @@ const space_group kSpaceGroups[] =
old
=
'"'
+
old
+
'"'
+
std
::
string
(
20
-
old
.
length
(),
' '
);
xHM
=
'"'
+
xHM
+
'"'
+
std
::
string
(
30
-
xHM
.
length
(),
' '
);
for
(
std
::
string
::
size_type
p
=
Hall
.
length
();
p
>
0
;
--
p
)
for
(
auto
p
=
Hall
.
begin
();
p
!=
Hall
.
end
();
++
p
)
{
if
(
Hall
[
p
-
1
]
==
'"'
)
Hall
.
insert
(
p
-
1
,
"
\\
"
,
1
)
;
if
(
*
p
==
'"'
)
p
=
Hall
.
insert
(
p
,
'\\'
)
+
1
;
}
Hall
=
'"'
+
Hall
+
'"'
+
std
::
string
(
40
-
Hall
.
length
(),
' '
);
...
...
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