With yEd it is not possible to trigger certain layouts or other tools upon loading a graph. To layout a graph or to apply a tool to a graph user interaction is always required.
The yEd Software License Agreement explicitly forbids to use yEd as part of an automated process, such as a script or a tool pipeline that automatically transforms an input to an output that was generated by yEd.
If you wish to use the layouts or tools provided by yEd in an automated process or through an API, you should have a look at yFiles, a commercially available graph visualization toolkit that forms the basis of all functionality found in yEd.