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
4de981a3
Unverified
Commit
4de981a3
authored
Jan 31, 2023
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better handling of missing residues in pdb2cif
parent
15db026e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
80 deletions
+65
-80
include/cif++/model.hpp
+0
-26
src/model.cpp
+35
-31
src/pdb/pdb2cif.cpp
+30
-23
No files found.
include/cif++/model.hpp
View file @
4de981a3
...
...
@@ -321,13 +321,6 @@ class atom
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
atom
&
atom
);
// /// \brief Synchronize data with underlying cif data
// void sync()
// {
// if (m_impl)
// m_impl->prefetch();
// }
private
:
friend
class
structure
;
...
...
@@ -341,25 +334,6 @@ class atom
std
::
shared_ptr
<
atom_impl
>
m_impl
;
};
// template <>
// inline std::string atom::get_property<std::string>(const std::string_view name) const
// {
// return get_property(name);
// }
// template <>
// inline int atom::get_property<int>(const std::string_view name) const
// {
// auto v = impl().get_property(name);
// return v.empty() ? 0 : stoi(v);
// }
// template <>
// inline float atom::get_property<float>(const std::string_view name) const
// {
// return stof(impl().get_property(name));
// }
inline
void
swap
(
atom
&
a
,
atom
&
b
)
{
a
.
swap
(
b
);
...
...
src/model.cpp
View file @
4de981a3
...
...
@@ -618,20 +618,20 @@ float monomer::phi() const
{
float
result
=
360
;
try
if
(
m_index
>
0
)
{
if
(
m_index
>
0
)
auto
&
prev
=
m_polymer
->
operator
[](
m_index
-
1
);
if
(
prev
.
m_seq_id
+
1
==
m_seq_id
)
{
auto
&
prev
=
m_polymer
->
operator
[](
m_index
-
1
);
if
(
prev
.
m_seq_id
+
1
==
m_seq_id
)
result
=
static_cast
<
float
>
(
dihedral_angle
(
prev
.
C
().
get_location
(),
N
().
get_location
(),
CAlpha
().
get_location
(),
C
().
get_location
()));
auto
a1
=
prev
.
C
();
auto
a2
=
N
();
auto
a3
=
CAlpha
();
auto
a4
=
C
();
if
(
a1
and
a2
and
a3
and
a4
)
result
=
dihedral_angle
(
a1
.
get_location
(),
a2
.
get_location
(),
a3
.
get_location
(),
a4
.
get_location
());
}
}
catch
(
const
std
::
exception
&
ex
)
{
if
(
VERBOSE
>
0
)
std
::
cerr
<<
ex
.
what
()
<<
std
::
endl
;
}
return
result
;
}
...
...
@@ -640,20 +640,20 @@ float monomer::psi() const
{
float
result
=
360
;
try
if
(
m_index
+
1
<
m_polymer
->
size
())
{
if
(
m_index
+
1
<
m_polymer
->
size
())
auto
&
next
=
m_polymer
->
operator
[](
m_index
+
1
);
if
(
m_seq_id
+
1
==
next
.
m_seq_id
)
{
auto
&
next
=
m_polymer
->
operator
[](
m_index
+
1
);
if
(
m_seq_id
+
1
==
next
.
m_seq_id
)
result
=
static_cast
<
float
>
(
dihedral_angle
(
N
().
get_location
(),
CAlpha
().
get_location
(),
C
().
get_location
(),
next
.
N
().
get_location
()));
auto
a1
=
N
();
auto
a2
=
CAlpha
();
auto
a3
=
C
();
auto
a4
=
next
.
N
();
if
(
a1
and
a2
and
a3
and
a4
)
result
=
dihedral_angle
(
a1
.
get_location
(),
a2
.
get_location
(),
a3
.
get_location
(),
a4
.
get_location
());
}
}
catch
(
const
std
::
exception
&
ex
)
{
if
(
VERBOSE
>
0
)
std
::
cerr
<<
ex
.
what
()
<<
std
::
endl
;
}
return
result
;
}
...
...
@@ -935,17 +935,17 @@ float monomer::omega(const monomer &a, const monomer &b)
{
float
result
=
360
;
try
{
auto
a1
=
a
.
get_atom_by_atom_id
(
"CA"
);
auto
a2
=
a
.
get_atom_by_atom_id
(
"C"
);
auto
a3
=
b
.
get_atom_by_atom_id
(
"N"
);
auto
a4
=
b
.
get_atom_by_atom_id
(
"CA"
);
if
(
a1
and
a2
and
a3
and
a4
)
result
=
static_cast
<
float
>
(
dihedral_angle
(
a
.
get_atom_by_atom_id
(
"CA"
).
get_location
(),
a
.
get_atom_by_atom_id
(
"C"
).
get_location
(),
b
.
get_atom_by_atom_id
(
"N"
).
get_location
(),
b
.
get_atom_by_atom_id
(
"CA"
).
get_location
()));
}
catch
(...)
{
}
a1
.
get_location
(),
a2
.
get_location
(),
a3
.
get_location
(),
a4
.
get_location
()));
return
result
;
}
...
...
@@ -974,8 +974,12 @@ polymer::polymer(structure &s, const std::string &entityID, const std::string &a
for
(
auto
r
:
poly_seq_scheme
.
find
(
"asym_id"
_key
==
asym_id
))
{
int
seqID
;
std
::
optional
<
int
>
pdbSeqNum
;
std
::
string
compoundID
,
authSeqID
,
pdbInsCode
;
cif
::
tie
(
seqID
,
authSeqID
,
compoundID
,
pdbInsCode
)
=
r
.
get
(
"seq_id"
,
"auth_seq_num"
,
"mon_id"
,
"pdb_ins_code"
);
cif
::
tie
(
seqID
,
authSeqID
,
compoundID
,
pdbInsCode
,
pdbSeqNum
)
=
r
.
get
(
"seq_id"
,
"auth_seq_num"
,
"mon_id"
,
"pdb_ins_code"
,
"pdb_seq_num"
);
if
(
authSeqID
.
empty
()
and
pdbSeqNum
.
has_value
())
authSeqID
=
std
::
to_string
(
*
pdbSeqNum
);
size_t
index
=
size
();
...
...
src/pdb/pdb2cif.cpp
View file @
4de981a3
...
...
@@ -3819,41 +3819,48 @@ void PDBFileParser::ConstructEntities()
for
(
std
::
string
monID
:
monIds
)
{
std
::
string
authMonID
,
authSeqNum
,
authInsCode
;
std
::
string
authMonID
,
authSeqNum
,
authInsCode
{
'.'
};
if
(
res
.
mSeen
)
{
authMonID
=
monID
;
authSeqNum
=
std
::
to_string
(
res
.
mSeqNum
);
if
(
res
.
mIcode
!=
' '
and
res
.
mIcode
!=
0
)
authInsCode
=
std
::
string
{
res
.
mIcode
};
cat
->
emplace
({
{
"asym_id"
,
asymID
},
{
"entity_id"
,
mMolID2EntityID
[
chain
.
mMolID
]
},
{
"seq_id"
,
seqID
},
{
"mon_id"
,
monID
},
{
"ndb_seq_num"
,
seqID
},
{
"pdb_seq_num"
,
res
.
mSeqNum
},
{
"auth_seq_num"
,
authSeqNum
},
{
"pdb_mon_id"
,
authMonID
},
{
"auth_mon_id"
,
authMonID
},
{
"pdb_strand_id"
,
std
::
string
{
chain
.
mDbref
.
chainID
}
},
{
"pdb_ins_code"
,
authInsCode
},
{
"hetero"
,
res
.
mAlts
.
empty
()
?
"n"
:
"y"
}
});
}
else
{
authMonID
=
res
.
mMonID
;
authSeqNum
=
std
::
to_string
(
res
.
mSeqNum
);
if
(
res
.
mIcode
!=
' '
and
res
.
mIcode
!=
0
)
authInsCode
=
std
::
string
{
res
.
mIcode
}
+
"A"
;
else
authInsCode
=
"A"
;
}
if
(
authInsCode
.
empty
())
authInsCode
=
"."
;
cat
->
emplace
({
{
"asym_id"
,
asymID
},
{
"entity_id"
,
mMolID2EntityID
[
chain
.
mMolID
]
},
{
"seq_id"
,
seqID
},
{
"mon_id"
,
monID
},
{
"ndb_seq_num"
,
seqID
},
{
"pdb_seq_num"
,
res
.
mSeqNum
},
{
"auth_seq_num"
,
authSeqNum
},
{
"pdb_mon_id"
,
authMonID
},
{
"auth_mon_id"
,
authMonID
},
{
"pdb_strand_id"
,
std
::
string
{
chain
.
mDbref
.
chainID
}
},
{
"pdb_ins_code"
,
authInsCode
},
{
"hetero"
,
res
.
mAlts
.
empty
()
?
"n"
:
"y"
}
});
cat
->
emplace
({
{
"asym_id"
,
asymID
},
{
"entity_id"
,
mMolID2EntityID
[
chain
.
mMolID
]
},
{
"seq_id"
,
seqID
},
{
"mon_id"
,
monID
},
{
"ndb_seq_num"
,
seqID
},
{
"pdb_seq_num"
,
res
.
mSeqNum
},
{
"auth_seq_num"
,
"."
},
{
"pdb_mon_id"
,
"."
},
{
"auth_mon_id"
,
"."
},
{
"pdb_strand_id"
,
std
::
string
{
chain
.
mDbref
.
chainID
}
},
{
"pdb_ins_code"
,
authInsCode
},
{
"hetero"
,
res
.
mAlts
.
empty
()
?
"n"
:
"y"
}
});
}
}
}
}
...
...
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