Commit 0d8e548f by Maarten L. Hekkelman

pdb2cif and vv

parent b0965081
...@@ -3416,8 +3416,8 @@ std::tuple<int, int> WriteCoordinatesForModel(std::ostream &pdbFile, const datab ...@@ -3416,8 +3416,8 @@ std::tuple<int, int> WriteCoordinatesForModel(std::ostream &pdbFile, const datab
if (type == "branched") // find the real auth_seq_num, since sugars have their auth_seq_num reused as sugar number... sigh. if (type == "branched") // find the real auth_seq_num, since sugars have their auth_seq_num reused as sugar number... sigh.
resSeq = pdbx_branch_scheme.find1<int>("asym_id"_key == r.get<std::string>("label_asym_id") and "pdb_seq_num"_key == resSeq, "auth_seq_num"); resSeq = pdbx_branch_scheme.find1<int>("asym_id"_key == r.get<std::string>("label_asym_id") and "pdb_seq_num"_key == resSeq, "auth_seq_num");
else if (type == "non-polymer") // same for non-polymers // else if (type == "non-polymer") // same for non-polymers
resSeq = pdbx_nonpoly_scheme.find1<int>("asym_id"_key == r.get<std::string>("label_asym_id") and "pdb_seq_num"_key == resSeq, "auth_seq_num"); // resSeq = pdbx_nonpoly_scheme.find1<int>("asym_id"_key == r.get<std::string>("label_asym_id") and "pdb_seq_num"_key == resSeq, "auth_seq_num");
else if (type == "polymer") else if (type == "polymer")
resSeq = pdbx_poly_seq_scheme.find1<int>("asym_id"_key == r.get<std::string>("label_asym_id") and "pdb_seq_num"_key == resSeq, "auth_seq_num"); resSeq = pdbx_poly_seq_scheme.find1<int>("asym_id"_key == r.get<std::string>("label_asym_id") and "pdb_seq_num"_key == resSeq, "auth_seq_num");
......
...@@ -4202,7 +4202,8 @@ void PDBFileParser::ConstructEntities() ...@@ -4202,7 +4202,8 @@ void PDBFileParser::ConstructEntities()
// done with the sugar, resume operation as before // done with the sugar, resume operation as before
std::map<char, std::string> waterChains; std::map<char, std::string> waterChains;
std::map<std::tuple<std::string, std::string>, int> ndbSeqNum; // for nonpoly scheme std::map<std::tuple<std::string, std::string>, int> ndbSeqNum; // for nonpoly scheme
std::map<std::string,int> entityAuthSeqNum; // for nonpoly scheme too
for (size_t i = 0; i < mHets.size(); ++i) for (size_t i = 0; i < mHets.size(); ++i)
{ {
...@@ -4331,6 +4332,7 @@ void PDBFileParser::ConstructEntities() ...@@ -4331,6 +4332,7 @@ void PDBFileParser::ConstructEntities()
} }
int seqNr = ++ndbSeqNum[std::make_tuple(hetID, asymID)]; int seqNr = ++ndbSeqNum[std::make_tuple(hetID, asymID)];
int authSeqNr = ++entityAuthSeqNum[hetID];
std::string iCode{ het.iCode }; std::string iCode{ het.iCode };
cif::trim(iCode); cif::trim(iCode);
...@@ -4339,15 +4341,15 @@ void PDBFileParser::ConstructEntities() ...@@ -4339,15 +4341,15 @@ void PDBFileParser::ConstructEntities()
getCategory("pdbx_nonpoly_scheme")->emplace({ getCategory("pdbx_nonpoly_scheme")->emplace({
{ "asym_id", asymID }, { "asym_id", asymID },
{ "entity_id", mHet2EntityID[hetID] }, { "entity_id", mHet2EntityID[hetID] },
{ "mon_id", hetID }, { "mon_id", hetID },
{ "ndb_seq_num", seqNr }, { "ndb_seq_num", seqNr },
{ "pdb_seq_num", het.seqNum }, { "pdb_seq_num", het.seqNum },
{ "auth_seq_num", het.seqNum }, // Yes { "auth_seq_num", authSeqNr }, // Yes
{ "pdb_mon_id", hetID }, { "pdb_mon_id", hetID },
{ "auth_mon_id", hetID }, { "auth_mon_id", hetID },
{ "pdb_strand_id", std::string{ het.chainID } }, { "pdb_strand_id", std::string{ het.chainID } },
{ "pdb_ins_code", iCode } }); { "pdb_ins_code", iCode } });
// mapping needed? // mapping needed?
mChainSeq2AsymSeq[std::make_tuple(het.chainID, het.seqNum, het.iCode)] = std::make_tuple(asymID, seqNr, false); mChainSeq2AsymSeq[std::make_tuple(het.chainID, het.seqNum, het.iCode)] = std::make_tuple(asymID, seqNr, false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment