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
1d8fe334
Unverified
Commit
1d8fe334
authored
Jun 01, 2022
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix writing sugar branches
parent
d86bb314
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
+15
-11
include/cif++/Structure.hpp
+3
-2
src/Structure.cpp
+12
-9
No files found.
include/cif++/Structure.hpp
View file @
1d8fe334
...
@@ -525,12 +525,12 @@ class Sugar : public Residue
...
@@ -525,12 +525,12 @@ class Sugar : public Residue
{
{
public
:
public
:
Sugar
(
const
Branch
&
branch
,
const
std
::
string
&
compoundID
,
Sugar
(
const
Branch
&
branch
,
const
std
::
string
&
compoundID
,
const
std
::
string
&
asymID
,
int
authSeqID
);
const
std
::
string
&
asymID
,
int
authSeqID
,
int
number
);
Sugar
(
Sugar
&&
rhs
);
Sugar
(
Sugar
&&
rhs
);
Sugar
&
operator
=
(
Sugar
&&
rhs
);
Sugar
&
operator
=
(
Sugar
&&
rhs
);
int
num
()
const
{
return
std
::
stoi
(
mAuthSeqID
)
;
}
int
num
()
const
{
return
mNumber
;
}
std
::
string
name
()
const
;
std
::
string
name
()
const
;
/// \brief Return the atom the C1 is linked to
/// \brief Return the atom the C1 is linked to
...
@@ -545,6 +545,7 @@ class Sugar : public Residue
...
@@ -545,6 +545,7 @@ class Sugar : public Residue
private
:
private
:
const
Branch
*
mBranch
;
const
Branch
*
mBranch
;
int
mNumber
;
Atom
mLink
;
Atom
mLink
;
};
};
...
...
src/Structure.cpp
View file @
1d8fe334
...
@@ -1123,15 +1123,17 @@ int Polymer::Distance(const Monomer &a, const Monomer &b) const
...
@@ -1123,15 +1123,17 @@ int Polymer::Distance(const Monomer &a, const Monomer &b) const
// --------------------------------------------------------------------
// --------------------------------------------------------------------
Sugar
::
Sugar
(
const
Branch
&
branch
,
const
std
::
string
&
compoundID
,
Sugar
::
Sugar
(
const
Branch
&
branch
,
const
std
::
string
&
compoundID
,
const
std
::
string
&
asymID
,
int
authSeqID
)
const
std
::
string
&
asymID
,
int
authSeqID
,
int
number
)
:
Residue
(
branch
.
structure
(),
compoundID
,
asymID
,
0
,
std
::
to_string
(
authSeqID
))
:
Residue
(
branch
.
structure
(),
compoundID
,
asymID
,
0
,
std
::
to_string
(
authSeqID
))
,
mBranch
(
&
branch
)
,
mBranch
(
&
branch
)
,
mNumber
(
number
)
{
{
}
}
Sugar
::
Sugar
(
Sugar
&&
rhs
)
Sugar
::
Sugar
(
Sugar
&&
rhs
)
:
Residue
(
std
::
forward
<
Residue
>
(
rhs
))
:
Residue
(
std
::
forward
<
Residue
>
(
rhs
))
,
mBranch
(
rhs
.
mBranch
)
,
mBranch
(
rhs
.
mBranch
)
,
mNumber
(
rhs
.
mNumber
)
{
{
}
}
...
@@ -1142,6 +1144,7 @@ Sugar &Sugar::operator=(Sugar &&rhs)
...
@@ -1142,6 +1144,7 @@ Sugar &Sugar::operator=(Sugar &&rhs)
{
{
Residue
::
operator
=
(
std
::
forward
<
Residue
>
(
rhs
));
Residue
::
operator
=
(
std
::
forward
<
Residue
>
(
rhs
));
mBranch
=
rhs
.
mBranch
;
mBranch
=
rhs
.
mBranch
;
mNumber
=
rhs
.
mNumber
;
}
}
return
*
this
;
return
*
this
;
...
@@ -1198,15 +1201,15 @@ Branch::Branch(Structure &structure, const std::string &asymID)
...
@@ -1198,15 +1201,15 @@ Branch::Branch(Structure &structure, const std::string &asymID)
auto
&
db
=
structure
.
datablock
();
auto
&
db
=
structure
.
datablock
();
auto
&
struct_asym
=
db
[
"struct_asym"
];
auto
&
struct_asym
=
db
[
"struct_asym"
];
auto
&
branch_
list
=
db
[
"pdbx_entity_branch_list
"
];
auto
&
branch_
scheme
=
db
[
"pdbx_branch_scheme
"
];
auto
&
branch_link
=
db
[
"pdbx_entity_branch_link"
];
auto
&
branch_link
=
db
[
"pdbx_entity_branch_link"
];
for
(
const
auto
&
[
entity_id
]
:
struct_asym
.
find
<
std
::
string
>
(
"id"
_key
==
asymID
,
"entity_id"
))
for
(
const
auto
&
[
entity_id
]
:
struct_asym
.
find
<
std
::
string
>
(
"id"
_key
==
asymID
,
"entity_id"
))
{
{
for
(
const
auto
&
[
comp_id
,
num
]
:
branch_list
.
find
<
std
::
string
,
int
>
(
for
(
const
auto
&
[
comp_id
,
num
ber
,
auth_seq_num
]
:
branch_scheme
.
find
<
std
::
string
,
int
,
int
>
(
"
entity_id"
_key
==
entity_id
,
"comp_id"
,
"
num"
))
"
asym_id"
_key
==
asymID
,
"mon_id"
,
"pdb_seq_num"
,
"auth_seq_
num"
))
{
{
emplace_back
(
*
this
,
comp_id
,
asymID
,
num
);
emplace_back
(
*
this
,
comp_id
,
asymID
,
auth_seq_num
,
number
);
}
}
for
(
const
auto
&
[
num1
,
num2
,
atom1
,
atom2
]
:
branch_link
.
find
<
size_t
,
size_t
,
std
::
string
,
std
::
string
>
(
for
(
const
auto
&
[
num1
,
num2
,
atom1
,
atom2
]
:
branch_link
.
find
<
size_t
,
size_t
,
std
::
string
,
std
::
string
>
(
...
@@ -2217,7 +2220,7 @@ void Structure::removeSugar(Sugar &sugar)
...
@@ -2217,7 +2220,7 @@ void Structure::removeSugar(Sugar &sugar)
// TODO: need fix, collect from nag_atoms?
// TODO: need fix, collect from nag_atoms?
{
"auth_asym_id"
,
asym_id
},
{
"auth_asym_id"
,
asym_id
},
{
"auth_mon_id"
,
sugar
.
compoundID
()},
{
"auth_mon_id"
,
sugar
.
compoundID
()},
{
"auth_seq_num"
,
sugar
.
num
()},
{
"auth_seq_num"
,
sugar
.
authSeqID
()},
{
"hetero"
,
"n"
}
{
"hetero"
,
"n"
}
});
});
...
@@ -2403,7 +2406,7 @@ Branch &Structure::createBranch(std::vector<std::vector<cif::Item>> &nag_atoms)
...
@@ -2403,7 +2406,7 @@ Branch &Structure::createBranch(std::vector<std::vector<cif::Item>> &nag_atoms)
std
::
string
asym_id
=
struct_asym
.
getUniqueID
();
std
::
string
asym_id
=
struct_asym
.
getUniqueID
();
auto
&
branch
=
mBranches
.
emplace_back
(
*
this
,
asym_id
);
auto
&
branch
=
mBranches
.
emplace_back
(
*
this
,
asym_id
);
auto
&
sugar
=
branch
.
emplace_back
(
branch
,
"NAG"
,
asym_id
,
1
);
auto
&
sugar
=
branch
.
emplace_back
(
branch
,
"NAG"
,
asym_id
,
1
,
1
);
auto
tmp_entity_id
=
db
[
"entity"
].
getUniqueID
(
""
);
auto
tmp_entity_id
=
db
[
"entity"
].
getUniqueID
(
""
);
auto
&
atom_site
=
db
[
"atom_site"
];
auto
&
atom_site
=
db
[
"atom_site"
];
...
@@ -2517,7 +2520,7 @@ Branch &Structure::extendBranch(const std::string &asym_id, std::vector<std::vec
...
@@ -2517,7 +2520,7 @@ Branch &Structure::extendBranch(const std::string &asym_id, std::vector<std::vec
int
sugarNum
=
branch
.
size
()
+
1
;
int
sugarNum
=
branch
.
size
()
+
1
;
auto
&
sugar
=
branch
.
emplace_back
(
branch
,
compoundID
,
asym_id
,
sugarNum
);
auto
&
sugar
=
branch
.
emplace_back
(
branch
,
compoundID
,
asym_id
,
sugarNum
,
sugarNum
);
for
(
auto
&
atom
:
atom_info
)
for
(
auto
&
atom
:
atom_info
)
{
{
...
@@ -2572,7 +2575,7 @@ Branch &Structure::extendBranch(const std::string &asym_id, std::vector<std::vec
...
@@ -2572,7 +2575,7 @@ Branch &Structure::extendBranch(const std::string &asym_id, std::vector<std::vec
// TODO: need fix, collect from nag_atoms?
// TODO: need fix, collect from nag_atoms?
{
"auth_asym_id"
,
asym_id
},
{
"auth_asym_id"
,
asym_id
},
{
"auth_mon_id"
,
sugar
.
compoundID
()},
{
"auth_mon_id"
,
sugar
.
compoundID
()},
{
"auth_seq_num"
,
sugar
.
num
()},
{
"auth_seq_num"
,
sugar
.
authSeqID
()},
{
"hetero"
,
"n"
}
{
"hetero"
,
"n"
}
});
});
...
...
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