code: function dictSelect(structure, view, dict) {
    var residuePredicates = _residuePredicates(dict);
    var atomPredicates = _atomPredicates(dict);
    var chainPredicates = _chainPredicates(dict);
  
    if (dict.rindex) {
      dict.rindices = [dict.rindex];
    }
    for (var ci = 0; ci < structure._chains.length; ++ci) {
      var chain = structure._chains[ci];
      if (!fulfillsPredicates(chain, chainPredicates)) {
        continue;
      }
      var residues = _filterResidues(chain, dict);
      var chainView = null;
      for (var ri = 0; ri < residues.length; ++ri) {
        if (!fulfillsPredicates(residues[ri], residuePredicates)) {
          continue;
        }
        if (!chainView) {
          chainView = view.addChain(chain, false);
        }
        var residueView = null;
        var atoms = residues[ri].atoms();
        for (var ai = 0; ai < atoms.length; ++ai) {
          if (!fulfillsPredicates(atoms[ai], atomPredicates)) {
            continue;
          }
          if (!residueView) {
            residueView = chainView.addResidue(residues[ri], false);
          }
          residueView.addAtom(atoms[ai]);
        }
      }
    }
    return view;
  }
docs: helper function to perform selection by predicates