From 3cbc89aa757c388877771a47b8bd84aa1440fe9c Mon Sep 17 00:00:00 2001 From: Marco Biasini <marco.biasini@unibas.ch> Date: Fri, 16 Sep 2011 23:15:53 +0200 Subject: [PATCH] fixes and cleanups for mmCIF parser --- modules/io/src/mol/mmcif_reader.cc | 14 +++++++------- modules/io/src/mol/mmcif_reader.hh | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/io/src/mol/mmcif_reader.cc b/modules/io/src/mol/mmcif_reader.cc index 1c2ae5a2d..cf4221f3b 100644 --- a/modules/io/src/mol/mmcif_reader.cc +++ b/modules/io/src/mol/mmcif_reader.cc @@ -181,7 +181,7 @@ bool MMCifParser::OnBeginLoop(const StarLoopDesc& header) indices_[ABSTRACT_ID_CAS] = header.GetIndex("abstract_id_CAS"); indices_[BOOK_ID_ISBN] = header.GetIndex("book_id_ISBN"); indices_[BOOK_TITLE] = header.GetIndex("book_title"); - indices_[JOURNAL_FULL] = header.GetIndex("journal_full"); + indices_[JOURNAL_ABBREV] = header.GetIndex("journal_abbrev"); indices_[YEAR] = header.GetIndex("year"); indices_[TITLE] = header.GetIndex("title"); indices_[JOURNAL_VOLUME] = header.GetIndex("journal_volume"); @@ -645,7 +645,7 @@ String MMCifParser::ConvertSEQRES(const String& seqres, if (tlc!="UNK") { LOG_WARNING("unknown residue '" << tlc << "' in SEQRES record. " - "Setting one-letter-code to '?'"); + "Setting one-letter-code to 'X'"); } can_seqres.push_back('X'); continue; @@ -680,16 +680,16 @@ void MMCifParser::ParseCitation(const std::vector<StringRef>& columns) cit.SetPublishedIn(columns[indices_[BOOK_TITLE]].str()); } } - if (indices_[JOURNAL_FULL] != -1) { - if (columns[indices_[JOURNAL_FULL]] != StringRef(".", 1)) { + if (indices_[JOURNAL_ABBREV] != -1) { + if (columns[indices_[JOURNAL_ABBREV]] != StringRef(".", 1)) { if (cit.GetPublishedIn().length() > 0) { throw IOException(this->FormatDiagnostic(STAR_DIAG_WARNING, "citation.book_title already occupies the 'published_in' field of this citation, cannot add " + - columns[indices_[JOURNAL_FULL]].str() + + columns[indices_[JOURNAL_ABBREV]].str() + ".", this->GetCurrentLinenum())); } else { - cit.SetPublishedIn(columns[indices_[JOURNAL_FULL]].str()); + cit.SetPublishedIn(columns[indices_[JOURNAL_ABBREV]].str()); } } } @@ -713,7 +713,7 @@ void MMCifParser::ParseCitation(const std::vector<StringRef>& columns) } if (indices_[YEAR] != -1) { if (columns[indices_[YEAR]][0]!='?') { - cit.SetPubMed(this->TryGetInt(columns[indices_[YEAR]], "citation.year")); + cit.SetYear(this->TryGetInt(columns[indices_[YEAR]], "citation.year")); } } if (indices_[TITLE] != -1) { diff --git a/modules/io/src/mol/mmcif_reader.hh b/modules/io/src/mol/mmcif_reader.hh index 740a93132..ee63212a7 100644 --- a/modules/io/src/mol/mmcif_reader.hh +++ b/modules/io/src/mol/mmcif_reader.hh @@ -320,7 +320,7 @@ private: ABSTRACT_ID_CAS, ///< CAS identifier BOOK_ID_ISBN, ///< ISBN code assigned, if book cited BOOK_TITLE, ///< title of book storing the citation - JOURNAL_FULL, ///< full journal title for articles + JOURNAL_ABBREV, ///< abbreviated journal title for articles JOURNAL_VOLUME, ///< volume of cited journal PAGE_FIRST, ///< first page of citation PAGE_LAST, ///< last page of citation -- GitLab