### Typical QApplication Usage Example Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.utils.qapplication Demonstrates a common pattern for starting a Qt application within a Python script. It shows how to use the start_application function from the af2 namespace, typically when the script is run directly. ```python if __name__ == '__main__': # Assuming af2 is an alias for schrodinger.utils.qapplication or similar # and MyPanel.panel is a callable that represents the main GUI element. af2.start_application(MyPanel.panel) ``` -------------------------------- ### setup_panel_ui Function Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.ui.qt.widgetmixins.basicmixins Installs a UI module onto a specified panel. It handles different scenarios for UI setup, including direct Ui_Form subclasses or UI modules containing Ui_Form classes. ```APIDOC def setup_panel_ui(panel): """Installs a ui module onto the specified panel. - If the panel subclasses a Ui_Form, the class itself will setup the ui_widget. - If the panel has a “ui” value set that is a Ui_Form instance, that will be used to populate the ui_widget. - If the panel has a “ui” value set that is a ui module containing Ui_Form, the Ui_Form will be instantiated and used to populate the ui_widget. Parameters: panel (PanelMixin): The panel to setup ui on. Raises: TypeError: if the panel has a “ui” value set that is neither a Ui_Form instance nor a ui module. """ pass ``` -------------------------------- ### Get Configuration File Pairs Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.utils.installation_check Returns a list of pairs of config/template queue files for comparison, along with any warnings. A pair consists of a user's file and its original installation version. Warnings are generated for missing files or 'orig' subdirectories. ```python schrodinger.utils.installation_check.queue_config_file_pairs() ``` -------------------------------- ### Find Schrödinger Module Location Source: https://learn.schrodinger.com/public/python_api/2025-2/intro Determines the installation directory of the Schrödinger Python modules, which is useful for understanding the environment setup. ```python $SCHRODINGER/run python3 -c 'import os, schrodinger; print(os.path.dirname(schrodinger.__file__))' ``` -------------------------------- ### Get Configuration Diffs Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.utils.installation_check Returns a collection of diffs between original installation config/template queue files and user's queue files. This helps identify discrepancies in configuration. ```python schrodinger.utils.installation_check.queue_config_diffs() ``` -------------------------------- ### GridLayoutPopUp Initialization and Setup Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.ui.residueselector Documentation for the GridLayoutPopUp class, a popup dialog with a grid layout, including its initialization and setup method. ```APIDOC class schrodinger.ui.residueselector.GridLayoutPopUp(parent): Bases: schrodinger.ui.qt.pop_up_widgets.PopUp Popup dialog with grid layout. setup() Subclass-specific initialization. Subclasses can re-implement this function with custom set up code. ``` -------------------------------- ### Optional Step Chain Example Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.application.steps.basesteps An example demonstrating how to use OptionalStepsMixin to create a workflow with optional filters, where the 'smarts_filter' setting controls the inclusion of SmartsFilter. ```python import schrodinger.application.steps.filters as filters import schrodinger.parameters as parameters class ExampleOptionalStepChain(OptionalStepsMixin, MolMolWorkflow): STEPS = (filters.UniqueSmilesFilter, filters.SmartsFilter, filters.PropertyFilter) OPTIONAL_SETTINGS_MAP = {filters.SmartsFilter: 'smarts_filter'} class Settings(parameters.CompoundParam): smarts_filter: bool = False ``` -------------------------------- ### Python: getExampleTag - Get example tag for species Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.application.matsci.species Retrieves the example tag associated with a given species. It requires a `SpeciesData` object as input and returns the corresponding example tag as a string. ```python getExampleTag(*species*) Get the example tag for the passed species Parameters: species (SpeciesData): The species to get the example tag from Returns: str: The example tag for the passed species ``` -------------------------------- ### main: Schrodinger Installation Check Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.utils.installation_check Executes the main installation check process. This function serves as the entry point for running diagnostic commands and verifying system readiness. ```APIDOC schrodinger.utils.installation_check.main() -> int Run installation check. Returns: : exit code ``` -------------------------------- ### Get Guide Atoms for Structure Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.structutils.structalign2 Retrieves a list of guide atoms from a given structure. Guide atoms are typically CA atoms for protein residues and C4' atoms for nucleic acid residues. Other residue types are ignored. ```python from schrodinger.structutils.structalign2 import get_guide_atoms from schrodinger.structure import Structure # Assuming 'st' is a loaded Structure object # st = Structure.read('path/to/your/structure.pdb') guide_atoms = get_guide_atoms(st) # guide_atoms is a list of StructureAtom objects ``` -------------------------------- ### Install Additional Modules Locally Source: https://learn.schrodinger.com/public/python_api/2025-2/intro Provides instructions for installing third-party Python modules into a local directory for use with Schrödinger's Python. This involves running the setup.py script with the --prefix option. The target directory's site-packages must be in the PYTHONPATH. ```shell # Assuming setup.py is in the current directory $SCHRODINGER/run setup.py install --prefix=$LOCAL_PY_PACKAGES ``` -------------------------------- ### Get Start Range End Lists (Python) Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.application.bioluminate.antibody.assembly_yaml Processes a list of residues to determine start, range, and end residue lists, considering insertion codes. It takes residue strings, alignment start, and end indices to generate these lists. ```python schrodinger.application.bioluminescent.antibody.assembly_yaml.get_start_range_end_lists(*resids: List[str], *align_start_index: int, *align_end_index: int) -> Tuple[List[str], List[str], List[str]] ``` -------------------------------- ### Get Example Molecule Tag (Schrodinger API) Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.application.matsci.clusterstruct Generates an additional tag to retrieve an example molecule number for a given species. This function requires SpeciesData as input and returns a string representing the tag. ```APIDOC schrodinger.application.matsci.clusterstruct.get_example_mol_tag(species_data) Get an additional tag that gets an example molecule number for this species. Parameters: species_data (SpeciesData): The data for this species. Return type: str: The tag for this species. Returns: The tag for this species. ``` -------------------------------- ### ComUtil Configuration Methods Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.application.macromodel.utils Methods for defining and managing specific configuration arguments. setupAset defines ASET arguments from a dictionary, using numeric keys for atom number lists. ```APIDOC setupAset(set_dict, arg7=0, arg8=0): Define ASET arguments from a set dictionary. Numeric hash keys index the lists of atom numbers. The numerical key is taken as the set number identifier. ``` -------------------------------- ### schrodinger.utils.postinstall Module API Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.utils.postinstall Documentation for functions and classes within the schrodinger.utils.postinstall module, covering custom configuration file handling and directory operations. ```APIDOC schrodinger.utils.postinstall Module This module provides utilities for post-installation steps common to all platforms. Classes: CustomConfigFiles: Customized configuration files used during the postinstall stage. Functions: copy_customized_files: Copies customized configuration files to the installation directory. custom_config_file_exists: Checks if a source file exists. copy_custom_config_file: Copies a single customized configuration file. get_lib_dir: Retrieves the library directory. create_config_dir: Creates the $SCHRODINGER/config directory. get_disabled_lib_dir: Retrieves the disabled library directory. parse_args: Parses command-line arguments. main: Main execution function for the module. Class: schrodinger.utils.postinstall.CustomConfigFiles Bases: str, Enum Description: Customized configuration files used during the postinstall stage of an installation. These files are optional during the installation, but may be required depending on the environment. - featureflags.json: global and product settings for the suite - server.json: required for queuing system installation on Linux - suitepref.xml: required for local installation on Windows Members: FEATURE_FLAGS = 'featureflags.json' SERVER = 'server.json' PREFERENCES = 'suitepref.xml' Function: schrodinger.utils.postinstall.copy_customized_files(customized_files_dir: Path) Description: Checks the specified directory for a customized configuration file and deploys it to $SCHRODINGER/config. The custom configuration file types are stored in the global variable CUSTOMIZED_CONFIGURATION_FILES. Parameters: customized_files_dir (Path): path to the directory where the customized config file(s) is located. Function: schrodinger.utils.postinstall.custom_config_file_exists(customized_files_dir: Path, source_file: Path) -> bool Description: Check if source_file exists on file system, return boolean. Parameters: customized_files_dir (Path): The directory containing custom files. source_file (Path): The specific file to check for existence. Returns: bool: True if the file exists, False otherwise. Function: schrodinger.utils.postinstall.copy_custom_config_file(source_file: Path, dest_file: Path) Description: Copy customized configuration file to the specified destination. Ensure the destination directory (e.g. $SCHRODINGER/config) exists before copying. Parameters: source_file (Path): The path to the source configuration file. dest_file (Path): The path to the destination where the file should be copied. Function: schrodinger.utils.postinstall.get_lib_dir() Description: Don’t use hunt because we are getting rid of and it requires feature flags which requires licenses. Returns: str: The path to the library directory. Function: schrodinger.utils.postinstall.create_config_dir() Description: Create $SCHRODINGER/config. Function: schrodinger.utils.postinstall.get_disabled_lib_dir() Description: Retrieves the path to the disabled library directory. Function: schrodinger.utils.postinstall.parse_args(argv=None) Description: Parses command-line arguments. Parameters: argv (list, optional): A list of arguments to parse. Defaults to None (uses sys.argv). Function: schrodinger.utils.postinstall.main(argv=None) Description: Main execution function for the post-installation script. Parameters: argv (list, optional): A list of arguments to parse. Defaults to None (uses sys.argv). ``` -------------------------------- ### Get License Installation Directory Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.application.licensing.licadmin Returns the pathname of the directory where license files should be installed. It searches for the first writable directory among the shared license directory and the $SCHRODINGER/licenses path. The directory is created if it does not exist. ```APIDOC schrodinger.application.licensing.licadmin.license_directory() Description: Return the pathname of the directory into which license files should be installed. The first writable directory found among the following will be returned: 1. the shared license directory, 2. $SCHRODINGER/licenses The returned license directory will be created, as a side effect, if it doesn’t already exist. Returns: str: The path to the license installation directory. ``` -------------------------------- ### Get Section from Jaguar File Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.application.jaguar.output Generates lines from a specified section within a Jaguar output file. The section is defined by start and optional end indicators. If no end is specified, it returns the remainder of the file after the start indicator. ```python schrodinger.application.jaguar.output.get_section(*fname: str, *sect_start: str, *sect_end: Optional[str] = None*) → Iterable[str] Generator of lines for a section of a (jaguar) file. The section is defined by a start and optionally by an end. Note that if sect_end is not specified the remainder of the file after a sect_start will be returned by the generator. Note that, if multiple sections defined by sect_start and sect_end are present in the file, all will appear in the order they appear Parameters: : * **fname** – Name of file to parse for section * **sect_start** – Indicator of where section begins, i.e. the first line of desired section * **sect_end** – If specified, indicator of the end of a section, i.e. the last line in the desired section ``` -------------------------------- ### Example Usage: Load Maestro Projects Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.utils.pymol Demonstrates initializing a PyMOL instance and processing a Maestro project table using the schrodinger.utils.pymol module. ```python >>> cmd = PymolInstance(["/path/to/pymol"]) >>> pt = maestro.project_table_get() >>> process_prj(cmd, pt) ``` -------------------------------- ### Get Start Index for Workspace Entries Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.maestro_utils.find_tool_bar.find_tool_bar_widget Retrieves a dictionary mapping entry identifiers to their starting indices within the current workspace structure. This function is useful for organizing and accessing data based on entry position. ```python schrodinger.maestro_utils.find_tool_bar.find_tool_bar_widget.get_start_index_for_entries(workspace_st: schrodinger.structure.Structure) -> dict ``` -------------------------------- ### Creating and Running a Pipeline Stage Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.pipeline.stage Demonstrates how to instantiate a Pipeline stage, set keywords, define input structures using `pipeio.Structures`, specify output names, and execute the stage. Requires `schrodinger.pipeline.stage` and `pipeio` modules. ```python stageobj = YourStage() # Add keywords: stageobj['NUM_RINGS'] = 2 stageobj['UNIQUEFIELD'] = 's_m_title' # Add input objects: # ligand_files is list of file names ligandsobj = pipeio.Structures(ligand_files) stageobj.setInput(1, 'INPUT1', ligandsobj) # Tell the stage where to save it's output: stageobj.setOutputName(1, 'OUTPUT') # Integers (1) are position numbers. # INPUT1 is the name of the input object # Run the stage: outputs = stageobj.run() ``` -------------------------------- ### run_postmortem: Schrodinger Installation Check Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.utils.installation_check Executes the postmortem analysis for a specified set of job IDs. The results of this analysis are logged into a file named 'postmortem.log'. ```APIDOC schrodinger.utils.installation_check.run_postmortem(*jobids*) Run postmortem for a given set of jobids, log the results into the “postmortem.log” ``` -------------------------------- ### Get Command Line Flags Example Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.application.matsci.deswidgets Demonstrates how to retrieve command-line flags and their values, typically used for constructing simulation commands. ```python cmd = [EXEC, infile_path] cmd += rs_widget.getCommandLineFlag() ``` -------------------------------- ### Product Information Retrieval Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.application.desmond.util Retrieves key information about a specific Schrodinger product, including its installation directories and version. This is helpful for environment setup and compatibility checks. ```APIDOC schrodinger.application.desmond.util.get_product_info(product_name) -> tuple[str, str, str, str] Returns a tuple with product information. Parameters: product_name: The name of the Schrodinger product. Returns: A tuple containing: - 0: The executable directory (string). - 1: The library directory (string). - 2: The version number (string). - 3: The platform (string). ``` -------------------------------- ### FragmentCreator Usage Example Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.structutils.createfragments Demonstrates how to instantiate and use the FragmentCreator class to fragment molecules. It shows the initialization with various options and iterating through structures to get fragments. ```python from schrodinger.structutils import createfragments # Assuming 'options' and 'my_structures' are defined elsewhere # options.atoms, options.bonds, options.smarts, etc. # my_structures is a list of Structure objects recap_list = ['1', '2', '3'] # Example RECAP rules to use frag_creator = createfragments.FragmentCreator(atoms=options.atoms, bonds=options.bonds, smarts=options.smarts, carbon_hetero=options.carbon_hetero, maxatoms=options.maxatoms, removedup=options.removedup, murcko=options.murcko, recap=options.recap, recap_use=recap_list, complete=options.complete, add_h=options.add_h, verbose=True) for struct in my_structures: # fragments is a list of Structure objects fragments = frag_creator.fragmentStructure(struct) # Process fragments here ``` -------------------------------- ### Example Stage File Syntax Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.pipeline.pipeline Illustrates the basic structure of a stage definition file for the Schrodinger pipeline. It shows essential keywords like STAGE, STAGECLASS, INPUT, OUTPUT, and FFLD, which are used to configure and define a stage's behavior and dependencies. ```config STAGE MY_STAGE STAGECLASS macromodel.ConfSearchStage INPUT MY_INPUT OUTPUT MY_OUTPUT FFLD MMFFS ``` -------------------------------- ### setup_reaction: Prepare Reaction for Enumeration Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.livedesign.setup_reaction Converts a display reaction into a format usable by the core suite’s enumeration tool. It handles specific requirements for reaction enumeration, such as explicit hydrogens on aromatic nitrogens, aromatization, R-group conversion to '*', and atom mapping consistency between reactants and products. ```python schrodinger.livedesign.setup_reaction.setup_reaction(*rxn: ChemicalReaction*) → ChemicalReaction Converts display reaction into a reaction useable by core suite’s enumeration tool. Users commonly sketch reactions without atom mappings, and that assume certain things. Reaction enumeration requires that: - In reactants, hydrogens attached to aromatic nitrogens must be explicit - Reactants be aromatized rather than kekulized - Each R-group must be converted to ‘*’ (any atom) with a mapping number >100 - If there are R groups, that’s the only place the fragments should be allowed to connect - Atoms must be mapped from the reactant to the product. ``` -------------------------------- ### Get Ground State Multipole QM Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.application.jaguar.textparser Collects ground state dipole moment from the start of an excited state calculation. May have errors with spin-orbit coupling (JAGUAR-10586). ```APIDOC schrodinger.application.jaguar.textparser.ground_multipole_qm(*tp*, *jo*, *m*, *it*) Collect ground state dipole from start of excited state calculation. May be errors in ground dipoles computed with spin-orbit coupling, (JAGUAR-10586). Parameters: tp: Input parameter type jo: Input parameter type m: Input parameter type it: Text iterator ``` -------------------------------- ### Install Package using pip Source: https://learn.schrodinger.com/public/python_api/2025-2/intro Installs a Python package (e.g., 'readline') into the active virtual environment using the pip utility. Requires a compatible C compiler for some packages. ```shell pip install readline ``` -------------------------------- ### SequenceDescriptorsTask Usage Example Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.protein.tasks.descriptors Demonstrates how to instantiate and run the SequenceDescriptorsTask to calculate descriptors for a list of protein sequences. It shows setting the input sequences and starting the task execution. ```python from schrodinger.protein.tasks.descriptors import SequenceDescriptorsTask from schrodinger.protein.alignment import ProteinAlignment # Assuming 'alignment' is an existing ProteinAlignment object # Example: alignment = ProteinAlignment(['VVVV', 'AAA', 'TT']) task = SequenceDescriptorsTask() task.input.sts = list(alignment.ProteinAlignment(['VVVV', 'AAA', 'TT'])) task.start() ``` -------------------------------- ### Prime Class Initialization with Dictionary Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.application.prime.input Demonstrates initializing the Prime class with a keyword dictionary and writing the configuration to a file. ```python config = Prime(keyword_dict) config.write("path.inp") ``` -------------------------------- ### schrodinger.application.steps.filters.FepFilter API Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.application.steps.filters API documentation for the FepFilter class. It includes methods for validation and setup, as well as various pyqtSignals for tracking setting changes. ```APIDOC class schrodinger.application.steps.filters.FepFilter: # Signals emitted by instances of the class fep_references_fileReplaced: pyqtSignal max_hac_diffChanged: pyqtSignal max_hac_diffReplaced: pyqtSignal min_edgesChanged: pyqtSignal min_edgesReplaced: pyqtSignal ref_molsChanged: pyqtSignal ref_molsReplaced: pyqtSignal def validateSettings(): """ Check whether the step settings are valid and return a list of SettingsError and SettingsWarning to report any invalid settings. Default implementation checks that all stepper files are set to valid file paths. """ # Return type: list[TaskError or TaskWarning] def setUp(): """ Hook for adding any type of work that needs to happen before any outputs are created. """ def mapFunction(*mol*): """ Maps a function over the input molecules. """ ``` -------------------------------- ### Get Desmond Frames in Range Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.application.matsci.desmondutils Retrieves Desmond trajectory frames within a specified range (inclusive). Users can define the start, end, and step for frame selection. Raises ValueError if no frames are selected. ```APIDOC schrodinger.application.matsci.desmondutils.get_desmond_frames_in_range(traj_dir, trj_min=None, trj_max=None, trj_step=None) Get desmond frames from trajectory within the selected range (top and bottom included). Parameters: traj_dir (str): Path to the trajectory directory. trj_min (int or None): Index of frame in trajectory to start with. If None it will start from the begining of the trajectory. trj_max (int or None): Index of frame in trajectory to end at. If None it will end at the ending of the trajectory. trj_step (int or None): The step for the trajectory. Returns: list: list of trajectory frames selected. Raises: ValueError: Will raise if no frames are selected. ``` -------------------------------- ### SketcherBox Initialization and Setup Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.application.matsci.builderwidgets Details the constructor for the SketcherBox class and methods related to its layout and template list building process. Includes parameters for custom paths, template options, and layout management. ```APIDOC __init__(*master*, *builtin_path*, *custom_dirname*, *layout*, *add_custom_template=True*, *single_rx_atom=False*, *stretch=True*) Create a SketcherBox instance. Parameters: master (QWidget): Must have a warning method. builtin_path (str): The absolute path to the built-in templates. custom_dirname (str): The base name of the path to the custom templates. layout (QBoxLayout): The layout to place this widget into. add_custom_template (bool): Whether 'Custom' template should be allowed in template list (default: True). single_rx_atom (bool): If True, there can only be one single rx atom (default: False). stretch (bool): Whether to add a stretch at the end of the template widgets (default: True). layOut() Lay out the widgets. triggerBuildTemplateList() Created this method to customize build template behaviour while instantiating in derived class. ``` -------------------------------- ### Get Next Job Name Utility Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.ui.qt.appframework Generates the next available job name based on existing files in the current working directory, given a prefix. It takes an optional starting number for sequential naming. ```APIDOC schrodinger.ui.qt.appframework.get_next_jobname(prefix, starting_num=1) Parameters: prefix (str): The prefix for the job name. starting_num (int): The smallest number to append to the job name (defaults to 1). Returns: str: The completed job name. Description: Given a job name prefix, choose the next available job name based on the names of existing files in the CWD. ``` -------------------------------- ### setup_md_job Function Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.application.matsci.equilibrium_md Prepares a molecular dynamics simulation job by writing the .msj file, forming the command, and registering output files. It handles job setup and file management. ```APIDOC schrodinger.application.matsci.equilibrium_md.setup_md_job(*name_base*, *md_opts*, *enegrp_opts=None*, *save_opts=None*, *command_dir=None*, **kwargs) Write the .msj file, form the command, figure out the output filenames, and register files to backend for molecular dynamics simulations. Note: if command_dir is not None, please call this method inside the command_dir as the returned ocms_name doesn’t have command_dir in the file path. Parameters: name_base (str): base name for the md job md_opts (‘type.SimpleNamespace’): Options for the MD simulation enegrp_opts (dict): Options for energy groups, containing 'energy_groups' save_opts (dict): Options for saving simulation results command_dir (str or None): Directory to execute the command in ``` -------------------------------- ### Get Element Name Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.application.matsci.espresso.utils Extracts the base element name from an atom type string, removing any trailing digits that might be present due to starting magnetization settings. This ensures a clean element representation. ```APIDOC schrodinger.application.matsci.espresso.utils.get_element(element) Get element name with the removed digits from atom type. Those might be present to due starting magnetization. Parameters: element (str): Element. Return type: str Returns: Element name without digits. ``` -------------------------------- ### Script Launching and Launcher Utilities Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.ui.qt.appframework2.af2 Utilities for launching scripts, creating launchers, and converting launcher objects to command lists. Note: `launchScript` and `makeLauncher` are deprecated. ```APIDOC launchScript(*script*, *script_args=None*, *input_files=[], *structure_output_file=None*, *output_files=[], *aux_modules=[], *show_progress_bar=False*, **kwargs) DEPRECATED. Creates and launches a script using `makeLauncher`. For scripts not integrating with job control. Honors `self.start_mode` to either launch or write a job file. Parameters: - script: The script to launch. - script_args (list, optional): Arguments for the script. Defaults to []. - input_files (list, optional): Input files for the script. Defaults to []. - structure_output_file (str, optional): Output file for structure. Defaults to None. - output_files (list, optional): Other output files. Defaults to []. - aux_modules (list, optional): Auxiliary modules. Defaults to []. - show_progress_bar (bool, optional): Whether to show a progress bar. Defaults to False. - **kwargs: Additional keyword arguments. launcherToCmdList(*slauncher*) Converts a launcher object to a command list. makeLauncher(*script*, *script_args=[], *input_files=[], *structure_output_file=None*, *output_files=[], *aux_modules=[], **kwargs) DEPRECATED. Creates a launcher for a script. Recommended to add `get_job_spec_from_args()` to the backend script and launch using `launchJobCmd()` or add `getJobSpec()` to the panel and launch using `launchFromJobSpec()`. ``` -------------------------------- ### Manage Magnetization and Hubbard U Parameters Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.application.matsci.espresso.utils Functions to get and set starting magnetization and Hubbard U parameters for atoms. These functions interact with atom properties and handle default values if parameters are not present. ```APIDOC schrodinger.application.matsci.espresso.utils.get_mag_hubbu(atom, decimals=10) Get starting magnetization and Hubbard U parameters from atom property. If not present, return the default. Parameters: atom (schrodinger.structure._StructureAtom): Atom from which values are taken. decimals (int): Number of decimals to round to. Return type: MagElement namedtuple Returns: Tuple of starting magnetization and Hubbard parameters. ``` ```APIDOC schrodinger.application.matsci.espresso.utils.set_mag_hubbu(atom, mag_element) Set starting magnetization and Hubbard U parameters in atom property. Parameters: atom (schrodinger.structure._StructureAtom): Atom for which values are set. mag_element (MagElement namedtuple): Tuple of starting magnetization and Hubbard parameters. ``` -------------------------------- ### QSiteInput Class Methods and Properties Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.application.qsite.input Manages the overall QSite input file, including initialization, structure file handling, and adding different types of QM regions. Provides access to various sections like &gen, &mmkey, &mopac, and &qmregion. ```APIDOC class schrodinger.application.qsite.input.QSiteInput: """A class to create and manage QSite input files.""" __init__(name): """Create a QSite input object, either from a jobname or QSite input file path. Parameters: name (str): Either a jobname (uses default parameters) or a file path (reads parameters from the file). """ jobname (property): """Get or set the jobname. Setting the jobname also sets the filename. """ gen (property): """Provide dictionary-like access to the &gen section. """ mmkey (property): """Provide dictionary-like access to the &mmkey section. """ mopac (property): """Provide dictionary-like access to the &mopac section. """ qmregion (property): """Provide access to the &qmregion section. """ setStructureFile(filename): """Set the MAE structure file to be used. If the structure file name doesn’t match the current job/file name, it will be copied to the current directory and renamed to .. Parameters: filename (str): The path to the MAE structure file. """ getStructureFile(): """Return the MAE structure that is used. Returns: str: The path to the MAE structure file. """ addQMMolecule(index, theory='qm'): """Add a QM molecule to the QM region specification. This creates a Cut instance and adds it to the qmregion attribute. Parameters: index (int): The index for the QM molecule. theory (str, optional): The theoretical model to use. Defaults to 'qm'. """ addQMCut(**kwargs): """Add a QM cut to the QM region specification. The keywords here are the same as the Cut class constructor. Calling this method is equivalent to creating a Cut instance and adding it to the QSiteInput instance by calling qmregion.append(). Parameters: **kwargs: Attributes for the Cut instance. """ addHydrogenCap(qm=None, mm=None, distance=0.0, theory='qm'): """Add a hydrogen cap to the QM region specification. The keywords here are the same as the HydrogenCap class constructor. Calling this method is equivalent to creating a HydrogenCap instance and adding it to the QSiteInput instance by calling qmregion.append(). Parameters: qm (str, optional): QM parameters for the hydrogen cap. mm (str, optional): MM parameters for the hydrogen cap. distance (float, optional): The distance parameter for the hydrogen cap. Defaults to 0.0. theory (str, optional): The theoretical model to use. Defaults to 'qm'. """ ``` -------------------------------- ### get_installation_check_commands: Schrodinger Installation Check Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.utils.installation_check Returns a map of diagnostic commands, where keys are command descriptions and values are lists of arguments. This provides a structured way to access commands for system checks. ```APIDOC schrodinger.utils.installation_check.get_installation_check_commands() Returns a map of diagnostic commands with: : key: command description value: args list ``` -------------------------------- ### Get Segment Indices (Python) Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.application.bioluminate.antibody.assembly_yaml Determines the segment indices for a given chain dictionary and domain key. It identifies the segment for the FV or FAB region based on the domain key, returning a tuple of start and end indices. ```python schrodinger.application.bioluminescent.antibody.assembly_yaml.get_segment_indices(*chain_dict: Dict[str, Any], *domain_key: str) -> Tuple[int, int] ``` -------------------------------- ### Example Workflow with ForkStep and JoinStep Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.stepper.sideinputs Demonstrates how to use ForkStep and JoinStep to manage side inputs in a stepper workflow. This setup allows outputs from an initial step (A) to be passed to a final step (D), bypassing intermediate steps (B, C). ```python class MyWorkflow(stepper.Chain): def buildChain(self): a = A() self.addStep(a) fork = ForkStep(step=a) self.addStep(fork) self.addStep(B()) self.addStep(C()) self.addStep(JoinStep(fork=fork)) self.addStep(D()) ``` -------------------------------- ### QApplication Management API Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.utils.qapplication Provides core functions for interacting with and managing the global QApplication instance. This includes decorators to ensure an application exists, functions to retrieve or create it, and utilities to check application type. ```APIDOC schrodinger.utils.qapplication: alias of `RunMode` ApplicationMode - An alias for RunMode, likely indicating different application execution modes. *exception* CantCreateQApplicationError(*msg='', **kwargs) - Bases: `RuntimeError` - Exception raised when a QApplication cannot be created under specific conditions. - __init__(msg='', *args, **kwargs) - Constructor for CantCreateQApplicationError. require_application(*func=None*, *create=False*, *use_qtcore_app=False*) - Decorator to ensure a QApplication is available for a function. - If no QApplication exists, it raises a RuntimeError unless `create` is True. - Parameters: - func (callable, optional): The function to decorate. - create (bool): If True, creates a QApplication if none exists. - use_qtcore_app (bool): If True, uses QCoreApplication; otherwise, QtWidgets.QApplication. get_application(*create=True*, *use_qtcore_app=False*, *offscreen=False*) - Retrieves the global QApplication instance. - Creates one if it doesn't exist by default (`create=True`). - Parameters: - create (bool): Whether to create a new application if none exists. - use_qtcore_app (bool): Use QtCore.QCoreApplication instead of QtWidgets.QApplication. - offscreen (bool): Adds '-platform offscreen' argument (Linux-only). - Raises: - CantCreateQApplicationError: If use_qtcore_app is False but QCoreApplication exists, or if QtWidgets import fails. - Returns: - QApplication or None: The application instance. is_core_application() - Checks if the current application instance is a QtCore.QCoreApplication. - Returns: - bool or NoneType: True if it's a QCoreApplication, False if it's a QtWidgets.QApplication, None if no application exists. start_application(*main_callable*, *use_qtcore_app=False*) - Starts the application's event loop using `exec`. - Calls `main_callable` via a timer within the event loop. - Intended for standalone GUI scripts to mimic Maestro execution. - Parameters: - main_callable (callable): The function/method to run in the event loop. - use_qtcore_app (bool): Use QtCore.QCoreApplication for non-GUI or headless environments. run_application(*main_callable*, *use_qtcore_app=True*) - Functionally identical to `start_application` but with a default `use_qtcore_app=True`. - Parameters: - main_callable (callable): The function/method to run in the event loop. - use_qtcore_app (bool): Defaults to True, indicating use of QtCore.QCoreApplication. ``` -------------------------------- ### run_test_jobs: Schrodinger Installation Check Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.utils.installation_check Executes test application jobs using a provided list of host entries. It returns a list of all job IDs, including both succeeded and failed jobs. ```APIDOC schrodinger.utils.installation_check.run_test_jobs(*entries*, *launch_dir='.'*, *duration=10*, *timeout=None*) Run testapp jobs using a list of host entries (jobcontrol.Host objects). Return a list of all jobids, succeeded and failed, that were run ``` -------------------------------- ### XTBInput Class Documentation Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.application.xtb.input Documentation for the XTBInput class, which handles input for the xTB workflow. It allows managing keywords, validation, and saving input configurations. ```APIDOC class XTBInput(WorkflowInput): """Input for the XTB workflow.""" input_file_keys = ['default.inp'] workflow_name = 'XTB' __init__(keywords: dict) """Create an XTBInput instance. Parameters: keywords – XTB keyword/value pairs """ @staticmethod generate_keywords() -> Dict[str, Dict[str, XTBKeyword]] """Initialize dictionary of all possible XTB keywords. Returns: Dictionary of XTB keywords. """ validate() """Perform a self-consistency check of all currently set keywords. Raises: WorkflowKeywordConflictError: if conflicting values found """ getValue(keyword: str) -> Any """Return the value for Workflow keyword. The return type depends on the keyword. Parameters: keyword – name of keyword Returns: The value of the keyword. Raises: WorkflowKeywordError: if no keyword found """ setValue(keyword: str, value: Any) """Set the Workflow keyword ‘keyword’ to value ‘value’. Note that there may be type-checking and conversion by the WorkflowKeyword class. If ‘value’ is None, the keyword will be reset. Parameters: keyword – name of keyword value – value of keyword Raises: WorkflowKeywordException: if no keyword found or there is an issue with the keyword or value """ resetKey(keyword: str) """Reset keyword to default state. Parameters: keyword – name of keyword """ getNonDefaultKeys() -> Dict[str, Dict[str, XTBKeyword]] """Return a dictionary of all non-default-value WorkflowKeyword instances indexed by name. Returns: Dictionary of non-default keywords. """ isNonDefault(keyword: str) -> bool """Has the specified keyword been set to a non-default value? Parameters: keyword – The key to check Returns: True if the specified keyword is set to a non-default value. False otherwise. """ save(name='default.inp') """Save the current XTBInput instance to a file. Parameters: name – Name of the file to save to """ ``` -------------------------------- ### Get Existing Filepath Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.utils.fileutils Searches for a file starting from a given path, then checks the current working directory, and finally the original launch directory. It returns the absolute path of the first location where the file is found, or None if it's not located. ```python from schrodinger.utils.fileutils import get_existing_filepath # Example usage: # # Assume 'config.json' exists in the current directory # found_path = get_existing_filepath('config.json') # print(f"Found config.json at: {found_path}") # # # Assume 'data/trajectory.xtc' exists relative to the launch dir # traj_path = get_existing_filepath('data/trajectory.xtc') # print(f"Found trajectory at: {traj_path}") ``` -------------------------------- ### Library Path and Version Functions Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.utils.installation_check Utility functions for finding and checking the version of the system's libstdc++. ```APIDOC schrodinger.utils.installation_check.find_user_libstdcpp() Returns path to system libstdc++.so.6 (or default libstdc++.so.6 before SCHRODINGER environment was found. schrodinger.utils.installation_check.get_libstdcpp_version(library) Returns GLIBCXX minor version from a given library. Parameters: library (str): pathname to a libstdc++.so.6 schrodinger.utils.installation_check.get_bundled_libstdcpp() Returns the path to the bundled libstdc++. ``` -------------------------------- ### Get Contiguous Groups of Numbers Source: https://learn.schrodinger.com/public/python_api/2025-2/api/schrodinger.protein.alignment Groups numbers in a given list by contiguity. Each returned group is a list of numbers where every value differs from its neighbors by exactly one. For example, `[1, 2, 4]` would result in `[[1, 2], [4]]`. ```python get_contiguous_groups(nums) Group numbers in a given list by contiguity. Each group that is returned will be a list of numbers where every value is an int that only differs from its neighbors by one. e.g. [1, 2, 4] -> [[1, 2], [4]] : [1, 2, 4, 5, 10] -> [[1, 2], [4, 5], [10]] Parameters: nums (list(int)): A list of numbers to group Returns: A list of groups of numbers, where the numbers in each group are contiguous Return type: list(list(int)) ```