diff --git a/.github/workflows/release-to-pypi.yml b/.github/workflows/release-to-pypi.yml index f40f641..307cbba 100644 --- a/.github/workflows/release-to-pypi.yml +++ b/.github/workflows/release-to-pypi.yml @@ -71,6 +71,11 @@ jobs: with: name: python-package-distributions path: dist/ + - name: Extract version from setup.py + id: get_version + run: | + VERSION=$(python setup.py --version) + echo "VERSION=$VERSION" >> $GITHUB_ENV - name: Sign the dists with Sigstore uses: sigstore/gh-action-sigstore-python@v3.0.0 with: @@ -82,7 +87,7 @@ jobs: GITHUB_TOKEN: ${{ github.token }} run: >- gh release create - '${{ github.ref_name }}' + "$VERSION" --repo '${{ github.repository }}' --notes "" - name: Upload artifact signatures to GitHub Release @@ -90,7 +95,7 @@ jobs: GITHUB_TOKEN: ${{ github.token }} run: >- gh release upload - '${{ github.ref_name }}' dist/** + "$VERSION" dist/** --repo '${{ github.repository }}' publish-to-testpypi: diff --git a/setup.py b/setup.py index e68a30c..5e232e2 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name="plcg", - version="1.0.1", + version="1.0.2", author="Spencer Perkins", author_email="spencer.perkins44sp@gmail.com", description="Computational biology and machine learning utilities for the Pardee Lab Computation Group", diff --git a/src/plcg/structure_prediction/colabfold/colabfold.py b/src/plcg/structure_prediction/colabfold/colabfold.py index 8afe5ff..9ef9769 100644 --- a/src/plcg/structure_prediction/colabfold/colabfold.py +++ b/src/plcg/structure_prediction/colabfold/colabfold.py @@ -2,6 +2,7 @@ import os import shutil import subprocess +import json from plcg.structure_prediction.fasta.fasta import save_fasta_file @@ -48,7 +49,7 @@ def run_colabfold_and_get_filepath(seq: str, working_dir: str): if len(json_filepath) > 0: json_filepath = json_filepath[0] with open(working_dir + json_filepath, "r", encoding="utf-8") as f: - data = f.read() + data = json.load(f) ptm_value = data.get("ptm") return pdb_filepath, ptm_value @@ -76,11 +77,15 @@ def run_colabfold_batch_and_return_filepaths(sequences: list[str], working_dir: save_fasta_file(sequences, working_dir + fasta_file_path) colabfold_batch(working_dir + fasta_file_path, working_dir) sequences_to_pdb_filepaths = {} + sequences_to_json_filepaths = {} files = os.listdir(working_dir) for i, sequence in enumerate(sequences): results = [result for result in files if "Sequence_" + str(i) in result] result = [result for result in results if "unrelaxed_rank_001" in result] + json_filepath = [result for result in results if "scores_rank_001" in result] if len(result) > 0: result = result[0] + json_filepath = json_filepath[0] sequences_to_pdb_filepaths[i] = working_dir + result - return sequences_to_pdb_filepaths + sequences_to_json_filepaths[i] = working_dir + json_filepath + return sequences_to_pdb_filepaths, sequences_to_json_filepaths