Commit 03c95609 by maarten

accept headerless files

git-svn-id: svn+ssh://gitlab/srv/svn-repos/pdb-redo/trunk@373 a1961a4f-ab94-4bcc-80e8-33b5a54de466
parent 3650bc92
......@@ -951,8 +951,8 @@ void PDBFileParser::PreParseInput(istream& is)
uint32 lineNr = 1;
getline(is, lookahead);
if (ba::starts_with(lookahead, "HEADER") == false)
throw runtime_error("This does not look like a PDB file, should start with a HEADER line");
// if (ba::starts_with(lookahead, "HEADER") == false)
// throw runtime_error("This does not look like a PDB file, should start with a HEADER line");
auto contNr = [&lookahead](int offset, int len) -> int
{
......@@ -1236,22 +1236,29 @@ void PDBFileParser::ParseTitle()
// coordinates were received at the PDB.
// 63 - 66 IDcode idCode This identifier is unique within the PDB.
Match("HEADER", true);
Match("HEADER", false);
mStructureId = vS(63, 66);
string keywords = vS(11, 50);
mOriginalDate = pdb2cifDate(vS(51, 59));
mDatablock = new cif::Datablock(mStructureId);
string keywords;
ba::trim(keywords);
if (mRec->is("HEADER"))
{
mStructureId = vS(63, 66);
keywords = vS(11, 50);
mOriginalDate = pdb2cifDate(vS(51, 59));
ba::trim(keywords);
GetNextRecord();
}
else
mStructureId = "nohd";
mDatablock = new cif::Datablock(mStructureId);
auto cat = getCategory("entry");
// cat->addColumn("id");
cat->emplace({ {"id", mStructureId} });
GetNextRecord();
// OBSLTE
if (mRec->is("OBSLTE"))
{
......
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