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
3ba46893
Unverified
Commit
3ba46893
authored
Oct 18, 2021
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of github.com:PDB-REDO/libcifpp into develop
parents
7513cc19
45f33e4b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
7 deletions
+40
-7
changelog
+4
-0
include/cif++/Structure.hpp
+2
-0
src/Compound.cpp
+6
-5
src/Structure.cpp
+28
-2
No files found.
changelog
View file @
3ba46893
...
@@ -3,6 +3,10 @@ Version 3.0.0
...
@@ -3,6 +3,10 @@ Version 3.0.0
performance
reasons
.
performance
reasons
.
-
Upgraded
mmcif
::
Structure
-
Upgraded
mmcif
::
Structure
Version
2.0.3
-
Fixed
reading
mmCIF
files
where
model
numbers
are
used
and
model
number
1
is
missing
.
Version
2.0.2
Version
2.0.2
-
Added
configuration
flag
to
disable
downloading
CCD
data
during
build
-
Added
configuration
flag
to
disable
downloading
CCD
data
during
build
Note
that
there
are
now
two
flags
for
CCD
data
:
Note
that
there
are
now
two
flags
for
CCD
data
:
...
...
include/cif++/Structure.hpp
View file @
3ba46893
...
@@ -543,6 +543,8 @@ class Structure
...
@@ -543,6 +543,8 @@ class Structure
void
loadData
();
void
loadData
();
void
updateAtomIndex
();
void
updateAtomIndex
();
void
loadAtomsForModel
(
StructureOpenOptions
options
);
File
&
mFile
;
File
&
mFile
;
size_t
mModelNr
;
size_t
mModelNr
;
AtomView
mAtoms
;
AtomView
mAtoms
;
...
...
src/Compound.cpp
View file @
3ba46893
...
@@ -636,17 +636,18 @@ void CompoundFactory::init(bool useThreadLocalInstanceOnly)
...
@@ -636,17 +636,18 @@ void CompoundFactory::init(bool useThreadLocalInstanceOnly)
CompoundFactory
::
CompoundFactory
()
CompoundFactory
::
CompoundFactory
()
:
mImpl
(
nullptr
)
:
mImpl
(
nullptr
)
{
{
auto
ccd
=
cif
::
loadResource
(
"components.cif"
);
if
(
ccd
)
mImpl
.
reset
(
new
CCDCompoundFactoryImpl
(
mImpl
));
else
if
(
cif
::
VERBOSE
)
std
::
cerr
<<
"CCD components.cif file was not found"
<<
std
::
endl
;
const
char
*
clibd_mon
=
getenv
(
"CLIBD_MON"
);
const
char
*
clibd_mon
=
getenv
(
"CLIBD_MON"
);
if
(
clibd_mon
!=
nullptr
and
fs
::
is_directory
(
clibd_mon
))
if
(
clibd_mon
!=
nullptr
and
fs
::
is_directory
(
clibd_mon
))
mImpl
.
reset
(
new
CCP4CompoundFactoryImpl
(
clibd_mon
));
mImpl
.
reset
(
new
CCP4CompoundFactoryImpl
(
clibd_mon
));
else
if
(
cif
::
VERBOSE
)
else
if
(
cif
::
VERBOSE
)
std
::
cerr
<<
"CCP4 monomers library not found, CLIBD_MON is not defined"
<<
std
::
endl
;
std
::
cerr
<<
"CCP4 monomers library not found, CLIBD_MON is not defined"
<<
std
::
endl
;
auto
ccd
=
cif
::
loadResource
(
"components.cif"
);
if
(
ccd
)
mImpl
.
reset
(
new
CCDCompoundFactoryImpl
(
mImpl
));
else
if
(
cif
::
VERBOSE
)
std
::
cerr
<<
"CCD components.cif file was not found"
<<
std
::
endl
;
}
}
CompoundFactory
::~
CompoundFactory
()
CompoundFactory
::~
CompoundFactory
()
...
...
src/Structure.cpp
View file @
3ba46893
...
@@ -1790,6 +1790,33 @@ Structure::Structure(File &f, size_t modelNr, StructureOpenOptions options)
...
@@ -1790,6 +1790,33 @@ Structure::Structure(File &f, size_t modelNr, StructureOpenOptions options)
auto
&
atomCat
=
(
*
db
)[
"atom_site"
];
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
)
for
(
auto
&
a
:
atomCat
)
{
{
std
::
string
id
,
type_symbol
;
std
::
string
id
,
type_symbol
;
...
@@ -1805,10 +1832,9 @@ Structure::Structure(File &f, size_t modelNr, StructureOpenOptions options)
...
@@ -1805,10 +1832,9 @@ Structure::Structure(File &f, size_t modelNr, StructureOpenOptions options)
mAtoms
.
emplace_back
(
new
AtomImpl
(
*
db
,
id
,
a
));
mAtoms
.
emplace_back
(
new
AtomImpl
(
*
db
,
id
,
a
));
}
}
loadData
();
}
}
Structure
::
Structure
(
const
Structure
&
s
)
Structure
::
Structure
(
const
Structure
&
s
)
:
mFile
(
s
.
mFile
)
:
mFile
(
s
.
mFile
)
,
mModelNr
(
s
.
mModelNr
)
,
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