schrodinger.pipeline.pipeio module

Core Pipeline I/O classes (Structures, Grid, and Text, and PhaseDB).

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.pipeline.pipeio.PipeIO

Bases: object

Parent class for all Pipeline I/O classes. Subclasses hold data that is passed between stages during execution.

getFiles()

Return a list of files representing this object.

This method must be implemented in subclasses.

check()

Make sure that the object is valid. If it’s not valid (e.g. file does not exist), raise a RuntimeError.

This method must be implemented in subclasses.

isFilled()

Check whether the object is used or empty.

This method must be implemented in subclasses.

getCount()

Return the number of items in this object.

This method may be overridden in subclasses.

getOutputPaths()

Subclasses may override for special behavior when getting files when copying user output.

class schrodinger.pipeline.pipeio.Structures(ligs=[], count=None)

Bases: schrodinger.pipeline.pipeio.PipeIO

A class to hold the names of structure files.

__init__(ligs=[], count=None)

Initialize the object with a list of ligand files.

The list can be replaced later with setData.

Parameters

ligs (list) – A list of ligand structure file names.

check()

Make sure all files in the list exist. Raise a RuntimeError if “.” is in the list, and exit (sys.exit(1)) if any file can’t be found.

setData(ligfiles, count=None)

Replace the list of ligand files with ligfiles.

Raises

RuntimeError – Raised if “.” is in the list.

getFiles()

Return the list of ligand file names after checking that all of them exist via the check method.

isFilled()

Check whether the object is used or empty.

This method must be implemented in subclasses.

getCount(count_if_needed=False)

Return the number of items in this object.

This method may be overridden in subclasses.

count()

Return the number of structures in the set.

getOutputPaths()

Subclasses may override for special behavior when getting files when copying user output.

class schrodinger.pipeline.pipeio.Grid(gridfile=None)

Bases: schrodinger.pipeline.pipeio.PipeIO

A class to hold a set of grid files (compressed or uncompressed).

__init__(gridfile=None)
Parameters

gridfile (str) – The name of the grid file (for example, <gridjobname>.grd or <gridjobname>.zip). The value can be changed later with setData.

check()

Check that the grid file exists.

Raises

RuntimeError – Raised if the file is missing.

getPath()

Return the grid file name.

setData(gridfile)

Replace the grid file name.

Parameters

gridfile (str) – The replacement grid file name.

getFiles()

Return a list of grid file names, expanded from the representative file name, after checking for their existence.

For compressed grids, the zip file is the only item returned, but for uncompressed grids, all the standard grid component file names are returned.

isFilled()

Check whether the object is used or empty.

This method must be implemented in subclasses.

getCount()

Return the number of items in this object.

This method may be overridden in subclasses.

getOutputPaths()

Subclasses may override for special behavior when getting files when copying user output.

class schrodinger.pipeline.pipeio.Text(files=[])

Bases: schrodinger.pipeline.pipeio.PipeIO

A class to hold the names of one or more text (or log) files.

__init__(files=[])
Parameters

files (list) – A list of text or log file names. The file paths can be later replaced with setData().

check()

Make sure all files in the list exist.

Raises

RuntimeError – Raised if “.” is in the list or if any file can’t be found.

setData(textfiles)

Replace the list of file names with textfiles.

Raises

RuntimeError – Raised if “.” is in the list.

getFiles()

Return the list of text file names after checking that all of them exist.

isFilled()

Check whether the object is used or empty.

This method must be implemented in subclasses.

getCount()

Return the number of items in this object.

This method may be overridden in subclasses.

getOutputPaths()

Subclasses may override for special behavior when getting files when copying user output.

class schrodinger.pipeline.pipeio.PhaseDB(path=None, remote=False)

Bases: schrodinger.pipeline.pipeio.PipeIO

A class to hold the absolute pathname of a Phase database.

__init__(path=None, remote=False)
Parameters
  • path (str) – The path to the Phase database (This must end with .phdb.)

  • remote (bool) – A value to control whether the database should be checked for existence only on the remote host, since the localhost may not have access to that directory.

check()

Make sure all files in the list exist.

Raises

RuntimeError – Raised if “.” is in the list or if any file can’t be found.

getPath()

Returns the path (abolute base name).

For the old format, does NOT include “_phasedb”, for new format DOES include the “.phdb”.

setData(path)

Replace the stored database path.

getFiles()

Return the list of files.

isFilled()

Check whether the object is used or empty.

This method must be implemented in subclasses.

getOutputPaths()

Subclasses may override for special behavior when getting files when copying user output.

getCount()

Return the number of items in this object.

This method may be overridden in subclasses.