The command-line mode is similar to the interactive mode. Even if you suppress the windows to be opened (read TODO to learn how to do that), they still exist in the form of different contexts.
This means, if you want to open an existing RMA-file in command-line mode just to save the view of the KEGG assignments you need to think of this as five steps.
- Open the file example.rma6
- Select the nodes you want to show up (we try all leaves)
- Open the KEGG Viewer (or context)
- Change the current context (Main Window) to the KEGG Viewer (KEGG)
- Safe the file to KEGG.png
As part of a command-line script it would look like this:
exportImage file=‘KEGG.png’ format=png visibleOnly=false textAsShapes=true title=KEGG replace=true;
If you forget to change the context to the one you want to work in you will for example see the wrong images being exported (it will always export the Main Window) or the wrong nodes to be selected (always taxonomic nodes, not functional ones).