diff --git a/modules/io/src/mol/mmcif_reader.cc b/modules/io/src/mol/mmcif_reader.cc index 905e28442bab8bd68300426bdeb99df8c6d4cb0e..b473c96ca4ba3e0416211a74498386b39f82142b 100644 --- a/modules/io/src/mol/mmcif_reader.cc +++ b/modules/io/src/mol/mmcif_reader.cc @@ -97,26 +97,12 @@ void MMCifReader::SetRestrictChains(const String& restrict_chains) restrict_chains_ = restrict_chains; } -bool MMCifReader::IsValidPDBIdent(const StringRef& pdbid) -{ - if (pdbid.length() == PDBID_LEN && isdigit(pdbid[0])) { - return true; - } - return false; -} - bool MMCifReader::OnBeginData(const StringRef& data_name) { LOG_DEBUG("MCIFFReader: " << profile_); Profile profile_import("MMCifReader::OnBeginData"); - // check for PDB id - if (!this->IsValidPDBIdent(data_name)) { - throw IOException(this->FormatDiagnostic(STAR_DIAG_ERROR, - "No valid PDB id found for data block, read instead \'" - + data_name.str() + "\'", - this->GetCurrentLinenum())); - } + // IDs in mmCIF files can be any string, so no restrictions here this->ClearState(); diff --git a/modules/io/src/mol/mmcif_reader.hh b/modules/io/src/mol/mmcif_reader.hh index edd249f38755077ac6b4669cec838de3d69e04c0..163972b60160d565f188259b9b6056aed9606a03 100644 --- a/modules/io/src/mol/mmcif_reader.hh +++ b/modules/io/src/mol/mmcif_reader.hh @@ -187,13 +187,6 @@ protected: } } // tested - /// \brief Check a PDB id to be of length 4 and start with a digit - /// - /// \param pdbid putative PDB id - /// - /// \return true for a valid id, false otherwise - bool IsValidPDBIdent(const StringRef& pdbid); - /// \brief fetch values identifying atoms /// /// \param[in] columns data row @@ -353,8 +346,7 @@ protected: private: /// \enum magic numbers of this class typedef enum { - PDBID_LEN=4, ///< length of a PDB id - MAX_ITEMS_IN_ROW=18, ///< count for possible items in a loop row + MAX_ITEMS_IN_ROW=18 ///< count for possible items in a loop row } MMCifMagicNos; /// \enum items of the atom_site category diff --git a/modules/io/tests/test_mmcif_reader.cc b/modules/io/tests/test_mmcif_reader.cc index 69210a1b95e5d3e3236d3807c6827e3390fdc973..e4129c2ab3ccc803a5c2828fb939bbf8f726deb5 100644 --- a/modules/io/tests/test_mmcif_reader.cc +++ b/modules/io/tests/test_mmcif_reader.cc @@ -51,7 +51,6 @@ public: using MMCifReader::OnBeginLoop; using MMCifReader::OnEndData; - using MMCifReader::IsValidPDBIdent; using MMCifReader::ParseAtomIdent; using MMCifReader::ParseAndAddAtom; using MMCifReader::ParseEntity; @@ -113,29 +112,6 @@ conop::CompoundLibPtr SetDefaultCompoundLib() { BOOST_AUTO_TEST_SUITE( io ); -BOOST_AUTO_TEST_CASE(mmcif_isvalidpdbident) -{ - mol::EntityHandle eh=mol::CreateEntity(); - - // on changing the tests for a PDB id in mmcif files, extend this unit test - BOOST_TEST_MESSAGE(" Running mmcif_isvalidpdbident tests..."); - std::ifstream s("testfiles/mmcif/atom_site.mmcif"); - TestMMCifReaderProtected tmmcif_p(s, eh); - StringRef id = StringRef("1FOO", 4); - BOOST_TEST_MESSAGE(" Testing valid id ('"+ id.str() +"')..."); - BOOST_CHECK(tmmcif_p.IsValidPDBIdent(id)); - BOOST_TEST_MESSAGE(" done."); - id = StringRef("this is to long for a PDB id", 28); - BOOST_TEST_MESSAGE(" Testing oversized PDB id ('"+ id.str() +"')..."); - BOOST_CHECK(!tmmcif_p.IsValidPDBIdent(id)); - BOOST_TEST_MESSAGE(" done."); - id = StringRef("nFOO", 4); - BOOST_TEST_MESSAGE(" Testing PDB id with missing number ('" - + id.str() + "')..."); - BOOST_CHECK(!tmmcif_p.IsValidPDBIdent(id)); - BOOST_TEST_MESSAGE(" done."); -} - BOOST_AUTO_TEST_CASE(mmcif_trystoreidx) { mol::EntityHandle eh = mol::CreateEntity();