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
dbe40e3a
Unverified
Commit
dbe40e3a
authored
Nov 06, 2023
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No longer use mon_lib_list as check for existence of compound
parent
958d3b05
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
19 deletions
+15
-19
src/compound.cpp
+15
-19
No files found.
src/compound.cpp
View file @
dbe40e3a
...
...
@@ -592,18 +592,17 @@ class CCP4_compound_factory_impl : public compound_factory_impl
compound
*
create
(
const
std
::
string
&
id
)
override
;
private
:
cif
::
file
m_file
;
fs
::
path
m_CLIBD_MON
;
};
CCP4_compound_factory_impl
::
CCP4_compound_factory_impl
(
const
fs
::
path
&
clibd_mon
,
std
::
shared_ptr
<
compound_factory_impl
>
next
)
:
compound_factory_impl
(
next
)
,
m_file
((
clibd_mon
/
"list"
/
"mon_lib_list.cif"
).
string
())
,
m_CLIBD_MON
(
clibd_mon
)
{
const
std
::
regex
peptideRx
(
"(?:[lmp]-)?peptide"
,
std
::
regex
::
icase
);
auto
&
chemComps
=
m_file
[
"comp_list"
][
"chem_comp"
];
cif
::
file
file
(
m_CLIBD_MON
/
"list"
/
"mon_lib_list.cif"
);
auto
&
chemComps
=
file
[
"comp_list"
][
"chem_comp"
];
for
(
const
auto
&
[
group
,
comp_id
]
:
chemComps
.
rows
<
std
::
string
,
std
::
string
>
(
"group"
,
"id"
))
{
...
...
@@ -618,27 +617,24 @@ compound *CCP4_compound_factory_impl::create(const std::string &id)
{
compound
*
result
=
nullptr
;
auto
&
cat
=
m_file
[
"comp_list"
][
"chem_comp"
]
;
fs
::
path
resFile
=
m_CLIBD_MON
/
cif
::
to_lower_copy
(
id
.
substr
(
0
,
1
))
/
(
id
+
".cif"
)
;
auto
rs
=
cat
.
find
(
cif
::
key
(
"id"
)
==
id
);
if
(
not
fs
::
exists
(
resFile
)
and
(
id
==
"COM"
or
id
==
"CON"
or
"PRN"
))
// seriously...
resFile
=
m_CLIBD_MON
/
cif
::
to_lower_copy
(
id
.
substr
(
0
,
1
))
/
(
id
+
'_'
+
id
+
".cif"
);
if
(
rs
.
size
()
==
1
)
if
(
fs
::
exists
(
resFile
)
)
{
auto
row
=
rs
.
front
(
);
cif
::
file
cf
(
resFile
.
string
()
);
std
::
string
name
,
group
;
uint32_t
numberAtomsAll
,
numberAtomsNh
;
cif
::
tie
(
name
,
group
,
numberAtomsAll
,
numberAtomsNh
)
=
row
.
get
(
"name"
,
"group"
,
"number_atoms_all"
,
"number_atoms_nh"
);
fs
::
path
resFile
=
m_CLIBD_MON
/
cif
::
to_lower_copy
(
id
.
substr
(
0
,
1
))
/
(
id
+
".cif"
);
if
(
not
fs
::
exists
(
resFile
)
and
(
id
==
"COM"
or
id
==
"CON"
or
"PRN"
))
// seriously...
resFile
=
m_CLIBD_MON
/
cif
::
to_lower_copy
(
id
.
substr
(
0
,
1
))
/
(
id
+
'_'
+
id
+
".cif"
);
if
(
fs
::
exists
(
resFile
))
auto
&
db_list
=
cf
[
"comp_list"
];
auto
list
=
db_list
[
"chem_comp"
];
if
(
list
.
size
()
==
1
)
{
cif
::
file
cf
(
resFile
.
string
());
std
::
string
name
,
group
;
uint32_t
numberAtomsAll
,
numberAtomsNh
;
cif
::
tie
(
name
,
group
,
numberAtomsAll
,
numberAtomsNh
)
=
list
.
front
().
get
(
"name"
,
"group"
,
"number_atoms_all"
,
"number_atoms_nh"
);
// locate the datablock
auto
&
db
=
cf
[
"comp_"
+
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