diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index cc3c96f8..1021edca 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -35,7 +35,7 @@ jobs: run: | python3 setup.py sdist bdist_wheel - name: Upload artifacts for inspection - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: dist path: dist/* diff --git a/README.md b/README.md index 8d03f661..462c5c43 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,10 @@ at [Scripps Research](https://www.scripps.edu/). ### Documentation In-depth documentation can be found on [ReadTheDocs](https://ringtail.readthedocs.io). +### Version 2.1.1 bug fixes +- bugs related to ligand filtering and certain uses of the `overwrite` option in the command line have been fixed +- enhancements to the result plotting feature + ### New in version 2.0.0 and 2.1.0 - changes in keywords used for the command line tool diff --git a/ringtail/outputmanager.py b/ringtail/outputmanager.py index 3c270a68..0497f28a 100644 --- a/ringtail/outputmanager.py +++ b/ringtail/outputmanager.py @@ -448,7 +448,7 @@ def plot_single_points( def save_scatterplot(self): """ - Saves current figure as scatter.png + Saves and closes current figure as scatter.png Raises: OutputError diff --git a/ringtail/ringtailcore.py b/ringtail/ringtailcore.py index c020ac45..664a9476 100644 --- a/ringtail/ringtailcore.py +++ b/ringtail/ringtailcore.py @@ -1498,7 +1498,9 @@ def write_flexres_pdb( self.storageman.fetch_single_ligand_output_info(ligname) ) flexible_residues, flexres_atomnames = self.storageman.fetch_flexres_info() - if flexible_residues != []: # converts string to list + if flexible_residues is None: + flexible_residues, flexres_atomnames = [], [] + elif flexible_residues != []: # converts string to list flexible_residues = json.loads(flexible_residues) flexres_atomnames = json.loads(flexres_atomnames) @@ -1532,7 +1534,7 @@ def write_flexres_pdb( with open(path, "w") as file: file.write(pdb_str) - return ligand_mol, flexmoldict + return ligand_mol, flexmoldict def write_molecule_sdfs( self, @@ -1665,7 +1667,9 @@ def ligands_rdkit_mol(self, bookmark_name=None, write_nonpassing=False) -> dict: passing_molecule_info = self.storageman.fetch_passing_ligand_output_info() flexible_residues, flexres_atomnames = self.storageman.fetch_flexres_info() - if flexible_residues != []: + if flexible_residues is None: + flexible_residues, flexres_atomnames = [], [] + elif flexible_residues != []: flexible_residues = json.loads(flexible_residues) flexres_atomnames = json.loads(flexres_atomnames) @@ -1732,9 +1736,10 @@ def plot( """ Get data needed for creating Ligand Efficiency vs Energy scatter plot from storageManager. Call OutputManager to create plot. + Option to save the plot and close it immediately, or keep it open and save it manually later. Args: - save (bool): whether to save plot to cd + save (bool): whether to save plot to cd. Will save and close figure bookmark_name (str): bookmark from which to fetch filtered data to plot return_fig_handle (bool): use to return a handle to the matplotlib figure instead of saving or showing figure @@ -1775,7 +1780,7 @@ def plot( markersize = 20 # for smaller dataset, scale num of bins and markersize to size of dataset else: - num_of_bins = round(datalength / 10) + num_of_bins = max(1, round(datalength / 10)) markersize = 60 - (datalength / 25) # plot the data @@ -1879,7 +1884,9 @@ def onpick(event): flexible_residues, flexres_atomnames = ( self.storageman.fetch_flexres_info() ) - if flexible_residues != []: # converts string to list + if flexible_residues is None: + flexible_residues, flexres_atomnames = [], [] + elif flexible_residues != []: # converts string to list flexible_residues = json.loads(flexible_residues) flexres_atomnames = json.loads(flexres_atomnames) diff --git a/ringtail/storagemanager.py b/ringtail/storagemanager.py index a90fdf43..b7d7491d 100644 --- a/ringtail/storagemanager.py +++ b/ringtail/storagemanager.py @@ -39,7 +39,7 @@ class StorageManager: _db_schema_code_compatibility = { "1.0.0": ["1.0.0"], "1.1.0": ["1.1.0"], - "2.0.0": ["2.0.0", "2.1.0"], + "2.0.0": ["2.0.0", "2.1.0", "2.1.1"], } """Base class for a generic virtual screening database object. @@ -1622,7 +1622,7 @@ def fetch_filters_from_bookmark(self, bookmark_name: str | None = None): ) filters = self._run_query(sql_query).fetchone() - if not filters: + if not filters: return {} return json.loads(filters[0]) diff --git a/setup.py b/setup.py index 09fda6d0..596ba86e 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ def find_files(directory): setup( name="ringtail", - version="2.1.0", + version="2.1.1", author="Forli Lab", author_email="forli@scripps.edu", url="https://github.com/forlilab/Ringtail",