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
f02ea91b
Unverified
Commit
f02ea91b
authored
Mar 28, 2022
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
label and auth seq id, some improvements
parent
6768a501
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
16 deletions
+76
-16
include/cif++/Structure.hpp
+61
-4
src/Cif++.cpp
+0
-8
src/Structure.cpp
+0
-0
test/structure-test.cpp
+15
-4
No files found.
include/cif++/Structure.hpp
View file @
f02ea91b
...
...
@@ -76,6 +76,8 @@ class Atom
bool
getAnisoU
(
float
anisou
[
6
])
const
;
int
charge
()
const
;
void
moveTo
(
const
Point
&
p
);
const
Compound
&
comp
()
const
;
...
...
@@ -488,6 +490,48 @@ class Polymer : public std::vector<Monomer>
};
// --------------------------------------------------------------------
// Sugar and Branch, to describe glycosylation sites
class
Branch
;
class
Sugar
:
public
Residue
{
public
:
Sugar
(
const
Branch
&
branch
,
const
std
::
string
&
compoundID
,
const
std
::
string
&
asymID
,
int
authSeqID
);
int
num
()
const
{
return
std
::
stoi
(
mAuthSeqID
);
}
std
::
string
name
()
const
;
// Sugar &
private
:
const
Branch
&
mBranch
;
};
class
Branch
:
public
std
::
vector
<
Sugar
>
{
public
:
Branch
(
Structure
&
structure
,
const
std
::
string
&
asymID
);
std
::
string
name
()
const
;
float
weight
()
const
;
std
::
string
asymID
()
const
{
return
mAsymID
;
}
Structure
&
structure
()
{
return
*
mStructure
;
}
const
Structure
&
structure
()
const
{
return
*
mStructure
;
}
Sugar
&
getSugarByNum
(
int
nr
);
const
Sugar
&
getSugarByNum
(
int
nr
)
const
;
private
:
friend
Sugar
;
Structure
*
mStructure
;
std
::
string
mAsymID
;
};
// --------------------------------------------------------------------
// file is a reference to the data stored in e.g. the cif file.
// This object is not copyable.
...
...
@@ -514,8 +558,8 @@ class File : public cif::File
void
load
(
std
::
istream
&
is
)
override
;
using
cif
::
File
::
save
;
using
cif
::
File
::
load
;
using
cif
::
File
::
save
;
cif
::
Datablock
&
data
()
{
return
front
();
}
};
...
...
@@ -558,8 +602,16 @@ class Structure
const
std
::
list
<
Polymer
>
&
polymers
()
const
{
return
mPolymers
;
}
std
::
list
<
Polymer
>
&
polymers
()
{
return
mPolymers
;
}
Polymer
&
getPolymerByAsymID
(
const
std
::
string
&
asymID
);
const
Polymer
&
getPolymerByAsymID
(
const
std
::
string
&
asymID
)
const
;
const
std
::
list
<
Branch
>
&
branches
()
const
{
return
mBranches
;
}
std
::
list
<
Branch
>
&
branches
()
{
return
mBranches
;
}
Branch
&
getBranchByAsymID
(
const
std
::
string
&
asymID
);
const
Branch
&
getBranchByAsymID
(
const
std
::
string
&
asymID
)
const
;
const
std
::
vector
<
Residue
>
&
nonPolymers
()
const
{
return
mNonPolymers
;
}
const
std
::
vector
<
Residue
>
&
branchResidues
()
const
{
return
mBranchResidues
;
}
Atom
getAtomByID
(
std
::
string
id
)
const
;
// Atom getAtomByLocation(Point pt, float maxDistance) const;
...
...
@@ -642,6 +694,9 @@ class Structure
/// \return The newly create asym ID
std
::
string
createNonpoly
(
const
std
::
string
&
entity_id
,
std
::
vector
<
std
::
vector
<
cif
::
Item
>>
&
atom_info
);
/// \brief Create a new (sugar) branch with one first NAG containing atoms \a nag_atoms
Branch
&
createBranch
(
std
::
vector
<
std
::
vector
<
cif
::
Item
>>
&
nag_atoms
);
/// \brief Remove a residue, can be monomer or nonpoly
///
/// \param asym_id The asym ID
...
...
@@ -665,7 +720,6 @@ class Structure
void
translateRotateAndTranslate
(
Point
t1
,
Quaternion
q
,
Point
t2
);
const
std
::
vector
<
Residue
>
&
getNonPolymers
()
const
{
return
mNonPolymers
;
}
const
std
::
vector
<
Residue
>
&
getBranchResidues
()
const
{
return
mBranchResidues
;
}
void
cleanupEmptyCategories
();
...
...
@@ -688,6 +742,8 @@ class Structure
std
::
string
insertCompound
(
const
std
::
string
&
compoundID
,
bool
isEntity
);
std
::
string
createEntityForBranch
(
Branch
&
branch
);
void
loadData
();
void
updateAtomIndex
();
...
...
@@ -698,7 +754,8 @@ class Structure
AtomView
mAtoms
;
std
::
vector
<
size_t
>
mAtomIndex
;
std
::
list
<
Polymer
>
mPolymers
;
std
::
vector
<
Residue
>
mNonPolymers
,
mBranchResidues
;
std
::
list
<
Branch
>
mBranches
;
std
::
vector
<
Residue
>
mNonPolymers
;
};
}
// namespace mmcif
src/Cif++.cpp
View file @
f02ea91b
...
...
@@ -613,20 +613,12 @@ bool operator==(const cif::Datablock &dbA, const cif::Datablock &dbB)
int
d
=
nA
.
compare
(
nB
);
if
(
d
>
0
)
{
auto
cat
=
dbB
.
get
(
*
catB_i
);
if
(
cat
==
nullptr
)
missingA
.
push_back
(
*
catB_i
);
++
catB_i
;
}
else
if
(
d
<
0
)
{
auto
cat
=
dbA
.
get
(
*
catA_i
);
if
(
cat
==
nullptr
)
missingB
.
push_back
(
*
catA_i
);
++
catA_i
;
}
else
...
...
src/Structure.cpp
View file @
f02ea91b
This diff is collapsed.
Click to expand it.
test/structure-test.cpp
View file @
f02ea91b
...
...
@@ -119,6 +119,17 @@ HETATM C CHD . ? -4.342 36.262 -3.536 1.00 8.00 ?
auto
expected
=
R"(
data_TEST
#
_pdbx_nonpoly_scheme.asym_id A
_pdbx_nonpoly_scheme.ndb_seq_num 1
_pdbx_nonpoly_scheme.entity_id 1
_pdbx_nonpoly_scheme.mon_id HEM
_pdbx_nonpoly_scheme.pdb_seq_num 0
_pdbx_nonpoly_scheme.auth_seq_num 0
_pdbx_nonpoly_scheme.pdb_mon_id HEM
_pdbx_nonpoly_scheme.auth_mon_id HEM
_pdbx_nonpoly_scheme.pdb_strand_id A
_pdbx_nonpoly_scheme.pdb_ins_code .
#
loop_
_atom_site.id
_atom_site.auth_asym_id
...
...
@@ -141,10 +152,10 @@ _atom_site.auth_seq_id
_atom_site.auth_comp_id
_atom_site.auth_atom_id
_atom_site.pdbx_PDB_model_num
1 A ? A CHA HEM 1 . C HETATM ? -5.248 39.769 -0.250 1.00 7.67 ?
?
HEM CHA 1
2 A ? A CHB HEM 1 . C HETATM ? -3.774 36.790 3.280 1.00 7.05 ?
?
HEM CHB 1
3 A ? A CHC HEM 1 . C HETATM ? -2.879 33.328 0.013 1.00 7.69 ?
?
HEM CHC 1
4 A ? A CHD HEM 1 . C HETATM ? -4.342 36.262 -3.536 1.00 8.00 ?
?
HEM CHD 1
1 A ? A CHA HEM 1 . C HETATM ? -5.248 39.769 -0.250 1.00 7.67 ?
1
HEM CHA 1
2 A ? A CHB HEM 1 . C HETATM ? -3.774 36.790 3.280 1.00 7.05 ?
1
HEM CHB 1
3 A ? A CHC HEM 1 . C HETATM ? -2.879 33.328 0.013 1.00 7.69 ?
1
HEM CHC 1
4 A ? A CHD HEM 1 . C HETATM ? -4.342 36.262 -3.536 1.00 8.00 ?
1
HEM CHD 1
#
_chem_comp.id HEM
_chem_comp.type NON-POLYMER
...
...
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