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[source]

Bases: object

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

getFiles()[source]

Return a list of files representing this object.

This method must be implemented in subclasses.

check()[source]

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()[source]

Check whether the object is used or empty.

This method must be implemented in subclasses.

getCount()[source]

Return the number of items in this object.

This method may be overridden in subclasses.

getOutputPaths()[source]

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

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

Bases: schrodinger.pipeline.pipeio.PipeIO

A class to hold the names of structure files.

__init__(ligs=[], count=None)[source]

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()[source]

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)[source]

Replace the list of ligand files with ligfiles.

Raises

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

getFiles()[source]

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

isFilled()[source]

Check whether the object is used or empty.

This method must be implemented in subclasses.

getCount(count_if_needed=False)[source]

Return the number of items in this object.

This method may be overridden in subclasses.

count()[source]

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)[source]

Bases: schrodinger.pipeline.pipeio.PipeIO

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

__init__(gridfile=None)[source]
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()[source]

Check that the grid file exists.

Raises

RuntimeError – Raised if the file is missing.

getPath()[source]

Return the grid file name.

setData(gridfile)[source]

Replace the grid file name.

Parameters

gridfile (str) – The replacement grid file name.

getFiles()[source]

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()[source]

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=[])[source]

Bases: schrodinger.pipeline.pipeio.PipeIO

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

__init__(files=[])[source]
Parameters

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

check()[source]

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)[source]

Replace the list of file names with textfiles.

Raises

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

getFiles()[source]

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

isFilled()[source]

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)[source]

Bases: schrodinger.pipeline.pipeio.PipeIO

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

__init__(path=None, remote=False)[source]
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()[source]

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()[source]

Returns the path (abolute base name).

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

setData(path)[source]

Replace the stored database path.

getFiles()[source]

Return the list of files.

isFilled()[source]

Check whether the object is used or empty.

This method must be implemented in subclasses.

getOutputPaths()[source]

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.