schrodinger.seam.io.filesystems module¶
FileSystems utility functions for interfacing with different filesystems.
Most functionality can be found in apache_beam.io.filesystems, but this module provides some additional functionality not available in the Beam API.
- schrodinger.seam.io.filesystems.xcopy(source_file_names: list[str], destination_file_names: list[str], mime_type='application/octet-stream', compression_type='auto')¶
Copy files from source to destination.
Similar to apache_beam.io.filesystems.copy, but allows for copying between different filesystems (e.g. local to jobfs).
- schrodinger.seam.io.filesystems.localize(path: str) str ¶
Given a path, return a local path to the file. Will copy the file to a temporary location if it is not already local.
It’s the responsibility of the caller to delete the file after use if necessary.
- class schrodinger.seam.io.filesystems.FSStructureReader(filename, index=1)¶
Bases:
StructureReader
A StructureReader that can read from remote filesystems.
Behaves like a normal StructureReader, but will copy remote files to a temporary location before reading. The temporary file will be deleted after the reader is closed.
Local files are treated as normal.
- __init__(filename, index=1)¶
- close()¶
- class schrodinger.seam.io.filesystems.FSStructureWriter(filename, overwrite=True, format=None, stereo=None, allow_empty_file=False)¶
Bases:
StructureWriter
A StructureWriter that can write to remote filesystems.
Behaves like a normal StructureWriter, but will copy the file to a temporary location before writing. The temporary file will be deleted after the writer is closed. The final remote file will only be available after the writer is closed.
- __init__(filename, overwrite=True, format=None, stereo=None, allow_empty_file=False)¶
Create a structure writer class based on the format.
- Parameters:
filename (str or pathlib.Path) – The filename to write to.
overwrite (bool) – If False, append to an existing file instead of overwriting it.
format (str) – The format of the file. Values should be specified by one of the module-level constants MAESTRO, MOL2, SD, SMILES, or SMILESCSV. If the format is not explicitly specified it will be determined from the suffix of the filename. Multi-structure PDB files are not supported.
stereo (enum) –
Use of the stereo option in the constructor is pending deprecation. Please use the setOption method instead.
See the class docstring for documentation on the stereo options.
allow_empty_file (bool) – whether we should create a file with no structures if we don’t append any structures. Only a valid option for Maestro files.
- close()¶
Close the file.