code: function pdb(text, options) {
    console.time('pdb'); 
    var opts = options || {};
    var lines = getLines(text);
    var reader = new PDBReader(opts);
    var structures = [];
    // depending on whether the loadAllModels flag is set process all models 
    // in the PDB file
    for (var i = 0; i < lines.length; i++) {
      var result = reader.processLine(lines[i]);
      if (result === reader.ERROR) {
        console.timeEnd('pdb');
        return null;
      }
      if (result === reader.CONTINUE) {
        continue;
      }
      var struct = reader.finish();
      if (struct !== null) {
        structures.push(struct);
      }
      if (result === reader.MODEL_COMPLETE && opts.loadAllModels) {
        continue;
      }
      break;
    }
    var structure = reader.finish();
    if (structure !== null) {
      structures.push(structure);
    }
    console.timeEnd('pdb');
    if (opts.loadAllModels) {
      return structures;
    }
    return structures[0];
  }
docs: a truly minimalistic PDB parser. It will die as soon as the input is not well-formed. it only reads ATOM, HETATM, HELIX, SHEET and REMARK 350 records, everything else is ignored. in case of multi-model files, only the first model is read.  FIXME: load PDB currently spends a substantial amount of time creating the vec3 instances for the atom positions. it's possible that it's cheaper to initialize a bulk buffer once and create buffer views to that data for each atom position. since the atom's lifetime is bound to the parent structure, the buffer could be managed on that level and released once the structure is deleted.