code: public static void removeAtomAndConnectedElectronContainers(IChemModel chemModel, IAtom atom) {
          ICrystal crystal = chemModel.getCrystal();
          if (crystal != null) {
              if (crystal.contains(atom)) {
                  crystal.removeAtom(atom);
              }
              return;
          }
          IAtomContainerSet moleculeSet = chemModel.getMoleculeSet();
          if (moleculeSet != null) {
              MoleculeSetManipulator.removeAtomAndConnectedElectronContainers(moleculeSet, atom);
          }
          IReactionSet reactionSet = chemModel.getReactionSet();
          if (reactionSet != null) {
              ReactionSetManipulator.removeAtomAndConnectedElectronContainers(reactionSet, atom);
          }
      }
docs: Remove an Atom and the connected ElectronContainers from all AtomContainers
  inside an IChemModel.
  
  @param chemModel  The IChemModel object.
  @param atom       The Atom object to remove.