Skip to content
Snippets Groups Projects
Commit 943eed94 authored by Marco Biasini's avatar Marco Biasini
Browse files

treat UNL properly

parent 9c096d85
No related branches found
No related tags found
No related merge requests found
...@@ -181,7 +181,7 @@ public: ...@@ -181,7 +181,7 @@ public:
virtual bool VisitResidue(const mol::ResidueHandle& res) virtual bool VisitResidue(const mol::ResidueHandle& res)
{ {
String key=builder_->IdentifyResidue(res); String key=builder_->IdentifyResidue(res);
if (key=="UNK" && res.GetKey()!="UNK") { if (key=="UNK" && res.GetKey()!="UNK" && res.GetKey()!="UNL") {
unk_res_[res.GetKey()]+=1; unk_res_[res.GetKey()]+=1;
} }
builder_->FillResidueProps(res); builder_->FillResidueProps(res);
......
...@@ -6,6 +6,10 @@ using namespace ost::conop; ...@@ -6,6 +6,10 @@ using namespace ost::conop;
bool ChemdictParser::OnBeginData(const StringRef& data_name) bool ChemdictParser::OnBeginData(const StringRef& data_name)
{ {
if (data_name==StringRef("UNL",3)) {
compound_=CompoundPtr();
return false;
}
compound_.reset(new Compound(data_name.str())); compound_.reset(new Compound(data_name.str()));
compound_->SetDialect(dialect_); compound_->SetDialect(dialect_);
if (last_!=data_name[0]) { if (last_!=data_name[0]) {
...@@ -119,7 +123,7 @@ void ChemdictParser::OnDataItem(const StarDataItem& item) ...@@ -119,7 +123,7 @@ void ChemdictParser::OnDataItem(const StarDataItem& item)
void ChemdictParser::OnEndData() void ChemdictParser::OnEndData()
{ {
if (insert_) { if (insert_ && compound_) {
if (compound_->GetAtomSpecs().empty()) { if (compound_->GetAtomSpecs().empty()) {
compound_->AddAtom(atom_); compound_->AddAtom(atom_);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment