-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathXi2Xi1Config.java
More file actions
592 lines (546 loc) · 24.7 KB
/
Copy pathXi2Xi1Config.java
File metadata and controls
592 lines (546 loc) · 24.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
/*
* Copyright 2021 Lutz Fischer <lfischer@staffmail.ed.ac.uk>.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.rappsilber.fdr.dataimport;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.json.simple.parser.ParseException;
import org.json.simple.parser.JSONParser;
import org.rappsilber.utils.ms.Composition;
import rappsilber.config.AbstractRunConfig;
import rappsilber.config.ConfigurationParserException;
import rappsilber.config.RunConfig;
import rappsilber.ms.ToleranceUnit;
import rappsilber.ms.crosslinker.AsymetricSingleAminoAcidRestrictedCrossLinker;
import rappsilber.ms.crosslinker.CrossLinker;
import rappsilber.ms.crosslinker.SymetricSingleAminoAcidRestrictedCrossLinker;
import rappsilber.ms.sequence.AminoAcid;
import rappsilber.ms.sequence.AminoModification;
import rappsilber.ms.sequence.digest.AAConstrainedDigestion;
/**
* Parses the minimal needed information from a xi2config json
* @author Lutz Fischer <lfischer@staffmail.ed.ac.uk>
*/
public class Xi2Xi1Config extends AbstractRunConfig{
HashMap<String, Double> default_xl_masses = new HashMap<>();
HashMap<String, CrossLinker> default_xl_xi1 = new HashMap<>();
HashMap<String, Xi2Crosslinker> default_xl_xi2 = new HashMap<>();
public boolean isModX = true;
{
AminoAcid[] KSTY = new AminoAcid[]{AminoAcid.K, AminoAcid.S, AminoAcid.T, AminoAcid.Y};
AminoAcid[] DE = new AminoAcid[]{AminoAcid.D, AminoAcid.E};
AminoAcid[] X = new AminoAcid[]{AminoAcid.X};
SymetricSingleAminoAcidRestrictedCrossLinker BS3 = new SymetricSingleAminoAcidRestrictedCrossLinker("BS3", 138.06807961, 138.06807961, KSTY);
BS3.setlinksNTerm(true);
SymetricSingleAminoAcidRestrictedCrossLinker DSSO = new SymetricSingleAminoAcidRestrictedCrossLinker("DSSO", 158.0038, 158.0038, KSTY);
BS3.setlinksNTerm(true);
AsymetricSingleAminoAcidRestrictedCrossLinker EDC = new AsymetricSingleAminoAcidRestrictedCrossLinker(
"EDC", -18.01056027, -18.01056027, KSTY, DE);
EDC.setlinksNTerm(true);
EDC.setLinksCTermSecondary(true);
AsymetricSingleAminoAcidRestrictedCrossLinker SDA = new AsymetricSingleAminoAcidRestrictedCrossLinker(
"SDA", 82.04186484, 82.04186484, KSTY, X);
SDA.setlinksNTerm(true);
default_xl_xi1.put("BS3", BS3);
default_xl_xi1.put("EDC", EDC);
default_xl_xi1.put("SDA", SDA);
default_xl_xi1.put("DSSO", DSSO);
String[] KSTY2 = new String[]{"K", "S", "T", "Y", "nterm"};
String[] DE2 = new String[]{"D", "E", "cterm"};
String[] X2 = new String[]{"X"};
default_xl_xi2.put("BS3",
new Xi2Crosslinker(BS3.getName(), BS3.getCrossLinkedMass(), new String[][] {KSTY2,KSTY2}));
default_xl_xi2.put("EDC",
new Xi2Crosslinker(EDC.getName(), EDC.getCrossLinkedMass(), new String[][] {KSTY2,DE2}));
default_xl_xi2.put("SDA",
new Xi2Crosslinker(SDA.getName(), SDA.getCrossLinkedMass(), new String[][] {KSTY2,X2}));
default_xl_xi2.put("DSSO",
new Xi2Crosslinker(DSSO.getName(), DSSO.getCrossLinkedMass(), new String[][] {KSTY2,KSTY2}));
for (CrossLinker xl: default_xl_xi1.values()){
default_xl_masses.put(xl.getName(), xl.getCrossLinkedMass());
}
}
/**
* Java representation of the xiSEARCH2 crosslinker definition.
* Only the here needed information are retained
*/
public class Xi2Crosslinker {
public String name;
public Double mass ;
String[][] specificity = new String[2][];
/**
* initialise just with name and get the rest from default definitions.
* @param name Name of the crosslinker
*/
public Xi2Crosslinker(String name) {
this.name = name;
if (default_xl_masses.containsKey(name.toUpperCase())) {
this.mass = default_xl_masses.get(name.toUpperCase());
} else {
this.mass = Double.NaN;
}
}
/**
* Initialise by name and mass.
* @param name Name of the crosslinker
* @param mass mass of the reacted crosslinker
*/
public Xi2Crosslinker(String name, double mass) {
this.name = name;
this.mass = mass;
}
/**
* Initialise by name, mass, and specificity.
* @param name Name of the crosslinker
* @param mass mass of the reacted crosslinker
* @param specificity where can the crosslinker react
*/
public Xi2Crosslinker(String name, double mass, String[][] specificity) {
this.name = name;
this.mass = mass;
this.specificity = specificity;
}
/**
* initialise based on a json crosslinker defintion derived map
* @param m
*/
public Xi2Crosslinker(Map m) {
this.name = m.get("name").toString();
this.mass = (Double) m.get("mass");
Object s = m.get("specificity");
if (s instanceof String) {
this.specificity[0] = new String[] {s.toString()};
this.specificity[1] = this.specificity[0];
} else {
List sa = (List) s;
if (sa.get(0) instanceof String) {
this.specificity[0] = new String[sa.size()];
for (int i =0; i<sa.size();i++)
this.specificity[0][i]=sa.get(i).toString();
this.specificity[1] = this.specificity[0];
} else {
List sa0 = (List)sa.get(0);
this.specificity[0] = new String[sa0.size()];
for (int i =0; i<sa0.size();i++)
this.specificity[0][i]=sa0.get(i).toString();
if (sa.size() == 1)
this.specificity[1] = this.specificity[0];
else {
List sa1 = (List)sa.get(1);
this.specificity[1] = new String[sa1.size()];
for (int i =0; i<sa1.size();i++)
this.specificity[1][i]=sa1.get(i).toString();
}
}
}
}
/**
* Convert to a xiSEARCH1 crosslinker definition.
* @return
* @throws java.text.ParseException
* @throws ConfigurationParserException
*/
public String toXi1Crosslinker() throws java.text.ParseException, ConfigurationParserException {
StringBuilder sb = new StringBuilder("crosslinker:AsymetricSingleAminoAcidRestrictedCrossLinker:NAME:");
sb.append(this.name);
sb.append(";FIRSTLINKEDAMINOACIDS:");
boolean first = true;
for (String aa: this.specificity[0]) {
if (first) {
first = false;
sb.append(aa);
} else {
sb.append(",").append(aa);
}
}
sb.append(";SECONDLINKEDAMINOACIDS:");
first = true;
for (String aa: this.specificity[0]) {
if (first) {
first = false;
sb.append(aa);
} else {
sb.append(",").append(aa);
}
}
sb.append(";MASS:").append(this.mass);
return sb.toString();
//return AsymetricSingleAminoAcidRestrictedCrossLinker.parseArgs(sb.toString(), DUMMYCONFIG);
}
}
public class Xi2Modification {
String symbol;
String type;
double mass;
String[] specificity;
public Xi2Modification(String symbol, String modtype) {
this.symbol = symbol;
this.type = modtype;
}
public Xi2Modification(String symbol, String modtype, double mass) {
this.symbol = symbol;
this.type = modtype;
this.mass = mass;
}
public Xi2Modification(Map m) {
this.mass = 0;
this.symbol = m.get("name").toString();
this.type = m.get("type").toString();
if (m.get("specificity") instanceof List) {
List specList = (List) m.get("specificity");
this.specificity =new String[specList.size()];
int sid = 0;
for (Object s : specList) {
specificity[sid++]=s.toString();
}
} else {
this.specificity =new String[1];
this.specificity[0] = m.get("specificity").toString();
}
if (m.containsKey("mass"))
mass = (Double) m.get("mass");
else
mass = Composition.formula2mass(m.get("composition").toString());
}
public String toxi1Mod() throws java.text.ParseException {
StringBuilder sb = new StringBuilder("modifcation::variable:SYMBOLEXT:");
sb.append(symbol);
sb.append(";MODIFIED:");
boolean first =true;
for (String aa: this.specificity) {
if (first) {
first = false;
sb.append(aa);
} else {
sb.append(",").append(aa);
}
}
sb.append(";DELTAMASS:").append(this.mass);
return sb.toString();
//return AminoModification.parseArgs(sb.toString(), DUMMYCONFIG);
}
}
public ArrayList<Xi2Crosslinker> xi2crosslinker = new ArrayList<>();
public ArrayList<Xi2Modification> xi2modifications = new ArrayList<>();
public String textConfig;
public Xi2Xi1Config() {
}
public Xi2Xi1Config(String config) {
try {
loadFromString(config);
} catch (ParseException |java.text.ParseException|ConfigurationParserException ex) {
Logger.getLogger(Xi2Xi1Config.class.getName()).log(Level.SEVERE, "Error converting xi2 config to xi1 config", ex);
}
}
private void loadFromString(String config) throws java.text.ParseException, ConfigurationParserException, ParseException {
this.xi2crosslinker = new ArrayList<>(1);
this.xi2modifications = new ArrayList<>();
this.textConfig = config;
JSONParser prsr = new JSONParser();
Map json = (Map)prsr.parse(config);
Object xls = parseListSetting(json.get("crosslinker"));
Object mod_peptide_syntax = json.get("mod_peptide_syntax");
if (mod_peptide_syntax == null || mod_peptide_syntax.toString().contentEquals("modX")) {
this.isModX = true;
}
List crosslinker;
if (xls instanceof List)
crosslinker = (List) xls;
else {
crosslinker = new ArrayList(1);
crosslinker.add(xls);
}
for (Object xlo : crosslinker) {
String name;
Xi2Crosslinker xl;
if (xlo instanceof Map) {
xl = new Xi2Crosslinker((Map)xlo);
} else {
name = xlo.toString();
xl = default_xl_xi2.get(name);
}
this.xi2crosslinker.add(xl);
this.evaluateConfigLine(xl.toXi1Crosslinker());
//this.addCrossLinker( new AsymetricSingleAminoAcidRestrictedCrossLinker(xl.name,xl.mass,xl.mass,PrimaryLinkableAminoAcids, SecondaryLinkableAminoAcids));
}
List modifications = parseListSetting(((Map)json.get("modification")).get("modifications"));
for (Object mo : modifications) {
Map m = (Map)mo;
Xi2Modification mod = new Xi2Modification(m);
this.xi2modifications.add(mod);
this.evaluateConfigLine(mod.toxi1Mod());
}
// tolerances
this.setPrecoursorTolerance(new ToleranceUnit(json.get("ms1_tol").toString()));
this.setFragmentTolerance(new ToleranceUnit(json.get("ms2_tol").toString()));
// enzyme info
Map digestConfjson = (Map)json.get("digestion");
List enzymes = parseListSetting(digestConfjson.get("enzymes"));
Object e0 = enzymes.get(0);
AAConstrainedDigestion xi1digest = null;
if (enzymes.get(0) instanceof Map) {
Map enzyme = (Map) e0;
List nspecificity = parseListSetting(enzyme.get("nterminal_of"));
List cspecificity = parseListSetting(enzyme.get("cterminal_of"));
List rspecificity = parseListSetting(enzyme.get("restraining"));
AminoAcid[] nterm =
nspecificity == null ? new AminoAcid[0] : new AminoAcid[nspecificity.size()];
AminoAcid[] cterm =
cspecificity == null ? new AminoAcid[0] : new AminoAcid[cspecificity.size()];
AminoAcid[] rest =
rspecificity == null ? new AminoAcid[0] : new AminoAcid[rspecificity.size()];
int sid = 0;
if (nspecificity != null) for (Object a : nspecificity) {
nterm[sid++] = this.getAminoAcid(a.toString());
}
sid = 0;
if (cspecificity != null) for (Object a : cspecificity) {
cterm[sid++] = this.getAminoAcid(a.toString());
}
sid = 0;
if (rspecificity != null) for (Object a : rspecificity) {
rest[sid++] = this.getAminoAcid(a.toString());
}
String name = enzyme.get("name").toString();
xi1digest = new AAConstrainedDigestion(nterm, cterm, rest,rest, this);
xi1digest.setName(name);
} else {
String se = e0.toString();
if (se.toLowerCase().contentEquals("trypsin")) {
AminoAcid[] nterm = new AminoAcid[]{AminoAcid.K, AminoAcid.R};
AminoAcid[] cterm = new AminoAcid[0];
AminoAcid[] rest = new AminoAcid[]{AminoAcid.P};
String name = "trypsin";
xi1digest = new AAConstrainedDigestion(nterm, cterm, rest,rest, this);
xi1digest.setName(name);
} else if (se.toLowerCase().contentEquals("asp_n")) {
AminoAcid[] nterm = new AminoAcid[]{AminoAcid.D};
AminoAcid[] cterm = new AminoAcid[0];
AminoAcid[] rest = new AminoAcid[0];
String name = "asp-n";
xi1digest = new AAConstrainedDigestion(nterm, cterm, rest,rest, this);
xi1digest.setName(name);
}
}
xi1digest.setMaxMissCleavages(Integer.parseInt(digestConfjson.getOrDefault("missed_cleavages", 0).toString()));
this.setDigestion(xi1digest);
// basic ions
Map fragmentation = (Map)json.get("fragmentation");
List nterm = parseListSetting(fragmentation.getOrDefault("nterm_ions","b"));
List cterm = parseListSetting(fragmentation.getOrDefault("cterm_ions","y"));
ArrayList allIons = new ArrayList(nterm);
allIons.addAll(cterm);
for (Object i : allIons) {
String ion = i.toString();
try {
if (ion.contentEquals("a")) {
this.getFragmentMethods().add(rappsilber.ms.sequence.ions.AIon.class.getMethod("fragment", rappsilber.ms.sequence.Peptide.class));
} else if (ion.contentEquals("b")) {
this.getFragmentMethods().add(rappsilber.ms.sequence.ions.BIon.class.getMethod("fragment", rappsilber.ms.sequence.Peptide.class));
} else if (ion.contentEquals("c")) {
this.getFragmentMethods().add(rappsilber.ms.sequence.ions.CIon.class.getMethod("fragment", rappsilber.ms.sequence.Peptide.class));
} else if (ion.contentEquals("x")) {
this.getFragmentMethods().add(rappsilber.ms.sequence.ions.XIon.class.getMethod("fragment", rappsilber.ms.sequence.Peptide.class));
} else if (ion.contentEquals("y")) {
this.getFragmentMethods().add(rappsilber.ms.sequence.ions.YIon.class.getMethod("fragment", rappsilber.ms.sequence.Peptide.class));
} else if (ion.contentEquals("z")) {
this.getFragmentMethods().add(rappsilber.ms.sequence.ions.ZIon.class.getMethod("fragment", rappsilber.ms.sequence.Peptide.class));
}
} catch (NoSuchMethodException ex) {
Logger.getLogger(Xi2Xi1Config.class.getName()).log(Level.SEVERE, null, ex);
} catch (SecurityException ex) {
Logger.getLogger(Xi2Xi1Config.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
public Xi2Xi1Config(File f) throws IOException {
BufferedReader br = new BufferedReader(new FileReader(f));
StringBuilder sb = new StringBuilder();
String line;
while ((line = br.readLine())!= null)
sb.append(line);
try{
loadFromString(sb.toString());
} catch (ParseException |java.text.ParseException|ConfigurationParserException ex) {
throw new IOException("Error converting xi2 config to xi1 config",ex);
}
}
public Xi2Xi1Config(RunConfig config) {
if (config instanceof Xi2Xi1Config) {
this.xi2crosslinker = new ArrayList<>(((Xi2Xi1Config)config).xi2crosslinker);
this.xi2modifications = new ArrayList<>(((Xi2Xi1Config)config).xi2modifications);
}
for (AminoModification am : config.getAllModifications()) {
this.addKnownModification(am);
}
for (CrossLinker xl : config.getCrossLinker())
this.addCrossLinker(xl);
this.setDigestion(config.getDigestion_method());
this.setFragmentTolerance(config.getFragmentTolerance());
this.setPrecoursorTolerance(config.getPrecousorTolerance());
}
public Xi2Xi1Config add(Xi2Xi1Config o) {
return add(o,true);
}
public Xi2Xi1Config add(Xi2Xi1Config o, boolean self) {
Xi2Xi1Config ret;
if (self) {
ret = this;
} else {
ret = new Xi2Xi1Config(this);
}
ArrayList<Xi2Modification> addNewMod = new ArrayList<>();
oloop: for (Xi2Modification mo : o.xi2modifications) {
for (Xi2Modification mt : ret.xi2modifications) {
if (mo.symbol.contentEquals(mt.symbol) && mo.type.contentEquals(mt.type))
continue oloop;
}
addNewMod.add(mo);
try {
this.evaluateConfigLine(mo.toxi1Mod());
} catch (java.text.ParseException ex) {
Logger.getLogger(Xi2Xi1Config.class.getName()).log(Level.SEVERE, null, ex);
}
}
ret.xi2modifications.addAll(addNewMod);
ArrayList<Xi2Crosslinker> addNewXL = new ArrayList<>();
oloop: for (Xi2Crosslinker co : o.xi2crosslinker) {
for (Xi2Crosslinker ct : ret.xi2crosslinker) {
if (co.name.contentEquals(ct.name) && Math.round(co.mass * 1000) == Math.round(ct.mass * 1000))
continue oloop;
}
addNewXL.add(co);
try {
ret.evaluateConfigLine(co.toXi1Crosslinker());
//ret.addCrossLinker(co.toXi1Crosslinker());
} catch (java.text.ParseException ex) {
Logger.getLogger(Xi2Xi1Config.class.getName()).log(Level.SEVERE, null, ex);
} catch (ConfigurationParserException ex) {
Logger.getLogger(Xi2Xi1Config.class.getName()).log(Level.SEVERE, null, ex);
}
}
ret.xi2crosslinker.addAll(addNewXL);
return ret;
}
public List parseListSetting(Object json) {
if (json == null)
return null;
if (json instanceof List)
return (List)json;
List ret = new ArrayList();
ret.add(json);
return ret;
}
public String peptPeptide(String basepeptide, int[] mods) {
StringBuffer ret = new StringBuffer();
if (mods[0] != 0)
ret.append(this.xi2modifications.get(mods[0]).symbol);
for (int i = 0; i<basepeptide.length(); i++) {
ret.append(basepeptide.substring(i,i+1));
if (mods[2+i] != 0)
ret.append(this.xi2modifications.get(mods[0]).symbol);
}
if (mods[1] != 0)
ret.append(this.xi2modifications.get(mods[1]).symbol);
return ret.toString();
}
public static void main(String[] args) {
String conf = "{\n" +
" \"reporting_requirements\": {\n" +
" \"report_top_ranking_only\": true\n" +
" },\n" +
" \"digestion\": {\n" +
" \"enzymes\": [\"trypsin\"],\n" +
" \"missed_cleavages\": 2,\n" +
" \"min_peptide_length\": 2\n" +
" },\n" +
" \"isotope_error_ximpa\": 2,\n" +
" \"ms1_tol\": \"3ppm\",\n" +
" \"ms2_tol\": \"5ppm\",\n" +
" \"top_n_alpha_scores\": 10,\n" +
" \"top_n_alpha_beta_scores\": 10,\n" +
" \"crosslinker\": \"BS3\",\n" +
" \"conservative_n_multi_loss\": 3,\n" +
" \"denoise_alpha\": {\n" +
" \"top_n\": 10,\n" +
" \"bin_size\": 100\n" +
" },\n" +
" \"denoise_alpha_beta\": {\n" +
" \"top_n\": 20,\n" +
" \"bin_size\": 100\n" +
" },\n" +
" \"fragmentation\": {\n" +
" \"nterm_ions\": [\"b\"],\n" +
" \"cterm_ions\": [\"y\"],\n" +
" \"add_precursor\": true,\n" +
" \"max_nloss\": 4,\n" +
" \"match_missing_monoisotopic\": true,\n" +
" \"losses\": [\n" +
" {\n" +
" \"name\": \"H2O\",\n" +
" \"specificity\": [\"S\", \"T\", \"D\", \"E\", \"cterm\"],\n" +
" \"composition\": \"\",\n" +
" \"mass\": 18.01056027\n" +
" },\n" +
" {\n" +
" \"name\": \"NH3\",\n" +
" \"specificity\": [\"R\", \"K\", \"N\", \"Q\", \"nterm\"],\n" +
" \"composition\": \"\",\n" +
" \"mass\": 17.02654493\n" +
" },\n" +
" {\n" +
" \"name\": \"CH3SOH\",\n" +
" \"specificity\": [\"oxM\"],\n" +
" \"composition\": \"\",\n" +
" \"mass\": 63.99828547\n" +
" }\n" +
" ]\n" +
" },\n" +
" \"modification\": {\n" +
" \"max_var_protein_mods\": 3,\n" +
" \"max_modified_peps\": 20,\n" +
" \"modifications\": [\n" +
" {\n" +
" \"name\": \"cm\",\n" +
" \"specificity\": [\"C\"],\n" +
" \"type\": \"fixed\",\n" +
" \"composition\": \"C2H3N1O1\"\n" +
" },\n" +
" {\n" +
" \"name\": \"ox\",\n" +
" \"specificity\": [\"M\"],\n" +
" \"type\": \"variable\",\n" +
" \"composition\": \"O1\"\n" +
" }\n" +
" ]\n" +
" }\n" +
"}";
Xi2Xi1Config xiconf = new Xi2Xi1Config(conf);
for (Xi2Xi1Config.Xi2Crosslinker cl : xiconf.xi2crosslinker) {
System.out.println("found crosslinker " + cl.name +"(" + cl.mass +")");
}
for (Xi2Xi1Config.Xi2Modification mod : xiconf.xi2modifications) {
System.out.println("found modification " + mod.symbol +"(" + mod.mass +")");
}
}
}