code: static Graph toBeamGraph(IAtomContainer ac, int flavour) throws CDKException {
  
          int order = ac.getAtomCount();
  
          GraphBuilder gb = GraphBuilder.create(order);
          Map<IAtom, Integer> indices = Maps.newHashMapWithExpectedSize(order);
  
          for (IAtom a : ac.atoms()) {
              indices.put(a, indices.size());
              gb.add(toBeamAtom(a, flavour));
          }
  
          for (IBond b : ac.bonds()) {
              gb.add(toBeamEdge(b, flavour, indices));
          }
  
          // configure stereo-chemistry by encoding the stereo-elements
          if (SmiFlavor.isSet(flavour, SmiFlavor.Stereo)) {
              for (IStereoElement se : ac.stereoElements()) {
                  if (SmiFlavor.isSet(flavour, SmiFlavor.StereoTetrahedral) &&
                      se instanceof ITetrahedralChirality) {
                      addTetrahedralConfiguration((ITetrahedralChirality) se, gb, indices);
                  } else if (SmiFlavor.isSet(flavour, SmiFlavor.StereoCisTrans) &&
                             se instanceof IDoubleBondStereochemistry) {
                      addGeometricConfiguration((IDoubleBondStereochemistry) se, flavour, gb, indices);
                  } else if (SmiFlavor.isSet(flavour, SmiFlavor.StereoExTetrahedral) &&
                             se instanceof ExtendedTetrahedral) {
                      addExtendedTetrahedralConfiguration((ExtendedTetrahedral) se, gb, indices);
                  } else if (SmiFlavor.isSet(flavour, SmiFlavor.StereoExCisTrans) &&
                             se instanceof ExtendedCisTrans) {
                      addExtendedCisTransConfig((ExtendedCisTrans) se, gb, indices, ac);
                  }
              }
          }
  
          return gb.build();
      }
docs: Convert a CDK {@link IAtomContainer} to a Beam ChemicalGraph. The graph
  can when be written directly as to a SMILES or manipulated further (e.g
  canonical ordering/standard-form and other normalisations).
  
  @param ac an atom container instance
  @return the Beam ChemicalGraph for additional manipulation