I would like to have new molecules imported in pymol to be preset as 'ball and stick'. I cannot find a way to make this a default setting, preferably in the pymol.rc.
In the command line,
preset.ball_and_stick(selection='all', mode=1)
is what gets the job done.
However, since the command relies on a selection, it has no effect in the pymol.rc, because it is loaded before any imports.
Also
set stick_ball, on
has no effect.
wasnt able to find the setting either, only ways I could figure out are at
scriptorpluginlevel.For the
scriptoption:you need to run the
scriptfrom the File Menu (maybe run it at startup ?? frompymol.rcor as arg ). Problem is that what it does is just adds a new pymol commandshow_linesthat hides all the object loaded as cartoons and show them assticks.For the
pluginone , you need to add a folder in yourplugin_installation_folderthat contains the below__init__.pyfile, and enable the script at startup from the Plugin/Plugin Manager Menu :Running the
Pluginwill open a window:pressing the button will open a load_dialog (for just.pdb , but that could be altered) , before loading the new object the plugin-script keeps track of the already loaded objects, and then after loading the new one , it only hide the cartoons and shows sticks for this one, need to figure out how to select multiple pdb for loading as in the pymol File/Open Menu , but thats another question.
EDITED
code to be changed to load multiple .pdbs at once:
fname, filter = QtWidgets.QFileDialog.getOpenFileName(*args, **kwargs)changes in :
fname, filter = QtWidgets.QFileDialog.getOpenFileNames(*args, **kwargs)just onesmore;and :
changed in :
You can play with:
for the representation that suits you better see: https://pymol.org/dokuwiki/doku.php?id=setting:stick and other googling resources