apb-export 0.2.2__py3-none-any.whl

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.
Files changed (39) hide show
  1. apb_export/__init__.py +1 -0
  2. apb_export/api.py +98 -0
  3. apb_export/cli.py +562 -0
  4. apb_export/computed.py +135 -0
  5. apb_export/engine.py +717 -0
  6. apb_export/export_rules/__init__.py +0 -0
  7. apb_export/export_rules/documents/_schema/document.schema.json +1280 -0
  8. apb_export/export_rules/documents/_schema/rule.schema.json +1454 -0
  9. apb_export/export_rules/documents/alphapepttools/v0_4/rules.json +98 -0
  10. apb_export/export_rules/documents/explorede/v1_0/rules.json +197 -0
  11. apb_export/export_rules/documents/msmu/v0_4/rules.json +127 -0
  12. apb_export/export_rules/documents/msstats/v4_20/rules.json +66 -0
  13. apb_export/export_rules/documents/perseus/v2/rules.json +59 -0
  14. apb_export/export_rules/documents/prolfqua/v2_11/rules.json +223 -0
  15. apb_export/export_rules/documents/proteopy/v0_1/rules.json +53 -0
  16. apb_export/export_rules/documents/proteopy_ion/v0_1/rules.json +62 -0
  17. apb_export/export_rules/documents/qfeatures/v1_22/rules.json +98 -0
  18. apb_export/export_rules/documents/qpx/v1_1/rules.json +110 -0
  19. apb_export/export_rules/layout.py +60 -0
  20. apb_export/export_rules/loader.py +208 -0
  21. apb_export/export_rules/schema.py +502 -0
  22. apb_export/export_rules/schema_artifact.py +40 -0
  23. apb_export/long_table.py +75 -0
  24. apb_export/outputs.py +90 -0
  25. apb_export/perseus_table.py +100 -0
  26. apb_export/py.typed +1 -0
  27. apb_export/qpx/LICENSE.qpx +81 -0
  28. apb_export/qpx/__init__.py +0 -0
  29. apb_export/qpx/output.py +215 -0
  30. apb_export/qpx/schema.json +662 -0
  31. apb_export/qpx/schema.py +32 -0
  32. apb_export/rows.py +72 -0
  33. apb_export/sources.py +415 -0
  34. apb_export-0.2.2.dist-info/METADATA +159 -0
  35. apb_export-0.2.2.dist-info/RECORD +39 -0
  36. apb_export-0.2.2.dist-info/WHEEL +4 -0
  37. apb_export-0.2.2.dist-info/entry_points.txt +3 -0
  38. apb_export-0.2.2.dist-info/licenses/LICENSE +21 -0
  39. apb_export-0.2.2.dist-info/licenses/src/apb_export/qpx/LICENSE.qpx +81 -0
@@ -0,0 +1,98 @@
1
+ {
2
+ "schema_version": "0.5",
3
+ "file_version": "3",
4
+ "target_name": "AlphaPeptTools",
5
+ "target_version_pattern": "^0\\.4\\.",
6
+ "tables": [
7
+ {
8
+ "output": ".h5mu",
9
+ "base": {
10
+ "measurements": {
11
+ "primary_layer": "intensity",
12
+ "layers": [{"name": "intensity", "source": {"measurements": "primary_layer"}}]
13
+ },
14
+ "columns": {
15
+ "obs": [
16
+ {"name": "raw_name", "source": {"axis": "obs_key"}},
17
+ {"name": "annotations", "how": "all_values"}
18
+ ]
19
+ }
20
+ },
21
+ "levels": {
22
+ "peptidoform_ion": {
23
+ "modality": "precursors",
24
+ "axis": {"obs_key": "raw_name", "var_key": "precursor_id"},
25
+ "columns": {
26
+ "var": [
27
+ {
28
+ "name": "precursor_id",
29
+ "source": {"catalog": "apb_alpha", "var": "peptidoform_ion"}
30
+ },
31
+ {"name": "sequence", "source": {"catalog": "apb_alpha", "var": "peptide"}},
32
+ {"name": "proteins", "source": {"catalog": "apb_alpha", "var": "protein_assignment"}},
33
+ {"name": "contaminant", "how": "contaminant", "type": "boolean"},
34
+ {
35
+ "name": "in_fasta",
36
+ "source": {"catalog": "fasta_peptides_alpha", "var": "peptide_in_fasta"},
37
+ "type": "boolean",
38
+ "required": false
39
+ },
40
+ {
41
+ "name": "fasta_proteins",
42
+ "source": {"catalog": "fasta_peptides_alpha", "var": "fasta_matching_protein_ids"},
43
+ "required": false
44
+ },
45
+ {
46
+ "name": "fasta_organisms",
47
+ "source": {"catalog": "fasta_peptides_alpha", "var": "fasta_matching_organisms"},
48
+ "required": false
49
+ }
50
+ ]
51
+ }
52
+ },
53
+ "peptide": {
54
+ "modality": "peptides",
55
+ "required": false,
56
+ "axis": {"obs_key": "raw_name", "var_key": "sequence"},
57
+ "columns": {
58
+ "var": [
59
+ {"name": "sequence", "source": {"catalog": "apb_alpha", "var": "peptide"}},
60
+ {
61
+ "name": "proteins",
62
+ "source": {"catalog": "apb_alpha", "var": "protein_assignment"},
63
+ "required": false
64
+ },
65
+ {"name": "contaminant", "how": "contaminant", "type": "boolean"},
66
+ {
67
+ "name": "in_fasta",
68
+ "source": {"catalog": "fasta_peptides_alpha", "var": "peptide_in_fasta"},
69
+ "type": "boolean",
70
+ "required": false
71
+ },
72
+ {
73
+ "name": "fasta_proteins",
74
+ "source": {"catalog": "fasta_peptides_alpha", "var": "fasta_matching_protein_ids"},
75
+ "required": false
76
+ },
77
+ {
78
+ "name": "fasta_organisms",
79
+ "source": {"catalog": "fasta_peptides_alpha", "var": "fasta_matching_organisms"},
80
+ "required": false
81
+ }
82
+ ]
83
+ }
84
+ },
85
+ "protein": {
86
+ "modality": "proteins",
87
+ "required": false,
88
+ "axis": {"obs_key": "raw_name", "var_key": "proteins"},
89
+ "columns": {
90
+ "var": [
91
+ {"name": "proteins", "source": {"catalog": "apb_alpha", "var": "protein_assignment"}}
92
+ ]
93
+ }
94
+ }
95
+ }
96
+ }
97
+ ]
98
+ }
@@ -0,0 +1,197 @@
1
+ {
2
+ "schema_version": "0.5",
3
+ "file_version": "2",
4
+ "target_name": "exploreDE",
5
+ "target_version_pattern": "^3\\.(8|9)\\.",
6
+ "tables": [
7
+ {
8
+ "output": ".h5ads",
9
+ "base": {
10
+ "axis": {"obs_key": "sample_id", "var_key": "feature_id"},
11
+ "measurements": {
12
+ "primary_layer": "X",
13
+ "layers": [
14
+ {
15
+ "name": "X",
16
+ "source": {"measurements": "primary_layer"},
17
+ "missing_values": [0],
18
+ "transform": "log2"
19
+ },
20
+ {
21
+ "name": "intensities",
22
+ "source": {"measurements": "primary_layer"},
23
+ "missing_values": [0],
24
+ "transform": "log2",
25
+ "required": false
26
+ },
27
+ {
28
+ "name": "intensities_raw",
29
+ "source": {"measurements": "primary_layer"},
30
+ "missing_values": [0],
31
+ "required": false
32
+ }
33
+ ]
34
+ },
35
+ "columns": {
36
+ "obs": [
37
+ {"name": "sample_id", "source": {"axis": "obs_key"}},
38
+ {"name": "sample_label", "source": {"axis": "obs_key"}},
39
+ {
40
+ "name": "annotations",
41
+ "how": "all_values",
42
+ "rename": [
43
+ {"pattern": "^factor_value_(.+)$", "replacement": "factor_\\1", "identifier": true},
44
+ {
45
+ "pattern": "(?i)^((?:group|bait).*)$",
46
+ "replacement": "factor_\\1",
47
+ "identifier": true
48
+ }
49
+ ]
50
+ }
51
+ ]
52
+ },
53
+ "required": false
54
+ },
55
+ "levels": {
56
+ "protein": {
57
+ "modality": "protein",
58
+ "columns": {
59
+ "var": [
60
+ {
61
+ "name": "feature_id",
62
+ "source": {"catalog": "apb_alpha", "var": "protein_assignment"}
63
+ },
64
+ {
65
+ "name": "label_protein_id",
66
+ "source": {"catalog": "apb_alpha", "var": "protein_assignment"}
67
+ },
68
+ {
69
+ "name": "label_gene_symbol",
70
+ "how": "short_name",
71
+ "inputs": [
72
+ {"catalog": "fasta_proteins_alpha", "var": "fasta_gene_names"},
73
+ {"catalog": "apb_alpha", "var": "protein_assignment"}
74
+ ]
75
+ },
76
+ {
77
+ "name": "description",
78
+ "source": {"catalog": "fasta_proteins_alpha", "var": "fasta_descriptions"},
79
+ "required": false
80
+ }
81
+ ]
82
+ },
83
+ "uns": [
84
+ {"name": "feature_id_kind", "how": "constant", "value": "protein"},
85
+ {
86
+ "name": "hierarchy",
87
+ "how": "constant",
88
+ "value": {"levels": ["protein"], "unit": "protein"}
89
+ }
90
+ ]
91
+ },
92
+ "peptide": {
93
+ "modality": "peptide",
94
+ "columns": {
95
+ "var": [
96
+ {
97
+ "name": "feature_id",
98
+ "how": "join_nonempty",
99
+ "inputs": [
100
+ {"catalog": "apb_alpha", "var": "protein_assignment"},
101
+ {"catalog": "apb_alpha", "var": "peptide"}
102
+ ],
103
+ "separator": "_"
104
+ },
105
+ {
106
+ "name": "label_protein_id",
107
+ "source": {"catalog": "apb_alpha", "var": "protein_assignment"},
108
+ "drop_missing": true
109
+ },
110
+ {
111
+ "name": "label_gene_symbol",
112
+ "how": "short_name",
113
+ "inputs": [
114
+ {"catalog": "fasta_peptides_alpha", "var": "reported_leading_gene_name"},
115
+ {"catalog": "fasta_peptides_alpha", "var": "reported_leading_id"},
116
+ {"catalog": "apb_alpha", "var": "protein_assignment"}
117
+ ],
118
+ "append": {"catalog": "apb_alpha", "var": "peptide"}
119
+ },
120
+ {
121
+ "name": "description",
122
+ "source": {
123
+ "catalog": "fasta_peptides_alpha",
124
+ "var": "reported_leading_description"
125
+ },
126
+ "required": false
127
+ }
128
+ ]
129
+ },
130
+ "uns": [
131
+ {"name": "feature_id_kind", "how": "constant", "value": "peptide"},
132
+ {
133
+ "name": "hierarchy",
134
+ "how": "constant",
135
+ "value": {"levels": ["protein", "peptide"], "unit": "peptide"}
136
+ }
137
+ ]
138
+ },
139
+ "peptidoform_ion": {
140
+ "modality": "precursor",
141
+ "columns": {
142
+ "var": [
143
+ {
144
+ "name": "feature_id",
145
+ "how": "join_nonempty",
146
+ "inputs": [
147
+ {"catalog": "apb_alpha", "var": "protein_assignment"},
148
+ {"catalog": "apb_alpha", "var": "peptidoform_ion"}
149
+ ],
150
+ "separator": "_"
151
+ },
152
+ {
153
+ "name": "label_protein_id",
154
+ "source": {"catalog": "apb_alpha", "var": "protein_assignment"},
155
+ "drop_missing": true
156
+ },
157
+ {
158
+ "name": "label_gene_symbol",
159
+ "how": "short_name",
160
+ "inputs": [
161
+ {"catalog": "fasta_peptides_alpha", "var": "reported_leading_gene_name"},
162
+ {"catalog": "fasta_peptides_alpha", "var": "reported_leading_id"},
163
+ {"catalog": "apb_alpha", "var": "protein_assignment"}
164
+ ],
165
+ "append": {"catalog": "apb_alpha", "var": "peptidoform_ion"}
166
+ },
167
+ {
168
+ "name": "description",
169
+ "source": {
170
+ "catalog": "fasta_peptides_alpha",
171
+ "var": "reported_leading_description"
172
+ },
173
+ "required": false
174
+ }
175
+ ]
176
+ },
177
+ "uns": [
178
+ {"name": "feature_id_kind", "how": "constant", "value": "precursor"},
179
+ {
180
+ "name": "hierarchy",
181
+ "how": "constant",
182
+ "value": {"levels": ["protein", "peptide", "precursor"], "unit": "precursor"}
183
+ }
184
+ ]
185
+ }
186
+ },
187
+ "uns": [
188
+ {"name": "schema_version", "how": "constant", "value": "exploreDE/1.0"},
189
+ {"name": "omics_type", "how": "constant", "value": "proteomics"},
190
+ {"name": "de", "how": "constant", "value": {}},
191
+ {"name": "enrichment", "how": "constant", "value": {}},
192
+ {"name": "enrichment_support", "how": "constant", "value": {}},
193
+ {"name": "provenance", "how": "constant", "value": {"source_format": "apb-export"}}
194
+ ]
195
+ }
196
+ ]
197
+ }
@@ -0,0 +1,127 @@
1
+ {
2
+ "schema_version": "0.5",
3
+ "file_version": "4",
4
+ "target_name": "msmu",
5
+ "target_version_pattern": "^0\\.4\\.",
6
+ "tables": [
7
+ {
8
+ "output": ".h5mu",
9
+ "base": {
10
+ "accession_syntax": {
11
+ "msmu": {
12
+ "separator": ";",
13
+ "contaminant_markers": ["contam_", "Cont_", "CON__"],
14
+ "contaminant_prefix": "Cont_"
15
+ }
16
+ }
17
+ },
18
+ "levels": {
19
+ "peptidoform_ion": {
20
+ "modality": "psm",
21
+ "axis": {"obs_key": "filename", "var_key": "precursor"},
22
+ "measurements": {
23
+ "primary_layer": "abundance",
24
+ "layers": [
25
+ {
26
+ "name": "abundance",
27
+ "source": {"measurements": "primary_layer"},
28
+ "width": 32,
29
+ "missing_values": [0]
30
+ },
31
+ {
32
+ "name": "q_value",
33
+ "source": {
34
+ "catalog": "proteobench_entrapment_alpha",
35
+ "var": "library_q_value",
36
+ "accept": "nonzero"
37
+ },
38
+ "fallback": [
39
+ {"catalog": "proteobench_entrapment_alpha", "var": "q_value"},
40
+ {"catalog": "confidence_alpha", "layers": "q_value"}
41
+ ],
42
+ "width": 32,
43
+ "required": false
44
+ },
45
+ {
46
+ "name": "PEP",
47
+ "source": {"catalog": "confidence_alpha", "layers": "pep"},
48
+ "width": 32,
49
+ "required": false
50
+ }
51
+ ]
52
+ },
53
+ "columns": {
54
+ "obs": [{"name": "filename", "source": {"axis": "obs_key"}}],
55
+ "var": [
56
+ {"name": "precursor", "source": {"catalog": "apb_alpha", "var": "peptidoform_ion"}},
57
+ {
58
+ "name": "proteins",
59
+ "how": "accessions",
60
+ "source": {"catalog": "apb_alpha", "var": "fasta_accessions"},
61
+ "syntax": "msmu",
62
+ "drop_missing": true
63
+ },
64
+ {"name": "peptide", "source": {"catalog": "apb_alpha", "var": "peptidoform"}},
65
+ {"name": "stripped_peptide", "source": {"catalog": "apb_alpha", "var": "peptide"}},
66
+ {
67
+ "name": "charge",
68
+ "how": "proforma_charge",
69
+ "source": {"catalog": "apb_alpha", "var": "peptidoform_ion"},
70
+ "type": "integer"
71
+ },
72
+ {
73
+ "name": "peptide_length",
74
+ "how": "sequence_length",
75
+ "source": {"catalog": "apb_alpha", "var": "peptide"},
76
+ "type": "integer"
77
+ },
78
+ {
79
+ "name": "decoy",
80
+ "source": {"catalog": "apb_alpha", "var": "decoy"},
81
+ "type": "integer"
82
+ },
83
+ {"name": "contaminant", "how": "contaminant", "type": "integer"},
84
+ {
85
+ "name": "PEP",
86
+ "how": "layer_minimum",
87
+ "layer": "PEP",
88
+ "type": "number",
89
+ "required": false,
90
+ "fill_value": "NaN"
91
+ },
92
+ {
93
+ "name": "q_value",
94
+ "how": "layer_minimum",
95
+ "layer": "q_value",
96
+ "type": "number",
97
+ "required": false
98
+ }
99
+ ]
100
+ },
101
+ "uns": [
102
+ {"name": "level", "how": "constant", "value": "precursor"},
103
+ {
104
+ "name": "search_engine",
105
+ "how": "lowercase",
106
+ "source": {"rule": "software_name"},
107
+ "required": false,
108
+ "fill_value": "unknown"
109
+ },
110
+ {
111
+ "name": "quantification",
112
+ "how": "lowercase",
113
+ "source": {"rule": "software_name"},
114
+ "required": false,
115
+ "fill_value": "unknown"
116
+ },
117
+ {"name": "label", "how": "constant", "value": "label_free"},
118
+ {"name": "acquisition", "how": "constant", "value": null},
119
+ {"name": "identification_file", "how": "constant", "value": null},
120
+ {"name": "quantification_file", "how": "constant", "value": null},
121
+ {"name": "apb_export_status", "how": "constant", "value": "experimental"}
122
+ ]
123
+ }
124
+ }
125
+ }
126
+ ]
127
+ }
@@ -0,0 +1,66 @@
1
+ {
2
+ "schema_version": "0.5",
3
+ "file_version": "2",
4
+ "target_name": "MSstats",
5
+ "target_version_pattern": "^4\\.20\\.",
6
+ "tables": [
7
+ {
8
+ "output": ".csv",
9
+ "levels": {
10
+ "peptidoform_ion": {
11
+ "axis": {"obs_key": "Run", "var_key": "PrecursorId"},
12
+ "measurements": {
13
+ "primary_layer": "Intensity",
14
+ "layers": [
15
+ {
16
+ "name": "Intensity",
17
+ "source": {"catalog": "abundance_alpha", "layers": "intensity"},
18
+ "fallback": [{"measurements": "primary_layer"}],
19
+ "missing_values": [0]
20
+ },
21
+ {
22
+ "name": "DetectionQValue",
23
+ "source": {"catalog": "confidence_alpha", "layers": "q_value"},
24
+ "required": false
25
+ },
26
+ {
27
+ "name": "PEP",
28
+ "source": {"catalog": "confidence_alpha", "layers": "pep"},
29
+ "fallback": [{"catalog": "confidence_alpha", "var": "pep"}],
30
+ "required": false
31
+ }
32
+ ]
33
+ },
34
+ "columns": {
35
+ "obs": [
36
+ {"name": "Run", "source": {"axis": "obs_key"}},
37
+ {"name": "Condition", "source": {"catalog": "obs_annotation_alpha", "obs": "group"}},
38
+ {
39
+ "name": "BioReplicate",
40
+ "source": {"catalog": "obs_annotation_alpha", "obs": "subject"}
41
+ }
42
+ ],
43
+ "var": [
44
+ {"name": "PrecursorId", "source": {"catalog": "apb_alpha", "var": "peptidoform_ion"}},
45
+ {
46
+ "name": "ProteinName",
47
+ "source": {"catalog": "apb_alpha", "var": "protein_assignment"},
48
+ "drop_missing": true
49
+ },
50
+ {"name": "PeptideSequence", "source": {"catalog": "apb_alpha", "var": "peptidoform"}},
51
+ {
52
+ "name": "PrecursorCharge",
53
+ "how": "proforma_charge",
54
+ "source": {"catalog": "apb_alpha", "var": "peptidoform_ion"},
55
+ "type": "integer"
56
+ },
57
+ {"name": "FragmentIon", "how": "constant", "value": null},
58
+ {"name": "ProductCharge", "how": "constant", "value": null, "type": "integer"},
59
+ {"name": "IsotopeLabelType", "how": "constant", "value": "L"}
60
+ ]
61
+ }
62
+ }
63
+ }
64
+ }
65
+ ]
66
+ }
@@ -0,0 +1,59 @@
1
+ {
2
+ "schema_version": "0.5",
3
+ "file_version": "2",
4
+ "target_name": "Perseus",
5
+ "target_version_pattern": "^2\\.",
6
+ "tables": [
7
+ {
8
+ "output": ".txt",
9
+ "levels": {
10
+ "protein": {
11
+ "axis": {"obs_key": "Sample", "var_key": "Protein IDs"},
12
+ "measurements": {
13
+ "primary_layer": "Intensity",
14
+ "layers": [
15
+ {
16
+ "name": "Intensity",
17
+ "source": {"measurements": "primary_layer"},
18
+ "missing_values": [0],
19
+ "name_by_key": {"aggregation=maxlfq": "LFQ intensity", "ibaq": "iBAQ"}
20
+ }
21
+ ]
22
+ },
23
+ "columns": {
24
+ "obs": [
25
+ {"name": "Sample", "source": {"axis": "obs_key"}},
26
+ {"name": "annotations", "how": "all_values"}
27
+ ],
28
+ "var": [
29
+ {
30
+ "name": "Protein IDs",
31
+ "source": {"catalog": "apb_alpha", "var": "protein_assignment"}
32
+ },
33
+ {
34
+ "name": "Gene names",
35
+ "source": {"catalog": "fasta_proteins_alpha", "var": "fasta_gene_names"},
36
+ "required": false
37
+ },
38
+ {
39
+ "name": "Q-value",
40
+ "source": {"catalog": "confidence_alpha", "var": "q_value"},
41
+ "fallback": [
42
+ {"catalog": "confidence_alpha", "var": "library_q_value", "accept": "nonzero"}
43
+ ],
44
+ "type": "number",
45
+ "required": false
46
+ },
47
+ {
48
+ "name": "Reverse",
49
+ "source": {"catalog": "apb_alpha", "var": "decoy"},
50
+ "type": "boolean"
51
+ },
52
+ {"name": "Potential contaminant", "how": "contaminant", "type": "boolean"}
53
+ ]
54
+ }
55
+ }
56
+ }
57
+ }
58
+ ]
59
+ }