pyXLMS 0.0.1__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.
- pyxlms-0.0.1/LICENSE +21 -0
- pyxlms-0.0.1/PKG-INFO +94 -0
- pyxlms-0.0.1/README.md +52 -0
- pyxlms-0.0.1/pyproject.toml +36 -0
- pyxlms-0.0.1/setup.cfg +4 -0
- pyxlms-0.0.1/src/pyXLMS/__init__.py +0 -0
- pyxlms-0.0.1/src/pyXLMS/data.py +126 -0
- pyxlms-0.0.1/src/pyXLMS.egg-info/PKG-INFO +94 -0
- pyxlms-0.0.1/src/pyXLMS.egg-info/SOURCES.txt +11 -0
- pyxlms-0.0.1/src/pyXLMS.egg-info/dependency_links.txt +1 -0
- pyxlms-0.0.1/src/pyXLMS.egg-info/requires.txt +4 -0
- pyxlms-0.0.1/src/pyXLMS.egg-info/top_level.txt +1 -0
- pyxlms-0.0.1/tests/tests.py +103 -0
pyxlms-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Micha Johannes Birklbauer
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
pyxlms-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: pyXLMS
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: A python package to process protein cross-linking data.
|
|
5
|
+
Author-email: Micha Johannes Birklbauer <micha.birklbauer@fh-hagenberg.at>
|
|
6
|
+
Maintainer-email: Micha Johannes Birklbauer <micha.birklbauer@fh-hagenberg.at>
|
|
7
|
+
License: MIT License
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2024 Micha Johannes Birklbauer
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
28
|
+
|
|
29
|
+
Project-URL: Homepage, https://github.com/hgb-bin-proteomics/pyXLMS
|
|
30
|
+
Project-URL: Documentation, https://hgb-bin-proteomics.github.io/pyXLMS
|
|
31
|
+
Project-URL: Issues, https://github.com/hgb-bin-proteomics/pyXLMS/issues
|
|
32
|
+
Keywords: crosslink,crosslinker,crosslinking,mass spectrometry,proteomics
|
|
33
|
+
Classifier: Programming Language :: Python :: 3
|
|
34
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
35
|
+
Classifier: Operating System :: OS Independent
|
|
36
|
+
Requires-Python: >=3.7
|
|
37
|
+
Description-Content-Type: text/markdown
|
|
38
|
+
License-File: LICENSE
|
|
39
|
+
Requires-Dist: pandas
|
|
40
|
+
Provides-Extra: gui
|
|
41
|
+
Requires-Dist: streamlit; extra == "gui"
|
|
42
|
+
|
|
43
|
+
# pyXLMS
|
|
44
|
+
|
|
45
|
+
Supported search engines:
|
|
46
|
+
- MS Annika
|
|
47
|
+
- xiSearch / xiFDR
|
|
48
|
+
- MaxLynx
|
|
49
|
+
- ?
|
|
50
|
+
|
|
51
|
+
General interface with csv input
|
|
52
|
+
|
|
53
|
+
Packages to include:
|
|
54
|
+
- Export to xiNET
|
|
55
|
+
- Req:
|
|
56
|
+
- fasta file
|
|
57
|
+
- Crosslink:
|
|
58
|
+
- Sequence
|
|
59
|
+
- XL position in peptide
|
|
60
|
+
- protein accession
|
|
61
|
+
- XL position in protein
|
|
62
|
+
- Score
|
|
63
|
+
- Export to xiVIEW
|
|
64
|
+
- Req: cover by xiNET Req
|
|
65
|
+
- Export to xiFDR
|
|
66
|
+
- Req:
|
|
67
|
+
- CSM:
|
|
68
|
+
- Spectrum File
|
|
69
|
+
- Scan Nr
|
|
70
|
+
- Sequence
|
|
71
|
+
- XL position in peptide
|
|
72
|
+
- Precursor charge
|
|
73
|
+
- Score CSM
|
|
74
|
+
- Score peptide
|
|
75
|
+
- protein accession
|
|
76
|
+
- position of peptide in protein
|
|
77
|
+
- decoy peptide
|
|
78
|
+
- Export to pyXlinkViewer
|
|
79
|
+
- Req: all covered
|
|
80
|
+
- Export to XMAS
|
|
81
|
+
- Req: all covered
|
|
82
|
+
- Export to Spectral Library
|
|
83
|
+
- Req:
|
|
84
|
+
- MGF
|
|
85
|
+
- CSM:
|
|
86
|
+
- Modification
|
|
87
|
+
- RT
|
|
88
|
+
- Ion Mobility / Compensation Voltage
|
|
89
|
+
- MS Annika FDR
|
|
90
|
+
- Req: all covered
|
|
91
|
+
- MS Annika Combine Results
|
|
92
|
+
- Req: all covered
|
|
93
|
+
- CSM Annotation
|
|
94
|
+
- Req: this is probably MS Annika only, as it requires doublet information
|
pyxlms-0.0.1/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# pyXLMS
|
|
2
|
+
|
|
3
|
+
Supported search engines:
|
|
4
|
+
- MS Annika
|
|
5
|
+
- xiSearch / xiFDR
|
|
6
|
+
- MaxLynx
|
|
7
|
+
- ?
|
|
8
|
+
|
|
9
|
+
General interface with csv input
|
|
10
|
+
|
|
11
|
+
Packages to include:
|
|
12
|
+
- Export to xiNET
|
|
13
|
+
- Req:
|
|
14
|
+
- fasta file
|
|
15
|
+
- Crosslink:
|
|
16
|
+
- Sequence
|
|
17
|
+
- XL position in peptide
|
|
18
|
+
- protein accession
|
|
19
|
+
- XL position in protein
|
|
20
|
+
- Score
|
|
21
|
+
- Export to xiVIEW
|
|
22
|
+
- Req: cover by xiNET Req
|
|
23
|
+
- Export to xiFDR
|
|
24
|
+
- Req:
|
|
25
|
+
- CSM:
|
|
26
|
+
- Spectrum File
|
|
27
|
+
- Scan Nr
|
|
28
|
+
- Sequence
|
|
29
|
+
- XL position in peptide
|
|
30
|
+
- Precursor charge
|
|
31
|
+
- Score CSM
|
|
32
|
+
- Score peptide
|
|
33
|
+
- protein accession
|
|
34
|
+
- position of peptide in protein
|
|
35
|
+
- decoy peptide
|
|
36
|
+
- Export to pyXlinkViewer
|
|
37
|
+
- Req: all covered
|
|
38
|
+
- Export to XMAS
|
|
39
|
+
- Req: all covered
|
|
40
|
+
- Export to Spectral Library
|
|
41
|
+
- Req:
|
|
42
|
+
- MGF
|
|
43
|
+
- CSM:
|
|
44
|
+
- Modification
|
|
45
|
+
- RT
|
|
46
|
+
- Ion Mobility / Compensation Voltage
|
|
47
|
+
- MS Annika FDR
|
|
48
|
+
- Req: all covered
|
|
49
|
+
- MS Annika Combine Results
|
|
50
|
+
- Req: all covered
|
|
51
|
+
- CSM Annotation
|
|
52
|
+
- Req: this is probably MS Annika only, as it requires doublet information
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "pyXLMS"
|
|
7
|
+
version = "0.0.1"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name="Micha Johannes Birklbauer", email="micha.birklbauer@fh-hagenberg.at" },
|
|
10
|
+
]
|
|
11
|
+
maintainers = [
|
|
12
|
+
{ name="Micha Johannes Birklbauer", email="micha.birklbauer@fh-hagenberg.at" },
|
|
13
|
+
]
|
|
14
|
+
readme = "README.md"
|
|
15
|
+
license = {file = "LICENSE"}
|
|
16
|
+
description = "A python package to process protein cross-linking data."
|
|
17
|
+
keywords = ["crosslink", "crosslinker", "crosslinking", "mass spectrometry", "proteomics"]
|
|
18
|
+
requires-python = ">=3.7"
|
|
19
|
+
classifiers = [
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"License :: OSI Approved :: MIT License",
|
|
22
|
+
"Operating System :: OS Independent",
|
|
23
|
+
]
|
|
24
|
+
dependencies = [
|
|
25
|
+
"pandas"
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
[project.optional-dependencies]
|
|
29
|
+
gui = [
|
|
30
|
+
"streamlit"
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[project.urls]
|
|
34
|
+
Homepage = "https://github.com/hgb-bin-proteomics/pyXLMS"
|
|
35
|
+
Documentation = "https://hgb-bin-proteomics.github.io/pyXLMS"
|
|
36
|
+
Issues = "https://github.com/hgb-bin-proteomics/pyXLMS/issues"
|
pyxlms-0.0.1/setup.cfg
ADDED
|
File without changes
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
# 2024 (c) Micha Johannes Birklbauer
|
|
4
|
+
# https://github.com/michabirklbauer/
|
|
5
|
+
# micha.birklbauer@gmail.com
|
|
6
|
+
|
|
7
|
+
from typing import List
|
|
8
|
+
from typing import Dict
|
|
9
|
+
from typing import Any
|
|
10
|
+
|
|
11
|
+
def check_input(parameter: Any,
|
|
12
|
+
parameter_name: str,
|
|
13
|
+
supported_class: Any,
|
|
14
|
+
supported_subclass: Any = None) -> bool:
|
|
15
|
+
"""Checks if the given parameter is of the specified type.
|
|
16
|
+
|
|
17
|
+
Parameters
|
|
18
|
+
----------
|
|
19
|
+
parameter : any
|
|
20
|
+
Parameter to check class of.
|
|
21
|
+
parameter_name : str
|
|
22
|
+
Name of the parameter.
|
|
23
|
+
supported_class : any
|
|
24
|
+
Class the parameter has to be of.
|
|
25
|
+
supported_subclass : any
|
|
26
|
+
Class of the values in case the parameter is a list.
|
|
27
|
+
|
|
28
|
+
Returns
|
|
29
|
+
-------
|
|
30
|
+
bool
|
|
31
|
+
If the given input is okay.
|
|
32
|
+
|
|
33
|
+
Raises
|
|
34
|
+
------
|
|
35
|
+
TypeError
|
|
36
|
+
If the parameter is not of the given class.
|
|
37
|
+
"""
|
|
38
|
+
if type(parameter) != supported_class:
|
|
39
|
+
raise TypeError(f"{parameter_name} must be {supported_class}!")
|
|
40
|
+
if type(parameter) == list and supported_subclass is not None:
|
|
41
|
+
for value in parameter:
|
|
42
|
+
if type(value) != supported_subclass:
|
|
43
|
+
raise TypeError(f"List values of {parameter_name} must be {supported_subclass}")
|
|
44
|
+
return True
|
|
45
|
+
|
|
46
|
+
def create_crosslink(peptide_a: str,
|
|
47
|
+
xl_position_peptide_a: int,
|
|
48
|
+
proteins_a: List[str],
|
|
49
|
+
xl_position_proteins_a: List[int],
|
|
50
|
+
peptide_b: str,
|
|
51
|
+
xl_position_peptide_b: int,
|
|
52
|
+
proteins_b: List[str],
|
|
53
|
+
xl_position_proteins_b: List[int],
|
|
54
|
+
score: float) -> Dict[str, Any]:
|
|
55
|
+
"""Returns a crosslink dictionary.
|
|
56
|
+
|
|
57
|
+
Parameters
|
|
58
|
+
----------
|
|
59
|
+
peptide_a : str
|
|
60
|
+
The unmodified amino acid sequence of the first peptide.
|
|
61
|
+
xl_position_peptide_a : int
|
|
62
|
+
The position of the crosslinker in the sequence of the first peptide (1-based).
|
|
63
|
+
proteins_a: list of str
|
|
64
|
+
The accessions of proteins that the first peptide is associated with.
|
|
65
|
+
xl_position_proteins_a: list of int
|
|
66
|
+
Positions of the crosslink in the proteins of the first peptide (1-based).
|
|
67
|
+
peptide_b : str
|
|
68
|
+
The unmodified amino acid sequence of the second peptide.
|
|
69
|
+
xl_position_peptide_b : int
|
|
70
|
+
The position of the crosslinker in the sequence of the second peptide (1-based).
|
|
71
|
+
proteins_b: list of str
|
|
72
|
+
The accessions of proteins that the second peptide is associated with.
|
|
73
|
+
xl_position_proteins_b: list of int
|
|
74
|
+
Positions of the crosslink in the proteins of the second peptide (1-based).
|
|
75
|
+
score: float
|
|
76
|
+
Score of the crosslink.
|
|
77
|
+
|
|
78
|
+
Returns
|
|
79
|
+
-------
|
|
80
|
+
dict
|
|
81
|
+
The dictionary representing the crosslink with keys data_type, alpha_peptide, alpha_peptide_crosslink_position,
|
|
82
|
+
alpha_proteins, alpha_proteins_crosslink_positions, beta_peptide, beta_peptide_crosslink_position, beta_proteins,
|
|
83
|
+
beta_proteins_crosslink_positions, and score.
|
|
84
|
+
Alpha and beta are assigned based on peptide sequence, the peptide that alphabetically comes first is assigned to alpha.
|
|
85
|
+
"""
|
|
86
|
+
## input checks
|
|
87
|
+
check_input(peptide_a, "peptide_a", str)
|
|
88
|
+
check_input(peptide_b, "peptide_b", str)
|
|
89
|
+
check_input(xl_position_peptide_a, "xl_position_peptide_a", int)
|
|
90
|
+
check_input(xl_position_peptide_b, "xl_position_peptide_b", int)
|
|
91
|
+
check_input(proteins_a, "proteins_a", list, str)
|
|
92
|
+
check_input(proteins_b, "proteins_b", list, str)
|
|
93
|
+
check_input(xl_position_proteins_a, "xl_position_proteins_a", list, int)
|
|
94
|
+
check_input(xl_position_proteins_b, "xl_position_proteins_b", list, int)
|
|
95
|
+
check_input(score, "score", float)
|
|
96
|
+
if len(proteins_a) != len(xl_position_proteins_a):
|
|
97
|
+
raise ValueError("Crosslink position has to be given for every protein! Length of proteins_a and xl_position_proteins_a has to match!")
|
|
98
|
+
if len(proteins_b) != len(xl_position_proteins_b):
|
|
99
|
+
raise ValueError("Crosslink position has to be given for every protein! Length of proteins_b and xl_position_proteins_b has to match!")
|
|
100
|
+
## processing
|
|
101
|
+
crosslink = {f"{peptide_a.strip()}{xl_position_peptide_a}":
|
|
102
|
+
{
|
|
103
|
+
"peptide": peptide_a,
|
|
104
|
+
"xl_position_peptide": xl_position_peptide_a,
|
|
105
|
+
"proteins": proteins_a,
|
|
106
|
+
"xl_position_proteins": xl_position_proteins_a
|
|
107
|
+
},
|
|
108
|
+
f"{peptide_b.strip()}{xl_position_peptide_b}":
|
|
109
|
+
{
|
|
110
|
+
"peptide": peptide_b,
|
|
111
|
+
"xl_position_peptide": xl_position_peptide_b,
|
|
112
|
+
"proteins": proteins_b,
|
|
113
|
+
"xl_position_proteins": xl_position_proteins_b
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
keys = sorted(list(crosslink.keys()))
|
|
117
|
+
return {"data_type": "crosslink",
|
|
118
|
+
"alpha_peptide": crosslink[keys[0]]["peptide"].strip(),
|
|
119
|
+
"alpha_peptide_crosslink_position": crosslink[keys[0]]["xl_position_peptide"],
|
|
120
|
+
"alpha_proteins": [protein.strip() for protein in crosslink[keys[0]]["proteins"]],
|
|
121
|
+
"alpha_proteins_crosslink_positions": crosslink[keys[0]]["xl_position_proteins"],
|
|
122
|
+
"beta_peptide": crosslink[keys[1]]["peptide"].strip(),
|
|
123
|
+
"beta_peptide_crosslink_position": crosslink[keys[1]]["xl_position_peptide"],
|
|
124
|
+
"beta_proteins": [protein.strip() for protein in crosslink[keys[1]]["proteins"]],
|
|
125
|
+
"beta_proteins_crosslink_positions": crosslink[keys[1]]["xl_position_proteins"],
|
|
126
|
+
"score": score}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: pyXLMS
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: A python package to process protein cross-linking data.
|
|
5
|
+
Author-email: Micha Johannes Birklbauer <micha.birklbauer@fh-hagenberg.at>
|
|
6
|
+
Maintainer-email: Micha Johannes Birklbauer <micha.birklbauer@fh-hagenberg.at>
|
|
7
|
+
License: MIT License
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2024 Micha Johannes Birklbauer
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
28
|
+
|
|
29
|
+
Project-URL: Homepage, https://github.com/hgb-bin-proteomics/pyXLMS
|
|
30
|
+
Project-URL: Documentation, https://hgb-bin-proteomics.github.io/pyXLMS
|
|
31
|
+
Project-URL: Issues, https://github.com/hgb-bin-proteomics/pyXLMS/issues
|
|
32
|
+
Keywords: crosslink,crosslinker,crosslinking,mass spectrometry,proteomics
|
|
33
|
+
Classifier: Programming Language :: Python :: 3
|
|
34
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
35
|
+
Classifier: Operating System :: OS Independent
|
|
36
|
+
Requires-Python: >=3.7
|
|
37
|
+
Description-Content-Type: text/markdown
|
|
38
|
+
License-File: LICENSE
|
|
39
|
+
Requires-Dist: pandas
|
|
40
|
+
Provides-Extra: gui
|
|
41
|
+
Requires-Dist: streamlit; extra == "gui"
|
|
42
|
+
|
|
43
|
+
# pyXLMS
|
|
44
|
+
|
|
45
|
+
Supported search engines:
|
|
46
|
+
- MS Annika
|
|
47
|
+
- xiSearch / xiFDR
|
|
48
|
+
- MaxLynx
|
|
49
|
+
- ?
|
|
50
|
+
|
|
51
|
+
General interface with csv input
|
|
52
|
+
|
|
53
|
+
Packages to include:
|
|
54
|
+
- Export to xiNET
|
|
55
|
+
- Req:
|
|
56
|
+
- fasta file
|
|
57
|
+
- Crosslink:
|
|
58
|
+
- Sequence
|
|
59
|
+
- XL position in peptide
|
|
60
|
+
- protein accession
|
|
61
|
+
- XL position in protein
|
|
62
|
+
- Score
|
|
63
|
+
- Export to xiVIEW
|
|
64
|
+
- Req: cover by xiNET Req
|
|
65
|
+
- Export to xiFDR
|
|
66
|
+
- Req:
|
|
67
|
+
- CSM:
|
|
68
|
+
- Spectrum File
|
|
69
|
+
- Scan Nr
|
|
70
|
+
- Sequence
|
|
71
|
+
- XL position in peptide
|
|
72
|
+
- Precursor charge
|
|
73
|
+
- Score CSM
|
|
74
|
+
- Score peptide
|
|
75
|
+
- protein accession
|
|
76
|
+
- position of peptide in protein
|
|
77
|
+
- decoy peptide
|
|
78
|
+
- Export to pyXlinkViewer
|
|
79
|
+
- Req: all covered
|
|
80
|
+
- Export to XMAS
|
|
81
|
+
- Req: all covered
|
|
82
|
+
- Export to Spectral Library
|
|
83
|
+
- Req:
|
|
84
|
+
- MGF
|
|
85
|
+
- CSM:
|
|
86
|
+
- Modification
|
|
87
|
+
- RT
|
|
88
|
+
- Ion Mobility / Compensation Voltage
|
|
89
|
+
- MS Annika FDR
|
|
90
|
+
- Req: all covered
|
|
91
|
+
- MS Annika Combine Results
|
|
92
|
+
- Req: all covered
|
|
93
|
+
- CSM Annotation
|
|
94
|
+
- Req: this is probably MS Annika only, as it requires doublet information
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/pyXLMS/__init__.py
|
|
5
|
+
src/pyXLMS/data.py
|
|
6
|
+
src/pyXLMS.egg-info/PKG-INFO
|
|
7
|
+
src/pyXLMS.egg-info/SOURCES.txt
|
|
8
|
+
src/pyXLMS.egg-info/dependency_links.txt
|
|
9
|
+
src/pyXLMS.egg-info/requires.txt
|
|
10
|
+
src/pyXLMS.egg-info/top_level.txt
|
|
11
|
+
tests/tests.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pyXLMS
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
# pyXLMS - TESTS
|
|
4
|
+
# 2024 (c) Micha Johannes Birklbauer
|
|
5
|
+
# https://github.com/michabirklbauer/
|
|
6
|
+
# micha.birklbauer@gmail.com
|
|
7
|
+
|
|
8
|
+
import pytest
|
|
9
|
+
|
|
10
|
+
def test1():
|
|
11
|
+
from pyXLMS import data
|
|
12
|
+
x = 1
|
|
13
|
+
assert data.check_input(x, "x", int)
|
|
14
|
+
|
|
15
|
+
def test2():
|
|
16
|
+
from pyXLMS import data
|
|
17
|
+
x = [1, 2, 3]
|
|
18
|
+
assert data.check_input(x, "x", list)
|
|
19
|
+
|
|
20
|
+
def test3():
|
|
21
|
+
from pyXLMS import data
|
|
22
|
+
x = [1, 2, 3]
|
|
23
|
+
assert data.check_input(x, "x", list, int)
|
|
24
|
+
|
|
25
|
+
def test4():
|
|
26
|
+
from pyXLMS import data
|
|
27
|
+
x = 1
|
|
28
|
+
with pytest.raises(TypeError, match = f"x must be {str}!"):
|
|
29
|
+
i = data.check_input(x, "x", str)
|
|
30
|
+
|
|
31
|
+
def test5():
|
|
32
|
+
from pyXLMS import data
|
|
33
|
+
x = [1, 2, 3]
|
|
34
|
+
with pytest.raises(TypeError, match = f"List values of x must be {str}"):
|
|
35
|
+
i = data.check_input(x, "x", list, str)
|
|
36
|
+
|
|
37
|
+
def test6():
|
|
38
|
+
from pyXLMS import data
|
|
39
|
+
crosslink = data.create_crosslink("PEPTIDE", 1, ["PROTEIN"], [1],
|
|
40
|
+
"EDITPEP", 3, ["NIETORP", "PROTEIN"], [5, 2],
|
|
41
|
+
170.3)
|
|
42
|
+
assert crosslink["data_type"] == "crosslink"
|
|
43
|
+
assert crosslink["alpha_peptide"] == "EDITPEP"
|
|
44
|
+
assert crosslink["alpha_peptide_crosslink_position"] == 3
|
|
45
|
+
assert len(crosslink["alpha_proteins"]) == 2
|
|
46
|
+
assert crosslink["alpha_proteins"][0] == "NIETORP"
|
|
47
|
+
assert len(crosslink["alpha_proteins_crosslink_positions"]) == 2
|
|
48
|
+
assert crosslink["alpha_proteins_crosslink_positions"][0] == 5
|
|
49
|
+
assert crosslink["beta_peptide"] == "PEPTIDE"
|
|
50
|
+
assert crosslink["beta_peptide_crosslink_position"] == 1
|
|
51
|
+
assert len(crosslink["beta_proteins"]) == 1
|
|
52
|
+
assert crosslink["beta_proteins"][0] == "PROTEIN"
|
|
53
|
+
assert len(crosslink["beta_proteins_crosslink_positions"]) == 1
|
|
54
|
+
assert crosslink["beta_proteins_crosslink_positions"][0] == 1
|
|
55
|
+
assert crosslink["score"] >= 170.25 and crosslink["score"] <= 170.35
|
|
56
|
+
|
|
57
|
+
def test7():
|
|
58
|
+
from pyXLMS import data
|
|
59
|
+
crosslink = data.create_crosslink("PEPTIDE", 3, ["PROTEIN"], [3],
|
|
60
|
+
"PEPTIDE", 1, ["PROTEIN"], [1],
|
|
61
|
+
170.3)
|
|
62
|
+
assert crosslink["data_type"] == "crosslink"
|
|
63
|
+
assert crosslink["alpha_peptide"] == "PEPTIDE"
|
|
64
|
+
assert crosslink["alpha_peptide_crosslink_position"] == 1
|
|
65
|
+
assert len(crosslink["alpha_proteins"]) == 1
|
|
66
|
+
assert crosslink["alpha_proteins"][0] == "PROTEIN"
|
|
67
|
+
assert len(crosslink["alpha_proteins_crosslink_positions"]) == 1
|
|
68
|
+
assert crosslink["alpha_proteins_crosslink_positions"][0] == 1
|
|
69
|
+
assert crosslink["beta_peptide"] == "PEPTIDE"
|
|
70
|
+
assert crosslink["beta_peptide_crosslink_position"] == 3
|
|
71
|
+
assert len(crosslink["beta_proteins"]) == 1
|
|
72
|
+
assert crosslink["beta_proteins"][0] == "PROTEIN"
|
|
73
|
+
assert len(crosslink["beta_proteins_crosslink_positions"]) == 1
|
|
74
|
+
assert crosslink["beta_proteins_crosslink_positions"][0] == 3
|
|
75
|
+
assert crosslink["score"] >= 170.25 and crosslink["score"] <= 170.35
|
|
76
|
+
|
|
77
|
+
def test8():
|
|
78
|
+
from pyXLMS import data
|
|
79
|
+
with pytest.raises(TypeError, match = f"xl_position_peptide_a must be {int}!"):
|
|
80
|
+
crosslink = data.create_crosslink("PEPTIDE", "3", ["PROTEIN"], [3],
|
|
81
|
+
"PEPTIDE", 1, ["PROTEIN"], [1],
|
|
82
|
+
170.3)
|
|
83
|
+
|
|
84
|
+
def test9():
|
|
85
|
+
from pyXLMS import data
|
|
86
|
+
with pytest.raises(TypeError, match = f"List values of xl_position_proteins_a must be {int}"):
|
|
87
|
+
crosslink = data.create_crosslink("PEPTIDE", 3, ["PROTEIN"], ["3"],
|
|
88
|
+
"PEPTIDE", 1, ["PROTEIN"], [1],
|
|
89
|
+
170.3)
|
|
90
|
+
|
|
91
|
+
def test10():
|
|
92
|
+
from pyXLMS import data
|
|
93
|
+
with pytest.raises(ValueError, match = "Crosslink position has to be given for every protein! Length of proteins_a and xl_position_proteins_a has to match!"):
|
|
94
|
+
crosslink = data.create_crosslink("PEPTIDE", 3, ["PROTEIN"], [3, 4],
|
|
95
|
+
"PEPTIDE", 1, ["PROTEIN"], [1],
|
|
96
|
+
170.3)
|
|
97
|
+
|
|
98
|
+
def test11():
|
|
99
|
+
from pyXLMS import data
|
|
100
|
+
with pytest.raises(ValueError, match = "Crosslink position has to be given for every protein! Length of proteins_b and xl_position_proteins_b has to match!"):
|
|
101
|
+
crosslink = data.create_crosslink("PEPTIDE", 3, ["PROTEIN"], [3],
|
|
102
|
+
"PEPTIDE", 1, ["PROTEIN"], [1, 2],
|
|
103
|
+
170.3)
|