Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding commands #1

Merged
merged 55 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
1ef5500
first command test
ypriverol May 24, 2024
5cb8dcf
first command test
ypriverol May 24, 2024
56c4d46
first command test
ypriverol May 24, 2024
e931a0d
first command test
ypriverol May 24, 2024
b9bab3c
first command test
ypriverol May 24, 2024
83bbc7f
first command test
ypriverol May 24, 2024
15e0de0
add sage features
ypriverol May 24, 2024
6e40867
add sage features
ypriverol May 24, 2024
3e9546e
add sage features
ypriverol May 24, 2024
a12f322
add sage features
ypriverol May 24, 2024
d2d2753
add sage features
ypriverol May 24, 2024
2f24696
mzml statistics
ypriverol May 24, 2024
14478c7
mzml statistics
ypriverol May 24, 2024
9b770a6
mzml statistics
ypriverol May 24, 2024
903b1e5
mzml statistics
ypriverol May 25, 2024
092f5df
diann convert
ypriverol May 25, 2024
79141ab
extra sample script
ypriverol May 25, 2024
f7ebf0b
ms2rescore added
ypriverol May 25, 2024
65d34b1
arguments -> options
ypriverol May 25, 2024
1103e75
arguments -> options
ypriverol May 25, 2024
3781e8d
arguments -> options
ypriverol May 25, 2024
d230533
arguments -> options
ypriverol May 25, 2024
6df9789
black run
ypriverol May 25, 2024
f3c2d59
check_samplesheet.py added
ypriverol May 25, 2024
1f8abbc
refinements
ypriverol May 25, 2024
74001d5
refinements
ypriverol May 25, 2024
f5965b7
validation of sdrf command check_samplesheet.py
ypriverol May 25, 2024
330b670
validation of sdrf command check_samplesheet.py
ypriverol May 25, 2024
8e197d9
added more tests
ypriverol May 26, 2024
769af9e
added more tests
ypriverol May 26, 2024
427d5fd
added more tests
ypriverol May 26, 2024
2711ba6
more tests added.
ypriverol May 26, 2024
9948a02
more tests added.
ypriverol May 26, 2024
ab13770
more tests added.
ypriverol May 26, 2024
7a76070
more tests added.
ypriverol May 26, 2024
2305145
more tests added.
ypriverol May 26, 2024
4a80388
more tests added.
ypriverol May 26, 2024
48b75c4
more tests added.
ypriverol May 26, 2024
665ffa2
more tests added.
ypriverol May 26, 2024
cf4e925
more tests added.
ypriverol May 26, 2024
03f31c6
Merge branch 'main' of https://github.com/bigbio/pyquantms into dev
ypriverol May 26, 2024
6ebda00
more tests added.
ypriverol May 26, 2024
af62911
more tests added.
ypriverol May 26, 2024
5d9afcf
more tests added.
ypriverol May 26, 2024
285e34a
more tests added.
ypriverol May 26, 2024
552bcac
more tests added.
ypriverol May 26, 2024
def41a0
more tests added.
ypriverol May 26, 2024
4fcbab4
more tests added.
ypriverol May 26, 2024
6ac597b
more tests added.
ypriverol May 26, 2024
455dcbf
more tests added.
ypriverol May 26, 2024
ac3812a
more tests added.
ypriverol May 26, 2024
f591b9f
more tests added.
ypriverol May 26, 2024
355cd6f
Multiple fixes for Codacy
ypriverol May 26, 2024
b52ffdd
Merge remote-tracking branch 'origin/dev' into dev
ypriverol May 26, 2024
840b4f3
more tests added.
ypriverol May 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python setup.py install
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python setup.py install
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand Down
7 changes: 7 additions & 0 deletions BSA_design_urls_sample.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Spectra_Filepath Sample
https://raw.githubusercontent.com/nf-core/test-datasets/proteomicslfq/testdata/BSA1_F1.mzML 1
https://raw.githubusercontent.com/nf-core/test-datasets/proteomicslfq/testdata/BSA1_F2.mzML 1
https://raw.githubusercontent.com/nf-core/test-datasets/proteomicslfq/testdata/BSA2_F1.mzML 2
https://raw.githubusercontent.com/nf-core/test-datasets/proteomicslfq/testdata/BSA2_F2.mzML 2
https://raw.githubusercontent.com/nf-core/test-datasets/proteomicslfq/testdata/BSA3_F1.mzML 3
https://raw.githubusercontent.com/nf-core/test-datasets/proteomicslfq/testdata/BSA3_F2.mzML 3
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ build-backend = "setuptools.build_meta"
click = ">=7.0"
pydantic = ">=1.10,<2"
python = "^3.7"
sdrf_pipelines = ">=0.0.26"
sdrf-pipelines = ">=0.0.26"
pyopenms = ">=2.6.0"
ms2rescore = ">=3.0.2"
psm-utils = "==0.8.0"
pandas = ">=1.0.0"

[tool.poetry.dev-dependencies]
pytest = "*"
Expand Down
55 changes: 32 additions & 23 deletions pyquantms/diann/create_diann_cfg.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
This script converts SDRF parameters to DIA-NN parameters
License: Apache 2.0
Expand All @@ -12,20 +10,13 @@
import click
from sdrf_pipelines.openms.unimod import UnimodDatabase

CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])


@click.group(context_settings=CONTEXT_SETTINGS)
def cli():
pass


@click.command("generate")
@click.command("create_diann_cfg")
@click.option("--enzyme", "-e", help="")
@click.option("--fix_mod", "-f", help="")
@click.option("--var_mod", "-v", help="")
@click.pass_context
def generate_cfg(ctx, enzyme, fix_mod, var_mod):
def create_diann_cfg(ctx, enzyme, fix_mod, var_mod):
cut = enzyme_cut(enzyme)
unimod_database = UnimodDatabase()
fix_ptm, var_ptm = convert_mod(unimod_database, fix_mod, var_mod)
Expand Down Expand Up @@ -53,19 +44,31 @@ def convert_mod(unimod_database, fix_mod: str, var_mod: str) -> Tuple[List, List
tag = 0
for modification in unimod_database.modifications:
if modification.get_name() == mod.split(" ")[0]:
diann_mod = modification.get_name() + "," + str(modification._delta_mono_mass)
diann_mod = (
modification.get_name()
+ ","
+ str(modification._delta_mono_mass)
)
tag = 1
break
if tag == 0:
print("Warning: Currently only supported unimod modifications for DIA pipeline. Skipped: " + mod)
print(
"Warning: Currently only supported unimod modifications for DIA pipeline. Skipped: "
+ mod
)
continue
site = re.findall(pattern, " ".join(mod.split(" ")[1:]))[0]
if site == "Protein N-term":
site = "*n"
elif site == "N-term":
site = "n"

if "TMT" in diann_mod or "Label" in diann_mod or "iTRAQ" in diann_mod or "mTRAQ" in diann_mod:
if (
"TMT" in diann_mod
or "Label" in diann_mod
or "iTRAQ" in diann_mod
or "mTRAQ" in diann_mod
):
fix_ptm.append(diann_mod + "," + site + "," + "label")
else:
fix_ptm.append(diann_mod + "," + site)
Expand All @@ -75,19 +78,31 @@ def convert_mod(unimod_database, fix_mod: str, var_mod: str) -> Tuple[List, List
tag = 0
for modification in unimod_database.modifications:
if modification.get_name() == mod.split(" ")[0]:
diann_mod = modification.get_name() + "," + str(modification._delta_mono_mass)
diann_mod = (
modification.get_name()
+ ","
+ str(modification._delta_mono_mass)
)
tag = 1
break
if tag == 0:
print("Warning: Currently only supported unimod modifications for DIA pipeline. Skipped: " + mod)
print(
"Warning: Currently only supported unimod modifications for DIA pipeline. Skipped: "
+ mod
)
continue
site = re.findall(pattern, " ".join(mod.split(" ")[1:]))[0]
if site == "Protein N-term":
site = "*n"
elif site == "N-term":
site = "n"

if "TMT" in diann_mod or "Label" in diann_mod or "iTRAQ" in diann_mod or "mTRAQ" in diann_mod:
if (
"TMT" in diann_mod
or "Label" in diann_mod
or "iTRAQ" in diann_mod
or "mTRAQ" in diann_mod
):
var_ptm.append(diann_mod + "," + site + "," + "label")
else:
var_ptm.append(diann_mod + "," + site)
Expand All @@ -107,9 +122,3 @@ def convert_mod(unimod_database, fix_mod: str, var_mod: str) -> Tuple[List, List

def enzyme_cut(enzyme: str) -> str:
return _ENZYME_SPECIFICITY.get(enzyme) or "--cut"


cli.add_command(generate_cfg)

if __name__ == "__main__":
cli()
Loading
Loading