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
021487ed
Unverified
Commit
021487ed
authored
Oct 18, 2021
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix reading mmCIF file where model is defined but model 1 is missing. Version bump.
parent
6b2c9dc3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
3 deletions
+35
-3
CMakeLists.txt
+1
-1
changelog
+4
-0
include/cif++/Structure.hpp
+2
-0
src/Structure.cpp
+28
-2
No files found.
CMakeLists.txt
View file @
021487ed
...
...
@@ -25,7 +25,7 @@
cmake_minimum_required
(
VERSION 3.16
)
# set the project name
project
(
cifpp VERSION 2.0.
2
LANGUAGES CXX
)
project
(
cifpp VERSION 2.0.
3
LANGUAGES CXX
)
list
(
PREPEND CMAKE_MODULE_PATH
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake"
)
...
...
changelog
View file @
021487ed
Version
2.0.3
-
Fixed
reading
mmCIF
files
where
model
numbers
are
used
and
model
number
1
is
missing
.
Version
2.0.2
-
Added
configuration
flag
to
disable
downloading
CCD
data
during
build
Note
that
there
are
now
two
flags
for
CCD
data
:
...
...
include/cif++/Structure.hpp
View file @
021487ed
...
...
@@ -533,6 +533,8 @@ class Structure
void
loadData
();
void
updateAtomIndex
();
void
loadAtomsForModel
(
StructureOpenOptions
options
);
File
&
mFile
;
size_t
mModelNr
;
AtomView
mAtoms
;
...
...
src/Structure.cpp
View file @
021487ed
...
...
@@ -1790,6 +1790,33 @@ Structure::Structure(File &f, size_t modelNr, StructureOpenOptions options)
auto
&
atomCat
=
(
*
db
)[
"atom_site"
];
loadAtomsForModel
(
options
);
// Check to see if we should actually load another model?
if
(
mAtoms
.
empty
()
and
mModelNr
==
1
)
{
std
::
optional
<
size_t
>
model_nr
;
cif
::
tie
(
model_nr
)
=
atomCat
.
front
().
get
(
"pdbx_PDB_model_num"
);
if
(
model_nr
and
*
model_nr
!=
mModelNr
)
{
if
(
cif
::
VERBOSE
)
std
::
cerr
<<
"No atoms loaded for model 1, trying model "
<<
*
model_nr
<<
std
::
endl
;
mModelNr
=
*
model_nr
;
loadAtomsForModel
(
options
);
}
}
if
(
mAtoms
.
empty
())
throw
std
::
runtime_error
(
"No atoms loaded, refuse to continue"
);
loadData
();
}
void
Structure
::
loadAtomsForModel
(
StructureOpenOptions
options
)
{
auto
db
=
mFile
.
impl
().
mDb
;
auto
&
atomCat
=
(
*
db
)[
"atom_site"
];
for
(
auto
&
a
:
atomCat
)
{
std
::
string
id
,
type_symbol
;
...
...
@@ -1805,10 +1832,9 @@ Structure::Structure(File &f, size_t modelNr, StructureOpenOptions options)
mAtoms
.
emplace_back
(
new
AtomImpl
(
*
db
,
id
,
a
));
}
loadData
();
}
Structure
::
Structure
(
const
Structure
&
s
)
:
mFile
(
s
.
mFile
)
,
mModelNr
(
s
.
mModelNr
)
...
...
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