Skip to content

Commit

Permalink
Merge pull request #453 from MannLabs/develop
Browse files Browse the repository at this point in the history
v0.4.6
  • Loading branch information
straussmaximilian authored May 31, 2022
2 parents 46bfa52 + dac201b commit d100cae
Show file tree
Hide file tree
Showing 61 changed files with 8,764 additions and 7,868 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.4.5
current_version = 0.4.6
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<build>\d+))?
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ include settings.ini
include LICENSE
include CONTRIBUTING.md
include README.md
include modifications.tsv
include amino_acids.tsv
recursive-include alphapept *
recursive-exclude * __pycache__
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
![Quick Test](https://github.com/MannLabs/alphapept/workflows/Quick%20Test/badge.svg)
![Performance test](https://github.com/MannLabs/alphapept/workflows/Performance%20test/badge.svg)
![Windows Installer](https://github.com/MannLabs/alphapept/workflows/Windows%20Installer/badge.svg)
[![launch - renku](https://renkulab.io/renku-badge.svg)](https://renkulab.io/projects/renku-stories/alphapept-gui-streamlit)

[![DOI:10.1101/2021.07.23.453379](http://img.shields.io/badge/DOI-10.1101/2021.07.23.453379-B31B1B.svg)](https://www.biorxiv.org/content/10.1101/2021.07.23.453379v1)

Expand Down
2 changes: 1 addition & 1 deletion alphapept/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.4.5"
__version__ = "0.4.6"

__requirements__ = {
"": "requirements/requirements.txt",
Expand Down
2 changes: 1 addition & 1 deletion alphapept/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
AUTHOR_EMAIL = "straussmaximilian@gmail.com"
COPYRIGHT = "Mann Labs"
BRANCH = "master"
VERSION_NO = "0.4.5"
VERSION_NO = "0.4.6"
MIN_PYTHON = "3.6"
MAX_PYTHON = "4"
AUDIENCE = "Developers"
Expand Down
27 changes: 25 additions & 2 deletions alphapept/_nbdev.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,30 @@
"load_settings": "00_settings.ipynb",
"load_settings_as_template": "00_settings.ipynb",
"save_settings": "00_settings.ipynb",
"SETTINGS_TEMPLATE": "00_settings.ipynb",
"workflow": "00_settings.ipynb",
"general": "00_settings.ipynb",
"experiment": "00_settings.ipynb",
"raw": "00_settings.ipynb",
"fasta": "00_settings.ipynb",
"modfile_path": "10_constants.ipynb",
"mod_db": "00_settings.ipynb",
"mods": "00_settings.ipynb",
"mods_terminal": "00_settings.ipynb",
"mods_protein": "00_settings.ipynb",
"proteases": "00_settings.ipynb",
"features": "00_settings.ipynb",
"search": "00_settings.ipynb",
"score": "11_interface.ipynb",
"calibration": "00_settings.ipynb",
"matching": "00_settings.ipynb",
"quantification": "11_interface.ipynb",
"hash_file": "00_settings.ipynb",
"HOME": "00_settings.ipynb",
"AP_PATH": "00_settings.ipynb",
"DEFAULT_SETTINGS_PATH": "00_settings.ipynb",
"skip": "00_settings.ipynb",
"previous_md5": "00_settings.ipynb",
"IsotopeDistribution": "01_chem.ipynb",
"fast_add": "01_chem.ipynb",
"numba_bin": "01_chem.ipynb",
Expand Down Expand Up @@ -145,7 +169,6 @@
"add_column": "05_search.ipynb",
"remove_column": "05_search.ipynb",
"get_hits": "05_search.ipynb",
"score": "11_interface.ipynb",
"LOSS_DICT": "05_search.ipynb",
"LOSSES": "05_search.ipynb",
"get_sequences": "05_search.ipynb",
Expand Down Expand Up @@ -218,6 +241,7 @@
"match_datasets": "09_matching.ipynb",
"AAs": "10_constants.ipynb",
"get_mass_dict": "10_constants.ipynb",
"aafile_path": "10_constants.ipynb",
"Isotope": "10_constants.ipynb",
"isotopes": "10_constants.ipynb",
"averagine_aa": "10_constants.ipynb",
Expand All @@ -238,7 +262,6 @@
"protein_grouping": "11_interface.ipynb",
"match": "11_interface.ipynb",
"read_label_intensity": "11_interface.ipynb",
"quantification": "11_interface.ipynb",
"export": "11_interface.ipynb",
"run_complete_workflow": "11_interface.ipynb",
"extract_median_unique": "11_interface.ipynb",
Expand Down
File renamed without changes.
241 changes: 16 additions & 225 deletions alphapept/constants.py
Original file line number Diff line number Diff line change
@@ -1,239 +1,19 @@
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/10_constants.ipynb (unless otherwise specified).

__all__ = ['AAs', 'mass_dict', 'get_mass_dict', 'Isotope', 'spec', 'isotopes', 'averagine_aa', 'averagine_avg',
'protease_dict', 'loss_dict', 'LABEL', 'label_dict']
__all__ = ['AAs', 'get_mass_dict', 'modfile_path', 'aafile_path', 'mass_dict', 'Isotope', 'spec', 'isotopes',
'averagine_aa', 'averagine_avg', 'protease_dict', 'loss_dict', 'LABEL', 'label_dict']

# Cell
AAs = set('ACDEFGHIKLMNPQRSTUVWY')

# Cell

from numba import types
from numba.typed import Dict

mass_dict = Dict.empty(key_type=types.unicode_type, value_type=types.float64)

mass_dict["A"] = 71.0371138
mass_dict["C"] = 103.0091845
mass_dict["D"] = 115.0269431
mass_dict["E"] = 129.0425931
mass_dict["F"] = 147.0684139
mass_dict["G"] = 57.02146373
mass_dict["H"] = 137.0589119
mass_dict["I"] = 113.084064
mass_dict["K"] = 128.094963
mass_dict["L"] = 113.084064
mass_dict["M"] = 131.0404846
mass_dict["N"] = 114.0429275
mass_dict["P"] = 97.05276386
mass_dict["Q"] = 128.0585775
mass_dict["R"] = 156.101111
mass_dict["S"] = 87.03202843
mass_dict["T"] = 101.0476785
mass_dict["U"] = 150.9536333957
mass_dict["V"] = 99.06841392
mass_dict["W"] = 186.079313
mass_dict["Y"] = 163.0633286
mass_dict["cC"] = 160.03064823
mass_dict["oxM"] = 147.03539923000002
mass_dict["aA"] = 113.04767849000001
mass_dict["aC"] = 145.01974919
mass_dict["aD"] = 157.03750779
mass_dict["aE"] = 171.05315779
mass_dict["aF"] = 189.07897859
mass_dict["aG"] = 99.03202842
mass_dict["aH"] = 179.06947659
mass_dict["aI"] = 155.09462869
mass_dict["aK"] = 170.10552769
mass_dict["aL"] = 155.09462869
mass_dict["aM"] = 173.05104929
mass_dict["aN"] = 156.05349219000001
mass_dict["aP"] = 139.06332855
mass_dict["aQ"] = 170.06914219
mass_dict["aR"] = 198.11167569
mass_dict["aS"] = 129.04259312
mass_dict["aT"] = 143.05824319
mass_dict["aU"] = 192.9641980857
mass_dict["aV"] = 141.07897861
mass_dict["aW"] = 228.08987769
mass_dict["aY"] = 205.07389329
mass_dict["amA"] = 70.053098207
mass_dict["amC"] = 102.02516890700001
mass_dict["amD"] = 114.042927507
mass_dict["amE"] = 128.058577507
mass_dict["amF"] = 146.084398307
mass_dict["amG"] = 56.037448137
mass_dict["amH"] = 136.074896307
mass_dict["amI"] = 112.100048407
mass_dict["amK"] = 127.11094740700001
mass_dict["amL"] = 112.100048407
mass_dict["amM"] = 130.056469007
mass_dict["amN"] = 113.05891190700001
mass_dict["amP"] = 96.068748267
mass_dict["amQ"] = 127.07456190700002
mass_dict["amR"] = 155.117095407
mass_dict["amS"] = 86.048012837
mass_dict["amT"] = 100.06366290700001
mass_dict["amU"] = 149.9696178027
mass_dict["amV"] = 98.084398327
mass_dict["amW"] = 185.095297407
mass_dict["amY"] = 162.079313007
mass_dict["pS"] = 166.99835935
mass_dict["pT"] = 181.01400942
mass_dict["pY"] = 243.02965952
mass_dict["deamN"] = 115.026943093
mass_dict["deamQ"] = 129.04259309300002
mass_dict["cmC"] = 85.9826354
mass_dict["pgE"] = 111.03202841000001
mass_dict["pgQ"] = 111.03202840000002
mass_dict["tmt0A"] = 295.1895917
mass_dict["tmt0C"] = 327.1616624
mass_dict["tmt0D"] = 339.179421
mass_dict["tmt0E"] = 353.195071
mass_dict["tmt0F"] = 371.2208918
mass_dict["tmt0G"] = 281.17394163
mass_dict["tmt0H"] = 361.2113898
mass_dict["tmt0I"] = 337.2365419
mass_dict["tmt0K"] = 352.2474409
mass_dict["tmt0L"] = 337.2365419
mass_dict["tmt0M"] = 355.1929625
mass_dict["tmt0N"] = 338.1954054
mass_dict["tmt0P"] = 321.20524176000004
mass_dict["tmt0Q"] = 352.2110554
mass_dict["tmt0R"] = 380.2535889
mass_dict["tmt0S"] = 311.18450633
mass_dict["tmt0T"] = 325.2001564
mass_dict["tmt0U"] = 375.1061112957
mass_dict["tmt0V"] = 323.22089182
mass_dict["tmt0W"] = 410.2317909
mass_dict["tmt0Y"] = 387.2158065
mass_dict["tmt2A"] = 296.1929466
mass_dict["tmt2C"] = 328.16501730000004
mass_dict["tmt2D"] = 340.1827759
mass_dict["tmt2E"] = 354.1984259
mass_dict["tmt2F"] = 372.2242467
mass_dict["tmt2G"] = 282.17729653000004
mass_dict["tmt2H"] = 362.2147447
mass_dict["tmt2I"] = 338.2398968
mass_dict["tmt2K"] = 353.2507958
mass_dict["tmt2L"] = 338.2398968
mass_dict["tmt2M"] = 356.1963174
mass_dict["tmt2N"] = 339.1987603
mass_dict["tmt2P"] = 322.20859666
mass_dict["tmt2Q"] = 353.21441030000005
mass_dict["tmt2R"] = 381.25694380000004
mass_dict["tmt2S"] = 312.18786123
mass_dict["tmt2T"] = 326.2035113
mass_dict["tmt2U"] = 376.1094661957
mass_dict["tmt2V"] = 324.22424672
mass_dict["tmt2W"] = 411.23514580000005
mass_dict["tmt2Y"] = 388.2191614
mass_dict["tmt6A"] = 300.200046
mass_dict["tmt6C"] = 332.1721167
mass_dict["tmt6D"] = 344.1898753
mass_dict["tmt6E"] = 358.2055253
mass_dict["tmt6F"] = 376.2313461
mass_dict["tmt6G"] = 286.18439593
mass_dict["tmt6H"] = 366.2218441
mass_dict["tmt6I"] = 342.2469962
mass_dict["tmt6K"] = 357.2578952
mass_dict["tmt6L"] = 342.2469962
mass_dict["tmt6M"] = 360.2034168
mass_dict["tmt6N"] = 343.2058597
mass_dict["tmt6P"] = 326.21569606
mass_dict["tmt6Q"] = 357.2215097
mass_dict["tmt6R"] = 385.2640432
mass_dict["tmt6S"] = 316.19496062999997
mass_dict["tmt6T"] = 330.2106107
mass_dict["tmt6U"] = 380.11656559569997
mass_dict["tmt6V"] = 328.23134612
mass_dict["tmt6W"] = 415.2422452
mass_dict["tmt6Y"] = 392.2262608
mass_dict["itraq4KA"] = 215.13952419999998
mass_dict["itraq4KC"] = 247.1115949
mass_dict["itraq4KD"] = 259.1293535
mass_dict["itraq4KE"] = 273.14500350000003
mass_dict["itraq4KF"] = 291.1708243
mass_dict["itraq4KG"] = 201.12387413
mass_dict["itraq4KH"] = 281.1613223
mass_dict["itraq4KI"] = 257.1864744
mass_dict["itraq4KK"] = 272.1973734
mass_dict["itraq4KL"] = 257.1864744
mass_dict["itraq4KM"] = 275.142895
mass_dict["itraq4KN"] = 258.1453379
mass_dict["itraq4KP"] = 241.15517426
mass_dict["itraq4KQ"] = 272.1609879
mass_dict["itraq4KR"] = 300.2035214
mass_dict["itraq4KS"] = 231.13443883
mass_dict["itraq4KT"] = 245.15008890000001
mass_dict["itraq4KU"] = 295.0560437957
mass_dict["itraq4KV"] = 243.17082432
mass_dict["itraq4KW"] = 330.1817234
mass_dict["itraq4KY"] = 307.16573900000003
mass_dict["itraq4K"] = 272.1973734
mass_dict["itraq4Y"] = 307.16573900000003
mass_dict["itraq8KA"] = 375.2393133
mass_dict["itraq8KC"] = 407.211384
mass_dict["itraq8KD"] = 419.2291426
mass_dict["itraq8KE"] = 433.2447926
mass_dict["itraq8KF"] = 451.2706134
mass_dict["itraq8KG"] = 361.22366323
mass_dict["itraq8KH"] = 441.2611114
mass_dict["itraq8KI"] = 417.2862635
mass_dict["itraq8KK"] = 432.2971625
mass_dict["itraq8KL"] = 417.2862635
mass_dict["itraq8KM"] = 435.2426841
mass_dict["itraq8KN"] = 418.245127
mass_dict["itraq8KP"] = 401.25496336000003
mass_dict["itraq8KQ"] = 432.260777
mass_dict["itraq8KR"] = 460.3033105
mass_dict["itraq8KS"] = 391.23422793
mass_dict["itraq8KT"] = 405.249878
mass_dict["itraq8KU"] = 455.1558328957
mass_dict["itraq8KV"] = 403.27061342
mass_dict["itraq8KW"] = 490.2815125
mass_dict["itraq8KY"] = 467.2655281
mass_dict["itraq8K"] = 432.2971625
mass_dict["itraq8Y"] = 467.2655281
mass_dict["eA"] = 337.1209813
mass_dict["eC"] = 369.093052
mass_dict["eD"] = 381.1108106
mass_dict["eE"] = 395.1264606
mass_dict["eF"] = 413.1522814
mass_dict["eG"] = 323.10533123
mass_dict["eH"] = 403.1427794
mass_dict["eI"] = 379.1679315
mass_dict["eK"] = 394.1788305
mass_dict["eL"] = 379.1679315
mass_dict["eM"] = 397.1243521
mass_dict["eN"] = 380.126795
mass_dict["eP"] = 363.13663136
mass_dict["eQ"] = 394.142445
mass_dict["eR"] = 422.1849785
mass_dict["eS"] = 353.11589592999997
mass_dict["eT"] = 367.131546
mass_dict["eU"] = 417.03750089569996
mass_dict["eV"] = 365.15228142
mass_dict["eW"] = 452.1631805
mass_dict["eY"] = 429.1471961
mass_dict["arg10R"] = 166.10938057776002
mass_dict["arg6R"] = 162.121241
mass_dict["lys8K"] = 136.10916278888
mass_dict["Electron"] = 0.00054857990907
mass_dict["Proton"] = 1.00727646687
mass_dict["Hydrogen"] = 1.00782503223
mass_dict["C13"] = 13.003354835
mass_dict["Oxygen"] = 15.994914619
mass_dict["OH"] = 17.002739651229998
mass_dict["H2O"] = 18.01056468346

mass_dict["NH3"] = 17.03052
mass_dict["delta_M"] = 1.00286864
mass_dict["delta_S"] = 0.0109135

# Cell
import os

#generates the mass dictionary from table
def get_mass_dict(modfile:str="../modifications.tsv", aasfile: str="../amino_acids.tsv", verbose:bool=True):
def get_mass_dict(modfile:str, aasfile: str, verbose:bool=True):
"""
Function to create a mass dict based on tsv files.
This is used to create the hardcoded dict in the constants notebook.
Expand Down Expand Up @@ -304,6 +84,16 @@ def get_mass_dict(modfile:str="../modifications.tsv", aasfile: str="../amino_aci

return mass_dict

try:
base = os.path.dirname(os.path.abspath(__file__)) #Cant do this in notebook
except NameError:
base = os.path.join(os.pardir, 'alphapept')

modfile_path = os.path.join(base, "modifications.tsv")
aafile_path = os.path.join(base, "amino_acids.tsv")

mass_dict = get_mass_dict(modfile=modfile_path, aasfile=aafile_path, verbose=False)

# Cell
import numpy as np
from numba import int32, float32, float64, njit, types
Expand Down Expand Up @@ -381,6 +171,7 @@ def __init__(self, m0:int, dm:int, intensities:np.ndarray):
protease_dict["hydroxylamine"] = "N(?=G)"
protease_dict["iodosobenzoic acid"] = "W"
protease_dict["lysc"] = "K"
protease_dict["lysn"] = "N"
protease_dict["ntcb"] = "\w(?=C)"
protease_dict["pepsin ph1.3"] = "((?<=[^HKR][^P])[^R](?=[FL][^P]))|((?<=[^HKR][^P])[FL](?=\w[^P]))"
protease_dict["pepsin ph2.0"] = "((?<=[^HKR][^P])[^R](?=[FLWY][^P]))|((?<=[^HKR][^P])[FLWY](?=\w[^P]))"
Expand Down
Loading

0 comments on commit d100cae

Please sign in to comment.