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
6e30365f
Unverified
Commit
6e30365f
authored
Apr 16, 2024
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
endl
parent
c0555b6d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
20 deletions
+20
-20
README.md
+4
-4
src/compound.cpp
+14
-14
src/utilities.cpp
+2
-2
No files found.
README.md
View file @
6e30365f
...
@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
...
@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
if
(
file
.
empty
())
if
(
file
.
empty
())
{
{
std
::
cerr
<<
"Empty file
"
<<
std
::
endl
;
std
::
cerr
<<
"Empty file
\n
"
;
exit
(
1
);
exit
(
1
);
}
}
...
@@ -66,8 +66,8 @@ int main(int argc, char *argv[])
...
@@ -66,8 +66,8 @@ int main(int argc, char *argv[])
auto
n
=
atom_site
.
count
(
cif
::
key
(
"label_atom_id"
)
==
"OXT"
);
auto
n
=
atom_site
.
count
(
cif
::
key
(
"label_atom_id"
)
==
"OXT"
);
std
::
cout
<<
"File contains "
<<
atom_site
.
size
()
<<
" atoms of which "
std
::
cout
<<
"File contains "
<<
atom_site
.
size
()
<<
" atoms of which "
<<
n
<<
(
n
==
1
?
" is"
:
" are"
)
<<
" OXT
"
<<
std
::
endl
<<
n
<<
(
n
==
1
?
" is"
:
" are"
)
<<
" OXT
\n
"
<<
"residues with an OXT are:
"
<<
std
::
endl
;
<<
"residues with an OXT are:
\n
"
;
// Loop over all atoms with atom-id "OXT" and print out some info.
// Loop over all atoms with atom-id "OXT" and print out some info.
// That info is extracted using structured binding in C++
// That info is extracted using structured binding in C++
...
@@ -76,7 +76,7 @@ int main(int argc, char *argv[])
...
@@ -76,7 +76,7 @@ int main(int argc, char *argv[])
cif
::
key
(
"label_atom_id"
)
==
"OXT"
,
cif
::
key
(
"label_atom_id"
)
==
"OXT"
,
"label_asym_id"
,
"label_comp_id"
,
"label_seq_id"
))
"label_asym_id"
,
"label_comp_id"
,
"label_seq_id"
))
{
{
std
::
cout
<<
asym
<<
' '
<<
comp
<<
' '
<<
seqnr
<<
std
::
endl
;
std
::
cout
<<
asym
<<
' '
<<
comp
<<
' '
<<
seqnr
<<
'\n'
;
}
}
return
0
;
return
0
;
...
...
src/compound.cpp
View file @
6e30365f
...
@@ -496,7 +496,7 @@ compound *compound_factory_impl::create(const std::string &id)
...
@@ -496,7 +496,7 @@ compound *compound_factory_impl::create(const std::string &id)
m_index
=
parser
.
index_datablocks
();
m_index
=
parser
.
index_datablocks
();
if
(
cif
::
VERBOSE
>
1
)
if
(
cif
::
VERBOSE
>
1
)
std
::
cout
<<
" done
"
<<
std
::
endl
;
std
::
cout
<<
" done
\n
"
;
// reload the resource, perhaps this should be improved...
// reload the resource, perhaps this should be improved...
if
(
m_file
.
empty
())
if
(
m_file
.
empty
())
...
@@ -519,7 +519,7 @@ compound *compound_factory_impl::create(const std::string &id)
...
@@ -519,7 +519,7 @@ compound *compound_factory_impl::create(const std::string &id)
parser
.
parse_single_datablock
(
id
,
m_index
);
parser
.
parse_single_datablock
(
id
,
m_index
);
if
(
cif
::
VERBOSE
>
1
)
if
(
cif
::
VERBOSE
>
1
)
std
::
cout
<<
" done
"
<<
std
::
endl
;
std
::
cout
<<
" done
\n
"
;
if
(
not
file
.
empty
())
if
(
not
file
.
empty
())
{
{
...
@@ -545,20 +545,20 @@ class local_compound_factory_impl : public compound_factory_impl
...
@@ -545,20 +545,20 @@ class local_compound_factory_impl : public compound_factory_impl
:
compound_factory_impl
(
next
)
:
compound_factory_impl
(
next
)
,
m_local_file
(
file
)
,
m_local_file
(
file
)
{
{
const
std
::
regex
peptideRx
(
"(?:[lmp]-)?peptide"
,
std
::
regex
::
icase
);
//
const std::regex peptideRx("(?:[lmp]-)?peptide", std::regex::icase);
for
(
const
auto
&
[
id
,
name
,
threeLetterCode
,
group
]
:
//
for (const auto &[id, name, threeLetterCode, group] :
file
[
"comp_list"
][
"chem_comp"
].
rows
<
std
::
string
,
std
::
string
,
std
::
string
,
std
::
string
>
(
"id"
,
"name"
,
"three_letter_code"
,
"group"
))
//
file["comp_list"]["chem_comp"].rows<std::string, std::string, std::string, std::string>("id", "name", "three_letter_code", "group"))
{
//
{
auto
&
rdb
=
m_local_file
[
"comp_"
+
id
];
//
auto &rdb = m_local_file["comp_" + id];
if
(
rdb
.
empty
())
//
if (rdb.empty())
{
//
{
std
::
cerr
<<
"Missing data in restraint file for id "
+
id
+
'\n'
;
// //
std::cerr << "Missing data in restraint file for id " + id + '\n';
continue
;
//
continue;
}
//
}
construct_compound
(
rdb
,
id
,
name
,
threeLetterCode
,
group
);
//
construct_compound(rdb, id, name, threeLetterCode, group);
}
//
}
}
}
compound
*
create
(
const
std
::
string
&
id
)
override
;
compound
*
create
(
const
std
::
string
&
id
)
override
;
...
...
src/utilities.cpp
View file @
6e30365f
...
@@ -235,7 +235,7 @@ void progress_bar_impl::print_progress()
...
@@ -235,7 +235,7 @@ void progress_bar_impl::print_progress()
float
progress
=
static_cast
<
float
>
(
m_consumed
)
/
m_max_value
;
float
progress
=
static_cast
<
float
>
(
m_consumed
)
/
m_max_value
;
if
(
width
<
kMinBarWidth
)
if
(
width
<
kMinBarWidth
)
std
::
cout
<<
(
100
*
progress
)
<<
'%'
<<
std
::
endl
;
std
::
cout
<<
(
100
*
progress
)
<<
"%
\n
"
;
else
else
{
{
uint32_t
bar_width
=
7
*
width
/
10
;
uint32_t
bar_width
=
7
*
width
/
10
;
...
@@ -329,7 +329,7 @@ void progress_bar_impl::print_done()
...
@@ -329,7 +329,7 @@ void progress_bar_impl::print_done()
if
(
msg
.
length
()
<
width
)
if
(
msg
.
length
()
<
width
)
msg
+=
std
::
string
(
width
-
msg
.
length
(),
' '
);
msg
+=
std
::
string
(
width
-
msg
.
length
(),
' '
);
std
::
cout
<<
'\r'
<<
msg
<<
std
::
endl
;
std
::
cout
<<
'\r'
<<
msg
<<
'\n'
;
}
}
progress_bar
::
progress_bar
(
int64_t
inMax
,
const
std
::
string
&
inAction
)
progress_bar
::
progress_bar
(
int64_t
inMax
,
const
std
::
string
&
inAction
)
...
...
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