From 27657d507927e6c6434dc897a4be18323c52ff4b Mon Sep 17 00:00:00 2001 From: Geoff Hutchison Date: Sat, 2 Mar 2024 17:54:17 -0500 Subject: [PATCH] Switch back to using PDB instead of MMTF format Signed-off-by: Geoff Hutchison --- avogadro/qtplugins/fetchpdb/fetchpdb.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/avogadro/qtplugins/fetchpdb/fetchpdb.cpp b/avogadro/qtplugins/fetchpdb/fetchpdb.cpp index 9aae5fb70e..dbb5fd5f28 100644 --- a/avogadro/qtplugins/fetchpdb/fetchpdb.cpp +++ b/avogadro/qtplugins/fetchpdb/fetchpdb.cpp @@ -8,11 +8,11 @@ #include #include +#include #include #include #include #include -#include #include #include #include @@ -52,7 +52,7 @@ bool FetchPDB::readMolecule(QtGui::Molecule& mol) return false; bool readOK = Io::FileFormatManager::instance().readFile( - mol, m_tempFileName.toStdString(), "mmtf"); + mol, m_tempFileName.toStdString(), "pdb"); if (readOK) // worked, so set the filename mol.setData("name", m_moleculeName.toStdString()); else @@ -85,9 +85,7 @@ void FetchPDB::showDialog() // Hard coding the PDB download URL m_network->get(QNetworkRequest( - // QUrl("https://files.rcsb.org/download/" + pdbCode + ".pdb"))); - // prefer MMTF - smaller and more efficient (also could use .mmtf.gz) - QUrl("https://mmtf.rcsb.org/v1.0/full/" + pdbCode))); + QUrl("https://files.rcsb.org/download/" + pdbCode + ".pdb"))); m_moleculeName = pdbCode; m_progressDialog->setLabelText(tr("Querying for %1").arg(pdbCode)); @@ -109,7 +107,7 @@ void FetchPDB::replyFinished(QNetworkReply* reply) m_moleculeData = reply->readAll(); m_tempFileName = - QDir::tempPath() + QDir::separator() + m_moleculeName + ".mmtf"; + QDir::tempPath() + QDir::separator() + m_moleculeName + ".pdb"; QFile out(m_tempFileName); out.open(QIODevice::WriteOnly); out.write(m_moleculeData); @@ -127,4 +125,4 @@ void FetchPDB::replyFinished(QNetworkReply* reply) emit moleculeReady(1); reply->deleteLater(); } -} // namespace Avogadro +} // namespace Avogadro::QtPlugins