spectrseqtools 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- spectrseqtools-0.1.0/.github/workflows/ci.yml +41 -0
- spectrseqtools-0.1.0/.github/workflows/conventional_prs.yml +16 -0
- spectrseqtools-0.1.0/.github/workflows/release_please.yml +45 -0
- spectrseqtools-0.1.0/.gitignore +17 -0
- spectrseqtools-0.1.0/CHANGELOG.md +49 -0
- spectrseqtools-0.1.0/LICENSE +674 -0
- spectrseqtools-0.1.0/PKG-INFO +26 -0
- spectrseqtools-0.1.0/README.md +0 -0
- spectrseqtools-0.1.0/pixi.lock +3413 -0
- spectrseqtools-0.1.0/pyproject.toml +72 -0
- spectrseqtools-0.1.0/spectrseqtools/__init__.py +0 -0
- spectrseqtools-0.1.0/spectrseqtools/assets/element_masses.tsv +6 -0
- spectrseqtools-0.1.0/spectrseqtools/assets/elemental_composition.tsv +5 -0
- spectrseqtools-0.1.0/spectrseqtools/assets/masses.tsv +145 -0
- spectrseqtools-0.1.0/spectrseqtools/cli.py +259 -0
- spectrseqtools-0.1.0/spectrseqtools/common.py +93 -0
- spectrseqtools-0.1.0/spectrseqtools/deconvolution.py +411 -0
- spectrseqtools-0.1.0/spectrseqtools/fragment_classification.py +139 -0
- spectrseqtools-0.1.0/spectrseqtools/linear_program.py +325 -0
- spectrseqtools-0.1.0/spectrseqtools/mass_explanation.py +320 -0
- spectrseqtools-0.1.0/spectrseqtools/mass_table.py +487 -0
- spectrseqtools-0.1.0/spectrseqtools/masses.py +160 -0
- spectrseqtools-0.1.0/spectrseqtools/plotting.py +157 -0
- spectrseqtools-0.1.0/spectrseqtools/prediction.py +322 -0
- spectrseqtools-0.1.0/spectrseqtools/preprocessing.py +130 -0
- spectrseqtools-0.1.0/spectrseqtools/singleton_identification.py +225 -0
- spectrseqtools-0.1.0/spectrseqtools/skeleton_building.py +516 -0
- spectrseqtools-0.1.0/spectrseqtools/utils.py +68 -0
- spectrseqtools-0.1.0/tests/__init__.py +0 -0
- spectrseqtools-0.1.0/tests/test_deconvolution.py +20 -0
- spectrseqtools-0.1.0/tests/test_explain_masses.py +134 -0
- spectrseqtools-0.1.0/tests/test_prediction.py +237 -0
- spectrseqtools-0.1.0/tests/testcases/test_01/fragments.meta.yaml +6 -0
- spectrseqtools-0.1.0/tests/testcases/test_01/fragments.tsv +60 -0
- spectrseqtools-0.1.0/tests/testcases/test_02/fragments.meta.yaml +6 -0
- spectrseqtools-0.1.0/tests/testcases/test_02/fragments.tsv +106 -0
- spectrseqtools-0.1.0/tests/testcases/test_03/fragments.meta.yaml +6 -0
- spectrseqtools-0.1.0/tests/testcases/test_03/fragments.tsv +520 -0
- spectrseqtools-0.1.0/tests/testcases/test_04/fragments.meta.yaml +6 -0
- spectrseqtools-0.1.0/tests/testcases/test_04/fragments.tsv +607 -0
- spectrseqtools-0.1.0/tests/testcases/test_05/fragments.meta.yaml +6 -0
- spectrseqtools-0.1.0/tests/testcases/test_05/fragments.tsv +908 -0
- spectrseqtools-0.1.0/tests/testcases/test_06/fragments.meta.yaml +6 -0
- spectrseqtools-0.1.0/tests/testcases/test_06/fragments.tsv +197 -0
- spectrseqtools-0.1.0/tests/testcases/test_07/fragments.meta.yaml +6 -0
- spectrseqtools-0.1.0/tests/testcases/test_07/fragments.tsv +404 -0
- spectrseqtools-0.1.0/tests/testcases/test_08/fragments.meta.yaml +6 -0
- spectrseqtools-0.1.0/tests/testcases/test_08/fragments.tsv +758 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ "main" ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ "main" ]
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
fmt:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v5
|
|
17
|
+
|
|
18
|
+
- uses: prefix-dev/setup-pixi@v0
|
|
19
|
+
|
|
20
|
+
- run: |
|
|
21
|
+
pixi run format --check
|
|
22
|
+
|
|
23
|
+
lint:
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@v5
|
|
27
|
+
|
|
28
|
+
- uses: prefix-dev/setup-pixi@v0
|
|
29
|
+
|
|
30
|
+
- run: |
|
|
31
|
+
pixi run lint
|
|
32
|
+
|
|
33
|
+
test:
|
|
34
|
+
runs-on: ubuntu-latest
|
|
35
|
+
steps:
|
|
36
|
+
- uses: actions/checkout@v5
|
|
37
|
+
|
|
38
|
+
- uses: prefix-dev/setup-pixi@v0
|
|
39
|
+
|
|
40
|
+
- run: |
|
|
41
|
+
pixi run test -v
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
name: PR
|
|
2
|
+
on:
|
|
3
|
+
pull_request_target:
|
|
4
|
+
types:
|
|
5
|
+
- opened
|
|
6
|
+
- reopened
|
|
7
|
+
- edited
|
|
8
|
+
- synchronize
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
title-format:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: amannn/action-semantic-pull-request@v3.4.0
|
|
15
|
+
env:
|
|
16
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
on:
|
|
2
|
+
push:
|
|
3
|
+
branches:
|
|
4
|
+
- main
|
|
5
|
+
|
|
6
|
+
name: release-please
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
issues: write
|
|
11
|
+
pull-requests: write
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
release-please:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
outputs:
|
|
17
|
+
release_created: ${{ steps.release.outputs.release_created }}
|
|
18
|
+
steps:
|
|
19
|
+
- uses: GoogleCloudPlatform/release-please-action@v3
|
|
20
|
+
id: release
|
|
21
|
+
with:
|
|
22
|
+
release-type: python
|
|
23
|
+
package-name: spectrseqtools
|
|
24
|
+
|
|
25
|
+
publish:
|
|
26
|
+
runs-on: ubuntu-latest
|
|
27
|
+
needs: release-please
|
|
28
|
+
if: ${{ needs.release-please.outputs.release_created }}
|
|
29
|
+
permissions:
|
|
30
|
+
id-token: write
|
|
31
|
+
environment:
|
|
32
|
+
name: pypi
|
|
33
|
+
url: https://pypi.org/p/spectrseqtools
|
|
34
|
+
steps:
|
|
35
|
+
- uses: actions/checkout@v3
|
|
36
|
+
|
|
37
|
+
- name: Setup pixi
|
|
38
|
+
uses: prefix-dev/setup-pixi@v0
|
|
39
|
+
|
|
40
|
+
- name: Build source and wheel distribution + check build
|
|
41
|
+
run: |
|
|
42
|
+
pixi run -e dev check-build
|
|
43
|
+
|
|
44
|
+
- name: Publish to PyPI
|
|
45
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
__pycache__
|
|
2
|
+
.idea
|
|
3
|
+
.pytest_cache
|
|
4
|
+
poetry.lock
|
|
5
|
+
*.DS_Store
|
|
6
|
+
*gurobi.log
|
|
7
|
+
*.code-workspace
|
|
8
|
+
tests/self_test*
|
|
9
|
+
tests/testcases/*/fragments.plot.html
|
|
10
|
+
tests/testcases/*/fragments.plot.end.html
|
|
11
|
+
tests/testcases/*/fragments.plot.internal.html
|
|
12
|
+
tests/testcases/*/fragments.plot.start.html
|
|
13
|
+
tests/testcases/*/fragments.raw
|
|
14
|
+
tests/testcases/*/fragments.singletons.tsv
|
|
15
|
+
tests/testcases/*/fragments.standard_unit_fragments.tsv
|
|
16
|
+
tests/testcases/*/fragments.testing.meta.yaml
|
|
17
|
+
tests/scratch_*
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0 (2026-01-30)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add modification rate ([#12](https://github.com/spectrseq/spectrseqtools/issues/12)) ([450e586](https://github.com/spectrseq/spectrseqtools/commit/450e586c6a764e3098300b2ffc95b3146d8e5d26))
|
|
9
|
+
* add option to set lp time limits ([#40](https://github.com/spectrseq/spectrseqtools/issues/40)) ([555eef7](https://github.com/spectrseq/spectrseqtools/commit/555eef7703a4af3b30f5e96ca8124dadb153bdd3))
|
|
10
|
+
* add option to set output directory ([#44](https://github.com/spectrseq/spectrseqtools/issues/44)) ([0119188](https://github.com/spectrseq/spectrseqtools/commit/0119188753e54c1e6114b3e0b8adecf2353ce850))
|
|
11
|
+
* add preprocessing ([#21](https://github.com/spectrseq/spectrseqtools/issues/21)) ([40c5214](https://github.com/spectrseq/spectrseqtools/commit/40c521476289f6e6a017c5f3ba81a55c0faf0fbf))
|
|
12
|
+
* additionally output sequence with all alternate nucleotides ([#42](https://github.com/spectrseq/spectrseqtools/issues/42)) ([675a310](https://github.com/spectrseq/spectrseqtools/commit/675a31004fd52d751640fdeaa43b4a533c8d13d6))
|
|
13
|
+
* allow both raw and preprocessed data as input ([#23](https://github.com/spectrseq/spectrseqtools/issues/23)) ([d4d353a](https://github.com/spectrseq/spectrseqtools/commit/d4d353a97f1d95f0b171e9cbd4e2a5b5096ec7ba))
|
|
14
|
+
* allow singleton selection for tsv input ([#29](https://github.com/spectrseq/spectrseqtools/issues/29)) ([0beb9cd](https://github.com/spectrseq/spectrseqtools/commit/0beb9cd7bd740d67f98cea38011ac62cc2df2e4c))
|
|
15
|
+
* allow using lp based filter on terminal fragments ([#45](https://github.com/spectrseq/spectrseqtools/issues/45)) ([fac53a6](https://github.com/spectrseq/spectrseqtools/commit/fac53a6bc331617b5671205a7bbb21e5635fb8b0))
|
|
16
|
+
* build skeleton and use that to constrain the MILP ([15b21bd](https://github.com/spectrseq/spectrseqtools/commit/15b21bd1f7b439d7f48ff0c41bdf8c660c061177))
|
|
17
|
+
* enable recomputing of dp table ([#22](https://github.com/spectrseq/spectrseqtools/issues/22)) ([5f7ffd7](https://github.com/spectrseq/spectrseqtools/commit/5f7ffd75edeefa13fd4c52f34b368af117bdc20c))
|
|
18
|
+
* establish standard unit masses for simplified nucleotide consideration ([#15](https://github.com/spectrseq/spectrseqtools/issues/15)) ([ab5206d](https://github.com/spectrseq/spectrseqtools/commit/ab5206d5a0ade3e9db03dd86338cd7e4ca5c4d94))
|
|
19
|
+
* estimate sequence length ([#20](https://github.com/spectrseq/spectrseqtools/issues/20)) ([a6bc2d6](https://github.com/spectrseq/spectrseqtools/commit/a6bc2d60dd01d578e5c9107d7ff5f678865d3657))
|
|
20
|
+
* explain observed masses or mass differences using dynamic programming ([#3](https://github.com/spectrseq/spectrseqtools/issues/3)) ([c36b8cc](https://github.com/spectrseq/spectrseqtools/commit/c36b8cc474194e5f6f9ec129318af14507de10b9))
|
|
21
|
+
* extend dp to nucleotides ([#9](https://github.com/spectrseq/spectrseqtools/issues/9)) ([0b5f411](https://github.com/spectrseq/spectrseqtools/commit/0b5f411edac2f6e88ec46700fb438638623a0e82))
|
|
22
|
+
* filter early retention times with noise peaks ([#32](https://github.com/spectrseq/spectrseqtools/issues/32)) ([b7b1301](https://github.com/spectrseq/spectrseqtools/commit/b7b130113844397d42eeb14c09abdec303e09712))
|
|
23
|
+
* filter fragments with lp ([#10](https://github.com/spectrseq/spectrseqtools/issues/10)) ([0b947fc](https://github.com/spectrseq/spectrseqtools/commit/0b947fc04a267bf7ed8ab76fd27ff934f9bd49a3))
|
|
24
|
+
* filter fragments with sequence mass ([#16](https://github.com/spectrseq/spectrseqtools/issues/16)) ([d51e573](https://github.com/spectrseq/spectrseqtools/commit/d51e5733b2963a1cce827527c3fc1f5bb1f12626))
|
|
25
|
+
* group same-weight fragments during skeleton building ([#17](https://github.com/spectrseq/spectrseqtools/issues/17)) ([e3d34f5](https://github.com/spectrseq/spectrseqtools/commit/e3d34f57b3361de11529339c5fa1cbf5a9b33ece))
|
|
26
|
+
* improve sequence length estimation with lp based selection ([#26](https://github.com/spectrseq/spectrseqtools/issues/26)) ([b102ffb](https://github.com/spectrseq/spectrseqtools/commit/b102ffbd844a73191cd379d111aa085ce501c544))
|
|
27
|
+
* plot different fragment classes individually ([#46](https://github.com/spectrseq/spectrseqtools/issues/46)) ([281a848](https://github.com/spectrseq/spectrseqtools/commit/281a84802ad6d8d0c11f745cdafad7445676afd5))
|
|
28
|
+
* reduce alphabet after skeleton building ([#19](https://github.com/spectrseq/spectrseqtools/issues/19)) ([4e95659](https://github.com/spectrseq/spectrseqtools/commit/4e95659685b1e07b5bf3cb94c2d285ff867c2e9c))
|
|
29
|
+
* set intensity cutoff based on percentile ([#41](https://github.com/spectrseq/spectrseqtools/issues/41)) ([cfc1085](https://github.com/spectrseq/spectrseqtools/commit/cfc1085f096f55439e2b6999fe7f8ea28ba22261))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Bug Fixes
|
|
33
|
+
|
|
34
|
+
* allow using cli ([#13](https://github.com/spectrseq/spectrseqtools/issues/13)) ([09a65af](https://github.com/spectrseq/spectrseqtools/commit/09a65afa989d3912715505a209e35ed6cab7154a))
|
|
35
|
+
* catch exceptions during lp initialization for ambiguity removal ([#39](https://github.com/spectrseq/spectrseqtools/issues/39)) ([4bf108b](https://github.com/spectrseq/spectrseqtools/commit/4bf108b2e415d1c1edfd8e95061d21651555ff28))
|
|
36
|
+
* catch exceptions if no prediction is possible ([#30](https://github.com/spectrseq/spectrseqtools/issues/30)) ([02405e1](https://github.com/spectrseq/spectrseqtools/commit/02405e16f53a72a5424232f1d8f18d001934c05d))
|
|
37
|
+
* catch exceptions while solving lp ([#38](https://github.com/spectrseq/spectrseqtools/issues/38)) ([7ea9737](https://github.com/spectrseq/spectrseqtools/commit/7ea97376bb708adf9abd93864191057a1b0d08da))
|
|
38
|
+
* catch nonetype bases during lp evaluation ([#37](https://github.com/spectrseq/spectrseqtools/issues/37)) ([4c5c695](https://github.com/spectrseq/spectrseqtools/commit/4c5c695fc16af46b99765e13fa3d69adb0ed9371))
|
|
39
|
+
* ensure correct fragment end indices for lp ([#25](https://github.com/spectrseq/spectrseqtools/issues/25)) ([051e744](https://github.com/spectrseq/spectrseqtools/commit/051e7448d0bb32747d83ec5b7966df701c7cfed5))
|
|
40
|
+
* ensure usage of correct singleton path ([#35](https://github.com/spectrseq/spectrseqtools/issues/35)) ([51264eb](https://github.com/spectrseq/spectrseqtools/commit/51264eb74d65533955781064bcbc99309a408441))
|
|
41
|
+
* filter singletons by combined tag mass ([#24](https://github.com/spectrseq/spectrseqtools/issues/24)) ([7b6ab9a](https://github.com/spectrseq/spectrseqtools/commit/7b6ab9a04282f706eebaa56ca5b625e313efd2e5))
|
|
42
|
+
* map singletons to mass representative to avoid filtering them out ([#33](https://github.com/spectrseq/spectrseqtools/issues/33)) ([82de7e8](https://github.com/spectrseq/spectrseqtools/commit/82de7e88b4971c6f2d198d5ae12c6a4b20427bc8))
|
|
43
|
+
* plot only one base at each position of global sequence ([#34](https://github.com/spectrseq/spectrseqtools/issues/34)) ([f6ec9a2](https://github.com/spectrseq/spectrseqtools/commit/f6ec9a2880b3fa35cccacbdb6aa5189455c58c11))
|
|
44
|
+
* skip fragments with non-explainable masses during ladder building; allow start fragments to reach the end, and vice versa; non certain start or end fragments may also touch start and end and even span the entire sequence ([#7](https://github.com/spectrseq/spectrseqtools/issues/7)) ([9a1f03b](https://github.com/spectrseq/spectrseqtools/commit/9a1f03b5c6eb243399c495ac3463d201dfd04a7b))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### Performance Improvements
|
|
48
|
+
|
|
49
|
+
* further limit MILP by terminal fragment ladder skeleton ([6e9b7aa](https://github.com/spectrseq/spectrseqtools/commit/6e9b7aa97f3a094b4cbecbb2f2721c2abd444893))
|