Skip to content

Commit

Permalink
Merge pull request #550 from MannLabs/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
straussmaximilian authored Jul 26, 2023
2 parents e884f8f + dbc09a7 commit 8793d48
Show file tree
Hide file tree
Showing 63 changed files with 24,645 additions and 15,909 deletions.
2 changes: 1 addition & 1 deletion alphapept/feature_finding.py
Original file line number Diff line number Diff line change
Expand Up @@ -1645,7 +1645,7 @@ def feature_finder_report(query_data:dict, isotope_patterns:list, isotope_charge
mass_data = np.array(query_data['mass_list_ms1'])
rt_idx = np.searchsorted(indices_, np.arange(len(mass_data)), side='right') - 1

lookup_idx= np.zeros((len(mass_data),2), dtype=np.int)-1
lookup_idx= np.zeros((len(mass_data),2), dtype=np.int32)-1

int_data = np.array(query_data['int_list_ms1'])

Expand Down
14 changes: 9 additions & 5 deletions alphapept/gui/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,12 @@ def status():
log_txt = []
f = open(logfile, "r")

lines = f.readlines()[-200:] # Limit to 200 lines

lines = f.readlines()[-200:]
for line in lines:
if "__progress_current" in line:
current_p_ = float(line.split("__progress_current ")[1][:5])
##lol
current.progress(current_p_)

current_p.text(f"Current progress: {current_p_*100:.2f}%")
Expand All @@ -289,12 +290,12 @@ def status():
queue_df["Created"] = created

queue_table.table(queue_df)

failed = list_experiments(FAILED_PATH)
failed['Success'] = ""
failed['Success'] = "False"

success = list_experiments(PROCESSED_PATH)
success['Success'] = ""
success['Success'] = "True/Processing"

res = pd.concat([failed, success])
res = res.sort_values('Creation Time', ascending=False)
Expand All @@ -303,3 +304,6 @@ def status():

res_table.table(res.head(5))
time.sleep(0.4)



7 changes: 7 additions & 0 deletions alphapept/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,13 @@ def parallel_execute(
if not step(to_process[0], callback=callback, parallel=True):
failed.append(files[0])

elif n_processes == 1:
logging.info(f'Proccessing one by one...')

for i in tqdm.tqdm(range(len(to_process))):
if not step(to_process[i], callback=callback, parallel=True):
failed.append(files[i])

else:
#Limit number of processes for Bruker FF
if step.__name__ == 'find_features':
Expand Down
12 changes: 11 additions & 1 deletion alphapept/modifications.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,14 @@ EASItag 6-plex on peptide N-terminus peptide N-terminus < 266.0838675 266.083867
EASItag 6-plex on K amino acid residue K 266.0838675 266.0838675 0 0 none 999999999 EASItag6plex 12C513C5H15O5NS eK
Arg 10 on peptide C-terminus peptide C-terminus R 10.008269577760007 10.008269577760007 0 0 none none Arg10 13C615N4 arg10>R
Arg 6 on peptide C-terminus peptide C-terminus R 6.020130000000005 6.020130000000005 0 0 none none Arg6 13C6 arg6>R
Lys 8 on peptide C-terminus peptide C-terminus K 8.014199788880006 8.014199788880006 0 0 none none Lys8 13C15N2 lys8>K
Lys 8 on peptide C-terminus peptide C-terminus K 8.014199788880006 8.014199788880006 0 0 none none Lys8 13C15N2 lys8>K
dimeth_0 on peptide N-terminus peptide N-terminus < 28.0313 28.0313 0 0 none 999999999 dimeth_0 none dimeth0<^
dimeth_0 on K amino acid residue K 28.0313 28.0313 0 0 none 999999999 dimeth_0 none dimeth0K
dimeth_4 on peptide N-terminus peptide N-terminus < 30.0439 30.0439 0 0 none 999999999 dimeth_4 none dimeth4<^
dimeth_4 on K amino acid residue K 30.0439 30.0439 0 0 none 999999999 dimeth_4 none dimeth4K
dimeth_8 on peptide N-terminus peptide N-terminus < 32.0564 32.0564 0 0 none 999999999 dimeth_8 none dimeth8<^
dimeth_8 on K amino acid residue K 32.0564 32.0564 0 0 none 999999999 dimeth_8 none dimeth8K
dimeth_12 on peptide N-terminus peptide N-terminus < 34.0690 34.0690 0 0 none 999999999 dimeth_12 none dimeth12<^
dimeth_12 on K amino acid residue K 34.0690 34.0690 0 0 none 999999999 dimeth_12 none dimeth12K
dimeth_16 on peptide N-terminus peptide N-terminus < 36.0757 36.0757 0 0 none 999999999 dimeth_16 none dimeth16<^
dimeth_16 on K amino acid residue K 36.0757 36.0757 0 0 none 999999999 dimeth_16 none dimeth16K
66 changes: 66 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
repository: mannlabs/alphapept
output: web
topnav_title: alphapept
site_title: alphapept
company_name: Mann Labs
description: A modular, python-based framework for mass spectrometry.
# Set to false to disable KaTeX math
use_math: true
# Add Google analytics id if you have one and want to use it here
google_analytics:
# See http://nbdev.fast.ai/search for help with adding Search
google_search:

host: 127.0.0.1
# the preview server used. Leave as is.
port: 4000
# the port where the preview is rendered.

exclude:
- .idea/
- .gitignore
- vendor

exclude: [vendor]

highlighter: rouge
markdown: kramdown
kramdown:
input: GFM
auto_ids: true
hard_wrap: false
syntax_highlighter: rouge

collections:
tooltips:
output: false

defaults:
-
scope:
path: ""
type: "pages"
values:
layout: "page"
comments: true
search: true
sidebar: home_sidebar
topnav: topnav
-
scope:
path: ""
type: "tooltips"
values:
layout: "page"
comments: true
search: true
tooltip: true

sidebars:
- home_sidebar

plugins:
- jekyll-remote-theme

remote_theme: fastai/nbdev-jekyll-theme
baseurl: /
10 changes: 10 additions & 0 deletions docs/_data/topnav.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
topnav:
- title: Topnav
items:
- title: github
external_url: https://github.com/mannlabs/alphapept/tree/master/

#Topnav dropdowns
topnav_dropdowns:
- title: Topnav dropdowns
folders:
2 changes: 1 addition & 1 deletion nbs/04_feature_finding.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2323,7 +2323,7 @@
" mass_data = np.array(query_data['mass_list_ms1'])\n",
" rt_idx = np.searchsorted(indices_, np.arange(len(mass_data)), side='right') - 1\n",
" \n",
" lookup_idx= np.zeros((len(mass_data),2), dtype=np.int)-1\n",
" lookup_idx= np.zeros((len(mass_data),2), dtype=np.int32)-1\n",
"\n",
" int_data = np.array(query_data['int_list_ms1'])\n",
"\n",
Expand Down
7 changes: 7 additions & 0 deletions nbs/11_interface.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1425,6 +1425,13 @@
" if not step(to_process[0], callback=callback, parallel=True):\n",
" failed.append(files[0])\n",
"\n",
" elif n_processes == 1:\n",
" logging.info(f'Proccessing one by one...')\n",
"\n",
" for i in tqdm.tqdm(range(len(to_process))):\n",
" if not step(to_process[i], callback=callback, parallel=True):\n",
" failed.append(files[i])\n",
" \n",
" else:\n",
" #Limit number of processes for Bruker FF\n",
" if step.__name__ == 'find_features':\n",
Expand Down
6 changes: 5 additions & 1 deletion nbs/additional_code.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@
"\n",
"The files `test_ci.py` and `test_gpu_.py` are part of the continous integration pipeline. As indicated in the `contributing`-page they can be run on a local machines.\n",
"\n",
":::{.callout-note}\n\nUnless you are a core developer, there should not be the need to add integration tests. Feel free to create a PR in case.\n\n:::"
":::{.callout-note}\n",
"\n",
"Unless you are a core developer, there should not be the need to add integration tests. Feel free to create a PR in case.\n",
"\n",
":::"
]
},
{
Expand Down
36 changes: 30 additions & 6 deletions nbs/contributing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,17 @@
"* When using Visual Studio Code, you can use the `Python Docstring Generator` to automatically generate the docstrings with this format.\n",
"* When changing the docstrings in the code, you can propagate the changes back to the notebooks with `nbdev_update_lib [filename]`.\n",
"\n",
":::{.callout-note}\n\nType hints are highly recommended but not mandatory (see also [PEP484](https://www.python.org/dev/peps/pep-0484/)). As the Legacy codebase had no type hints, we are slowly moving towards more type hinting coverage.\n\n:::\n",
":::{.callout-note}\n",
"\n",
":::{.callout-note}\n\nAdding additional elements (e.g lines like -------) to the docstring could break how the documentation is displayed. Below is the function from above but exported to show how it would appear in the documentation.\n\n:::"
"Type hints are highly recommended but not mandatory (see also [PEP484](https://www.python.org/dev/peps/pep-0484/)). As the Legacy codebase had no type hints, we are slowly moving towards more type hinting coverage.\n",
"\n",
":::\n",
"\n",
":::{.callout-note}\n",
"\n",
"Adding additional elements (e.g lines like -------) to the docstring could break how the documentation is displayed. Below is the function from above but exported to show how it would appear in the documentation.\n",
"\n",
":::"
]
},
{
Expand Down Expand Up @@ -246,7 +254,11 @@
"test_function_a()\n",
"```\n",
"\n",
":::{.callout-note}\n\nAlphaPept contains a testfolder `testfiles` with testfiles which are used for some functions to perform tests on files.\n\n:::"
":::{.callout-note}\n",
"\n",
"AlphaPept contains a testfolder `testfiles` with testfiles which are used for some functions to perform tests on files.\n",
"\n",
":::"
]
},
{
Expand Down Expand Up @@ -275,7 +287,11 @@
"\n",
"### Adding an integration test\n",
"\n",
":::{.callout-note}\n\nUnless you are a core developer, there should not be the need to add integration tests. Feel free to create a PR in case.\n\n:::\n",
":::{.callout-note}\n",
"\n",
"Unless you are a core developer, there should not be the need to add integration tests. Feel free to create a PR in case.\n",
"\n",
":::\n",
"\n",
"The best way to add an integration test is by specifying a new test in `test_ci.py` and then adding a job to the `performance_test` action. `test_ci.py` contains a file dictionary with links to files. The idea here is as follows: On the local machine, there should be a `BASE_DIR` that contains all files used for running the test cases. If the files are not present, the script will download them with the URL from the file dictionary. To define a test case, one needs to initiate a `TestRun`-class and provide the files to be used. Running a test will always take the current `default_settings.yaml` and modifying the respective files. You can add subsequent analysis (e.g., such as calculating the false discovery FDR for a mixed species experiment by adding a function to the test class.\n",
"\n",
Expand All @@ -284,14 +300,22 @@
"\n",
"### Integrating Actions\n",
"\n",
":::{.callout-note}\n\nUnless you are a core developer, there should not be the need to add GitHub Actions. Feel free to create a PR in case.\n\n:::\n",
":::{.callout-note}\n",
"\n",
"Unless you are a core developer, there should not be the need to add GitHub Actions. Feel free to create a PR in case.\n",
"\n",
":::\n",
"\n",
"New actions can be added by creating a `.yml` file and placing it in the workflows folder.\n",
"We can distinguish local actions, which run on our self-hosted [runners](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners) and cloud actions that run on GitHub servers.\n",
"\n",
"The local runners are meant to run computationally intensive tasks such as the `performance_test` and the `quick_test`, whereas the cloud actions are meant for unit tests.\n",
"\n",
":::{.callout-note}\n\nIf you fork the repository, you will not be able to execute tests on the local runners. They are restricted to the `MannLabs` repository.\n\n:::\n",
":::{.callout-note}\n",
"\n",
"If you fork the repository, you will not be able to execute tests on the local runners. They are restricted to the `MannLabs` repository.\n",
"\n",
":::\n",
"\n"
]
},
Expand Down
2 changes: 1 addition & 1 deletion nbs/file_formats.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"id": "044a1759",
"metadata": {},
"source": [
"# AlphaPept workflow and files"
"# AlphaPept: Workflow and Files"
]
},
{
Expand Down
1 change: 0 additions & 1 deletion nbs/index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down
Loading

0 comments on commit 8793d48

Please sign in to comment.