Skip to content

Commit

Permalink
Merge pull request #249 from Mesnage-Org/mainline-3-1-crosslinks
Browse files Browse the repository at this point in the history
  • Loading branch information
ns-rse committed Feb 14, 2024
2 parents 2904aa1 + 3a5ae41 commit dc4240d
Show file tree
Hide file tree
Showing 15 changed files with 1,865 additions and 1,783 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ jobs:
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: lib/dist/
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.1.1] - 2023-11-06

### Changed

- Changed cross-linking modifications to read donor-acceptor (#249)

## [1.1.0] - 2023-10-15

### Added

- Added a modification for enabling 3-1 cross-linking (#249)

### Fixed

- Removed the trailing space after bracketed modifications (#249)

## [1.0.3] - 2023-09-04

### Fixed
Expand Down Expand Up @@ -48,7 +64,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

Let there be peptidoglycan.

[Unreleased]: https://github.com/Mesnage-Org/pgfinder/compare/v1.0.3...HEAD
[Unreleased]: https://github.com/Mesnage-Org/pgfinder/compare/v1.1.1...HEAD
[1.1.1]: https://github.com/Mesnage-Org/pgfinder/compare/v1.1.0...v1.1.1
[1.1.0]: https://github.com/Mesnage-Org/pgfinder/compare/v1.0.3...v1.1.0
[1.0.3]: https://github.com/Mesnage-Org/pgfinder/compare/v1.0.2...v1.0.3
[1.0.2]: https://github.com/Mesnage-Org/pgfinder/compare/v1.0.1...v1.0.2
[1.0.1]: https://github.com/Mesnage-Org/pgfinder/compare/v1.0.0...v1.0.1
Expand Down
2 changes: 2 additions & 0 deletions lib/docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ pip install pgfinder

Versions are released automatically when commits on GitHub are tagged.

## Development

To install the most recent pre-release version, use:

``` bash
Expand Down
3 changes: 2 additions & 1 deletion lib/pgfinder/config/allowed_modifications.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Cross-Linked Multimers (=)
3-3 and 4-3 Cross-Linked Multimers (=)
1-3 Cross-Linked Multimers (=)
Glycosidic Multimers (-)
Lactyl Multimers (=Lac)

Expand Down
6 changes: 5 additions & 1 deletion lib/pgfinder/config/parameters.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
multimer:
Cross-Linked Multimers (=):
3-3 and 4-3 Cross-Linked Multimers (=):
gm-AE:
mass: 698.2858
mult_num: 2
Expand All @@ -18,6 +18,10 @@ multimer:
gm-AEJA=gm-AEJA:
mass: 1864.8044
mult_num: 3
1-3 Cross-Linked Multimers (=):
gm-A:
mass: 569.2433
mult_num: 2
Glycosidic Multimers (-):
gm-AE:
mass: 696.2702
Expand Down
3 changes: 2 additions & 1 deletion lib/pgfinder/default_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ ppm_tolerance: 10
consolidation_ppm: 1
time_delta: 0.5
mod_list:
# - Cross-Linked Multimers (=)
# - 3-3 and 4-3 Cross-Linked Multimers (=)
# - 1-3 Cross-Linked Multimers (=)
# - Glycosidic Multimers (-)
# - Lactyl Multimers (=Lac)

Expand Down
2 changes: 1 addition & 1 deletion lib/pgfinder/matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def modification_generator(filtered_theo_df: pd.DataFrame, mod_type: str) -> pd.
# The silly `len(s) - 2` rubbish here is to preserve the `|x` multimer number at the end of
# each structure name
def default_case(s):
return s[: len(s) - 2] + " " + mod_abbr + " " + s[len(s) - 2 : len(s)]
return s[: len(s) - 2] + " " + mod_abbr + s[len(s) - 2 : len(s)]

structure_updater = special_cases.get(mod_type, default_case)

Expand Down
8 changes: 8 additions & 0 deletions lib/pgfinder/pgio.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,14 @@ def theo_masses_reader(file: Union[str, Path]) -> pd.DataFrame:
"columns. Have you checked the format of your database against one of the built-in databases?"
)
) from e
# Check that all structures are followed by "|n" where n is one or more digits
if not theo_masses_df["Inferred structure"].str.contains(r"\|\d+$").all():
raise UserError(
(
"The supplied mass database contains structures missing the '|n' suffix encoding oligomerisation "
"state. This should be '|1' for monomers, '|2' for dimers, '|3' for trimers, and so on."
)
)
theo_masses_df.attrs["file"] = PurePath(file).name
LOGGER.info(f"Theoretical masses loaded from : {file}")
return theo_masses_df
Expand Down
1 change: 0 additions & 1 deletion lib/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ exclude = ["tests"]

[tool.setuptools_scm]
root = ".."
write_to = "lib/pgfinder/_version.py"

[tool.pytest.ini_options]
minversion = "7.0"
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2,716 changes: 1,390 additions & 1,326 deletions lib/tests/_regtest_outputs/test_regression.test_matching_mq_baseline.out

Large diffs are not rendered by default.

38 changes: 0 additions & 38 deletions web/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion web/src/lib/pgfinder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let pyodide: PyodideInterface;
pyodide.registerJsModule('pyio', pyio);
await pyodide.loadPackage(['micropip', 'sqlite3']);
const micropip = pyodide.pyimport('micropip');
await micropip.install('pgfinder');
await micropip.install('pgfinder==1.1.1');
await pyodide.runPythonAsync('import pgfinder; from pgfinder.gui.shim import *');

const pgfinderVersion = await pyodide.runPythonAsync('pgfinder.__version__');
Expand Down
3 changes: 2 additions & 1 deletion web/tests/complex_search_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ test('run a complex search', async ({ page }) => {
await page.getByRole('option', { name: 'Complex' }).click();

await page.getByRole('button', { name: 'Advanced Options' }).click();
await page.getByRole('option', { name: 'Cross-Linked Multimers (=)' }).click();
await page.getByRole('option', { name: '3-3 and 4-3 Cross-Linked Multimers (=)' }).click();
await page.getByRole('option', { name: '1-3 Cross-Linked Multimers (=)' }).click();
await page.getByRole('option', { name: 'Glycosidic Multimers (-)' }).click();
await page.getByRole('option', { name: 'Lactyl Multimers (=Lac)' }).click();
await page.getByRole('option', { name: 'Anhydro-MurNAc (Anh)' }).click();
Expand Down

0 comments on commit dc4240d

Please sign in to comment.