From 7ab2859b45dc848b3b29846f391b2ea513eb0e19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Fern=C3=A1ndez=20D=C3=ADaz?= <78709417+RaulFD-creator@users.noreply.github.com> Date: Mon, 20 Jul 2026 11:16:25 +0100 Subject: [PATCH 1/7] =?UTF-8?q?=F0=9F=A4=96=20Update=20dependencies=20in?= =?UTF-8?q?=20python-package.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaced 'sentencepiece' with 'transformers' in dependency installation. --- .github/workflows/python-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 622cb32..720529c 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -27,9 +27,9 @@ jobs: run: | python -m pip install --upgrade pip pip install uv - uv pip install flake8 pytest sentencepiece rdkit --system + uv pip install flake8 pytest sentencepiece transformers rdkit --system uv pip install git+https://github.com/novonordisk-research/pepfunn.git --system - uv pip install . "transformers<5" --system + # uv pip install . "transformers<5" --system if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Lint with flake8 run: | From eb4c08387055b61de86bb3bc608d5fd09f8a58a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Fern=C3=A1ndez=20D=C3=ADaz?= <78709417+RaulFD-creator@users.noreply.github.com> Date: Mon, 20 Jul 2026 11:20:40 +0100 Subject: [PATCH 2/7] =?UTF-8?q?=F0=9F=AA=B2=F0=9F=A4=96=20Update=20GitHub?= =?UTF-8?q?=20Actions=20for=20Python=20package=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated Python package workflow to use actions/checkout@v7 and removed 'transformers' from the installation list. --- .github/workflows/python-package.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 720529c..589c7d5 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -18,7 +18,7 @@ jobs: python-version: ["3.10", "3.12", "3.13"] steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v6 with: @@ -27,9 +27,9 @@ jobs: run: | python -m pip install --upgrade pip pip install uv - uv pip install flake8 pytest sentencepiece transformers rdkit --system + uv pip install flake8 pytest sentencepiece rdkit --system uv pip install git+https://github.com/novonordisk-research/pepfunn.git --system - # uv pip install . "transformers<5" --system + uv pip install . --system if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Lint with flake8 run: | From 45bf45a23d340180c2d444311bddbe5a348698dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Fern=C3=A1ndez=20D=C3=ADaz?= <78709417+RaulFD-creator@users.noreply.github.com> Date: Mon, 20 Jul 2026 11:36:37 +0100 Subject: [PATCH 3/7] =?UTF-8?q?=F0=9F=AA=B2=F0=9F=A4=96=20Avoid=20transfor?= =?UTF-8?q?mers=205.14?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 589c7d5..8d4d152 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -29,7 +29,7 @@ jobs: pip install uv uv pip install flake8 pytest sentencepiece rdkit --system uv pip install git+https://github.com/novonordisk-research/pepfunn.git --system - uv pip install . --system + uv pip install . "transformers<5.14" --system if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Lint with flake8 run: | From 4b0d6425e3190dd811d49807198e5927d889a41e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Fern=C3=A1ndez=20D=C3=ADaz?= <78709417+RaulFD-creator@users.noreply.github.com> Date: Mon, 20 Jul 2026 11:39:11 +0100 Subject: [PATCH 4/7] =?UTF-8?q?=F0=9F=AA=B2=F0=9F=A4=96=20Avoid=20transfor?= =?UTF-8?q?mers=20>5.13?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 8d4d152..01857dc 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -29,7 +29,7 @@ jobs: pip install uv uv pip install flake8 pytest sentencepiece rdkit --system uv pip install git+https://github.com/novonordisk-research/pepfunn.git --system - uv pip install . "transformers<5.14" --system + uv pip install . "transformers<5.13" --system if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Lint with flake8 run: | From 04e93b7d418845f52b164aab32d73c80c3c503c8 Mon Sep 17 00:00:00 2001 From: RaulFD-creator Date: Thu, 30 Jul 2026 15:40:18 +0100 Subject: [PATCH 5/7] =?UTF-8?q?=F0=9F=AA=B2=20Fixed=20bug=20with=20adding?= =?UTF-8?q?=20negatives=20from=20smiles=20db?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- autopeptideml/db/negative_sampling.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/autopeptideml/db/negative_sampling.py b/autopeptideml/db/negative_sampling.py index 5c5e69f..2285836 100644 --- a/autopeptideml/db/negative_sampling.py +++ b/autopeptideml/db/negative_sampling.py @@ -149,7 +149,8 @@ def add_negatives_from_db( verbose: bool = True, sample_by: str = 'mw', n_jobs: int = cpu_count(), - random_state: int = 1 + random_state: int = 1, + _to_seq: bool = False ) -> pd.DataFrame: """ Augments a dataset with negative samples from a target database to achieve a desired negative/positive ratio. @@ -206,7 +207,7 @@ def add_negatives_from_db( if isinstance(target_db, pd.DataFrame): db = target_db - + path = None else: db, path = get_neg_db(target_db, verbose=verbose, return_path=True) @@ -231,11 +232,12 @@ def add_negatives_from_db( n_bins = 50 else: n_bins = 10 - if 'sequence' not in db: + if 'sequence' not in db and _to_seq: from autopeptideml.pipeline import get_pipeline pipe = get_pipeline('to-sequences') db['sequence'] = pipe(db['smiles'], n_jobs=n_jobs, verbose=verbose) - db.to_csv(path, index=False) + if path is not None: + db.to_csv(path, index=False) db[sample_by], disc = discretizer(db[sample_by].to_numpy(), n_bins=n_bins, return_discretizer=True) From 99d6f065c540865e1721e0890e58bfa382f95674 Mon Sep 17 00:00:00 2001 From: RaulFD-creator Date: Thu, 30 Jul 2026 15:44:54 +0100 Subject: [PATCH 6/7] =?UTF-8?q?=F0=9F=AA=B2=20Fixed=20bug=20with=20adding?= =?UTF-8?q?=20negatives=20from=20smiles=20db?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- autopeptideml/db/negative_sampling.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/autopeptideml/db/negative_sampling.py b/autopeptideml/db/negative_sampling.py index 2285836..5dd879f 100644 --- a/autopeptideml/db/negative_sampling.py +++ b/autopeptideml/db/negative_sampling.py @@ -238,6 +238,8 @@ def add_negatives_from_db( db['sequence'] = pipe(db['smiles'], n_jobs=n_jobs, verbose=verbose) if path is not None: db.to_csv(path, index=False) + if not _to_seq: + all_seqs = [None for s in range(len(db))] db[sample_by], disc = discretizer(db[sample_by].to_numpy(), n_bins=n_bins, return_discretizer=True) From 905ad16615672a563d254a1b64efaf61f4d3b7ee Mon Sep 17 00:00:00 2001 From: RaulFD-creator Date: Thu, 30 Jul 2026 15:45:30 +0100 Subject: [PATCH 7/7] =?UTF-8?q?=F0=9F=AA=B2=20Fixed=20bug=20with=20adding?= =?UTF-8?q?=20negatives=20from=20smiles=20db?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- autopeptideml/db/negative_sampling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autopeptideml/db/negative_sampling.py b/autopeptideml/db/negative_sampling.py index 5dd879f..61a861c 100644 --- a/autopeptideml/db/negative_sampling.py +++ b/autopeptideml/db/negative_sampling.py @@ -239,7 +239,7 @@ def add_negatives_from_db( if path is not None: db.to_csv(path, index=False) if not _to_seq: - all_seqs = [None for s in range(len(db))] + db['sequence'] = [None for s in range(len(db))] db[sample_by], disc = discretizer(db[sample_by].to_numpy(), n_bins=n_bins, return_discretizer=True)