mrmPairs = MRMParser.getAllMrmPairs();
17 | System.out.println(mrmPairs.size());
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/JavaSDK/src/test/java/net/csibio/aird/test/datamodel/MobilityType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2006-2021 The MZmine Development Team
3 | *
4 | * This file is part of MZmine.
5 | *
6 | * MZmine is free software; you can redistribute it and/or modify it under the terms of the GNU
7 | * General Public License as published by the Free Software Foundation; either version 2 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * MZmine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
11 | * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License along with MZmine; if not,
15 | * write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
16 | *
17 | */
18 |
19 | package net.csibio.aird.test.datamodel;
20 |
21 | /**
22 | * Stores information on mobility type, axis labels and units.
23 | *
24 | * For an overview of these ion mobility types see https://doi.org/10.1002/jssc.201700919
25 | *
26 | * @author https://github.com/SteffenHeu
27 | */
28 | public enum MobilityType {
29 |
30 | NONE("none", "none", "none"), //
31 | TIMS("1/k0", "Vs/cm^2", "TIMS"), // trapped ion mobility spectrometry
32 | DRIFT_TUBE("Drift time", "ms", "DTIMS"), // drift tube
33 | TRAVELING_WAVE("Drift time", "ms", "TWIMS"), // traveling wave ion mobility spectrometry
34 | FAIMS("TODO", "TODO", "FAIMS"); // field asymmetric waveform ion mobility spectrometry
35 |
36 | private final String axisLabel;
37 | private final String unit;
38 | private final String name;
39 |
40 | MobilityType(String axisLabel, String unit, String name) {
41 | this.axisLabel = axisLabel;
42 | this.unit = unit;
43 | this.name = name;
44 | }
45 |
46 | public String getUnit() {
47 | return unit;
48 | }
49 |
50 |
51 | @Override
52 | public String toString() {
53 | return name;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/JavaSDK/src/test/java/net/csibio/aird/test/mzml/data/MzMLArrayType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * (C) Copyright 2015-2016 by MSDK Development Team
3 | *
4 | * This software is dual-licensed under either
5 | *
6 | * (a) the terms of the GNU Lesser General Public License version 2.1 as published by the Free
7 | * Software Foundation
8 | *
9 | * or (per the licensee's choosing)
10 | *
11 | * (b) the terms of the Eclipse Public License v1.0 as published by the Eclipse Foundation.
12 | */
13 |
14 | package net.csibio.aird.test.mzml.data;
15 |
16 | /**
17 | * Enumeration of different types of arrays which are parsed by the MzML Parser
18 | */
19 | public enum MzMLArrayType {
20 | MZ("MS:1000514"), // m/z values array
21 | INTENSITY("MS:1000515"), // Intensity values array
22 | TIME("MS:1000595"); // Retention time values array
23 |
24 | private final String accession;
25 |
26 | MzMLArrayType(String accession) {
27 | this.accession = accession;
28 | }
29 |
30 | /**
31 | *
Getter for the field accession
.
32 | *
33 | * @return the CV Parameter accession of the binary data array type as {@link String String}
34 | */
35 | public String getAccession() {
36 | return accession;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/JavaSDK/src/test/java/net/csibio/aird/test/mzml/data/MzMLBitLength.java:
--------------------------------------------------------------------------------
1 | /*
2 | * (C) Copyright 2015-2016 by MSDK Development Team
3 | *
4 | * This software is dual-licensed under either
5 | *
6 | * (a) the terms of the GNU Lesser General Public License version 2.1 as published by the Free
7 | * Software Foundation
8 | *
9 | * or (per the licensee's choosing)
10 | *
11 | * (b) the terms of the Eclipse Public License v1.0 as published by the Eclipse Foundation.
12 | */
13 |
14 | package net.csibio.aird.test.mzml.data;
15 |
16 | /**
17 | * Enumeration of different types of precision bit lengths which are parsed by the MzML Parser
18 | */
19 | public enum MzMLBitLength {
20 | THIRTY_TWO_BIT_INTEGER("MS:1000519"), // 32-bit integer
21 | SIXTEEN_BIT_FLOAT("MS:1000520"), // 16-bit float
22 | THIRTY_TWO_BIT_FLOAT("MS:1000521"), // 32-bit float
23 | SIXTY_FOUR_BIT_INTEGER("MS:1000522"), // 64-bit integer
24 | SIXTY_FOUR_BIT_FLOAT("MS:1000523"); // 64-bit float
25 |
26 | private final String accession;
27 |
28 | MzMLBitLength(String accession) {
29 | this.accession = accession;
30 | }
31 |
32 | /**
33 | * getValue.
34 | *
35 | * @return the CV Parameter accession of the precision bit length as {@link String String}
36 | */
37 | public String getValue() {
38 | return accession;
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/JavaSDK/src/test/java/net/csibio/aird/test/mzml/data/MzMLCVGroup.java:
--------------------------------------------------------------------------------
1 | /*
2 | * (C) Copyright 2015-2016 by MSDK Development Team
3 | *
4 | * This software is dual-licensed under either
5 | *
6 | * (a) the terms of the GNU Lesser General Public License version 2.1 as published by the Free
7 | * Software Foundation
8 | *
9 | * or (per the licensee's choosing)
10 | *
11 | * (b) the terms of the Eclipse Public License v1.0 as published by the Eclipse Foundation.
12 | */
13 |
14 | package net.csibio.aird.test.mzml.data;
15 |
16 | import java.util.ArrayList;
17 |
18 | /**
19 | *
20 | * A group (or list) of {@link MzMLCVParam CV Parameter}s
21 | *
22 | */
23 | public class MzMLCVGroup {
24 |
25 | private final ArrayList cvParams;
26 |
27 | /**
28 | * Constructor for MzMLCVGroup.
29 | */
30 | public MzMLCVGroup() {
31 | this.cvParams = new ArrayList<>();
32 | }
33 |
34 | /**
35 | * getCVParamsList.
36 | *
37 | * @return an {@link ArrayList ArrayList} of {@link MzMLCVParam CV Parameter}s
38 | */
39 | public ArrayList getCVParamsList() {
40 | return cvParams;
41 | }
42 |
43 | /**
44 | *
45 | * Adds a {@link MzMLCVParam CV Parameter} to the {@link MzMLCVGroup MzMLCVGroup}
46 | *
47 | *
48 | * @param cvParam the {@link MzMLCVParam CV Parameter} to be added to the {@link MzMLCVGroup
49 | * MzMLCVGroup}
50 | */
51 | public void addCVParam(MzMLCVParam cvParam) {
52 | cvParams.add(cvParam);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/JavaSDK/src/test/java/net/csibio/aird/test/mzml/data/MzMLIsolationWindow.java:
--------------------------------------------------------------------------------
1 | /*
2 | * (C) Copyright 2015-2016 by MSDK Development Team
3 | *
4 | * This software is dual-licensed under either
5 | *
6 | * (a) the terms of the GNU Lesser General Public License version 2.1 as published by the Free
7 | * Software Foundation
8 | *
9 | * or (per the licensee's choosing)
10 | *
11 | * (b) the terms of the Eclipse Public License v1.0 as published by the Eclipse Foundation.
12 | */
13 |
14 | package net.csibio.aird.test.mzml.data;
15 |
16 |
17 | /**
18 | * MzMLIsolationWindow class.
19 | */
20 | public class MzMLIsolationWindow extends MzMLCVGroup {
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/JavaSDK/src/test/java/net/csibio/aird/test/mzml/data/MzMLMobility.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2006-2021 The MZmine Development Team
3 | *
4 | * This file is part of MZmine.
5 | *
6 | * MZmine is free software; you can redistribute it and/or modify it under the terms of the GNU
7 | * General Public License as published by the Free Software Foundation; either version 2 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * MZmine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
11 | * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License along with MZmine; if not,
15 | * write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
16 | *
17 | */
18 |
19 | package net.csibio.aird.test.mzml.data;
20 |
21 | import net.csibio.aird.test.datamodel.MobilityType;
22 |
23 | public record MzMLMobility(double mobility, MobilityType mt) {
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/JavaSDK/src/test/java/net/csibio/aird/test/mzml/data/MzMLPrecursorActivation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * (C) Copyright 2015-2016 by MSDK Development Team
3 | *
4 | * This software is dual-licensed under either
5 | *
6 | * (a) the terms of the GNU Lesser General Public License version 2.1 as published by the Free
7 | * Software Foundation
8 | *
9 | * or (per the licensee's choosing)
10 | *
11 | * (b) the terms of the Eclipse Public License v1.0 as published by the Eclipse Foundation.
12 | */
13 |
14 | package net.csibio.aird.test.mzml.data;
15 |
16 | /**
17 | * MzMLPrecursorActivation class.
18 | */
19 | public class MzMLPrecursorActivation extends MzMLCVGroup {
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/JavaSDK/src/test/java/net/csibio/aird/test/mzml/data/MzMLPrecursorList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * (C) Copyright 2015-2016 by MSDK Development Team
3 | *
4 | * This software is dual-licensed under either
5 | *
6 | * (a) the terms of the GNU Lesser General Public License version 2.1 as published by the Free
7 | * Software Foundation
8 | *
9 | * or (per the licensee's choosing)
10 | *
11 | * (b) the terms of the Eclipse Public License v1.0 as published by the Eclipse Foundation.
12 | */
13 |
14 | package net.csibio.aird.test.mzml.data;
15 |
16 | import java.util.ArrayList;
17 |
18 |
19 | /**
20 | * MzMLPrecursorList class.
21 | */
22 | public class MzMLPrecursorList {
23 |
24 | private final ArrayList precursorElements;
25 |
26 | /**
27 | * Constructor for MzMLPrecursorList.
28 | */
29 | public MzMLPrecursorList() {
30 | this.precursorElements = new ArrayList<>();
31 | }
32 |
33 | /**
34 | * Getter for the field precursorElements
.
35 | *
36 | * @return a {@link ArrayList} object.
37 | */
38 | public ArrayList getPrecursorElements() {
39 | return precursorElements;
40 | }
41 |
42 | /**
43 | * addPrecursor.
44 | *
45 | * @param precursor a {@link MzMLPrecursorElement} object.
46 | */
47 | public void addPrecursor(MzMLPrecursorElement precursor) {
48 | precursorElements.add(precursor);
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/JavaSDK/src/test/java/net/csibio/aird/test/mzml/data/MzMLPrecursorSelectedIon.java:
--------------------------------------------------------------------------------
1 | /*
2 | * (C) Copyright 2015-2016 by MSDK Development Team
3 | *
4 | * This software is dual-licensed under either
5 | *
6 | * (a) the terms of the GNU Lesser General Public License version 2.1 as published by the Free
7 | * Software Foundation
8 | *
9 | * or (per the licensee's choosing)
10 | *
11 | * (b) the terms of the Eclipse Public License v1.0 as published by the Eclipse Foundation.
12 | */
13 |
14 | package net.csibio.aird.test.mzml.data;
15 |
16 | /**
17 | * MzMLPrecursorSelectedIon class.
18 | */
19 | public class MzMLPrecursorSelectedIon extends MzMLCVGroup {
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/JavaSDK/src/test/java/net/csibio/aird/test/mzml/data/MzMLPrecursorSelectedIonList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * (C) Copyright 2015-2016 by MSDK Development Team
3 | *
4 | * This software is dual-licensed under either
5 | *
6 | * (a) the terms of the GNU Lesser General Public License version 2.1 as published by the Free
7 | * Software Foundation
8 | *
9 | * or (per the licensee's choosing)
10 | *
11 | * (b) the terms of the Eclipse Public License v1.0 as published by the Eclipse Foundation.
12 | */
13 |
14 | package net.csibio.aird.test.mzml.data;
15 |
16 | import java.util.ArrayList;
17 |
18 | /**
19 | * MzMLPrecursorSelectedIonList class.
20 | */
21 | public class MzMLPrecursorSelectedIonList {
22 |
23 | private final ArrayList selectedIonList;
24 |
25 | /**
26 | * Constructor for MzMLPrecursorSelectedIonList.
27 | */
28 | public MzMLPrecursorSelectedIonList() {
29 | this.selectedIonList = new ArrayList<>();
30 | }
31 |
32 | /**
33 | * Getter for the field selectedIonList
.
34 | *
35 | * @return a {@link ArrayList} object.
36 | */
37 | public ArrayList getSelectedIonList() {
38 | return selectedIonList;
39 | }
40 |
41 | /**
42 | * addSelectedIon.
43 | *
44 | * @param e a {@link MzMLPrecursorSelectedIon} object.
45 | */
46 | public void addSelectedIon(MzMLPrecursorSelectedIon e) {
47 | selectedIonList.add(e);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/JavaSDK/src/test/java/net/csibio/aird/test/mzml/data/MzMLProduct.java:
--------------------------------------------------------------------------------
1 | /*
2 | * (C) Copyright 2015-2016 by MSDK Development Team
3 | *
4 | * This software is dual-licensed under either
5 | *
6 | * (a) the terms of the GNU Lesser General Public License version 2.1 as published by the Free
7 | * Software Foundation
8 | *
9 | * or (per the licensee's choosing)
10 | *
11 | * (b) the terms of the Eclipse Public License v1.0 as published by the Eclipse Foundation.
12 | */
13 |
14 | package net.csibio.aird.test.mzml.data;
15 |
16 | import java.util.Optional;
17 |
18 | /**
19 | * MzMLProduct class.
20 | */
21 | public class MzMLProduct {
22 |
23 | private Optional isolationWindow;
24 |
25 | /**
26 | * Constructor for MzMLProduct.
27 | */
28 | public MzMLProduct() {
29 | this.isolationWindow = Optional.ofNullable(null);
30 | }
31 |
32 | /**
33 | * Getter for the field isolationWindow
.
34 | *
35 | * @return a {@link Optional} object.
36 | */
37 | public Optional getIsolationWindow() {
38 | return isolationWindow;
39 | }
40 |
41 | /**
42 | * Setter for the field isolationWindow
.
43 | *
44 | * @param isolationWindow a {@link MzMLIsolationWindow} object.
45 | */
46 | public void setIsolationWindow(MzMLIsolationWindow isolationWindow) {
47 | this.isolationWindow = Optional.ofNullable(isolationWindow);
48 | }
49 |
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/JavaSDK/src/test/java/net/csibio/aird/test/mzml/data/MzMLProductList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * (C) Copyright 2015-2016 by MSDK Development Team
3 | *
4 | * This software is dual-licensed under either
5 | *
6 | * (a) the terms of the GNU Lesser General Public License version 2.1 as published by the Free
7 | * Software Foundation
8 | *
9 | * or (per the licensee's choosing)
10 | *
11 | * (b) the terms of the Eclipse Public License v1.0 as published by the Eclipse Foundation.
12 | */
13 |
14 | package net.csibio.aird.test.mzml.data;
15 |
16 | import java.util.ArrayList;
17 |
18 | /**
19 | * MzMLProductList class.
20 | */
21 | public class MzMLProductList {
22 |
23 | private final ArrayList products;
24 |
25 | /**
26 | * Constructor for MzMLProductList.
27 | */
28 | public MzMLProductList() {
29 | this.products = new ArrayList<>();
30 | }
31 |
32 | /**
33 | * Getter for the field products
.
34 | *
35 | * @return a {@link ArrayList} object.
36 | */
37 | public ArrayList getProducts() {
38 | return products;
39 | }
40 |
41 | /**
42 | * addProduct.
43 | *
44 | * @param product a {@link MzMLProduct} object.
45 | */
46 | public void addProduct(MzMLProduct product) {
47 | products.add(product);
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/JavaSDK/src/test/java/net/csibio/aird/test/mzml/data/MzMLReferenceableParamGroup.java:
--------------------------------------------------------------------------------
1 | /*
2 | * (C) Copyright 2015-2017 by MSDK Development Team
3 | *
4 | * This software is dual-licensed under either
5 | *
6 | * (a) the terms of the GNU Lesser General Public License version 2.1 as published by the Free
7 | * Software Foundation
8 | *
9 | * or (per the licensee's choosing)
10 | *
11 | * (b) the terms of the Eclipse Public License v1.0 as published by the Eclipse Foundation.
12 | */
13 |
14 | package net.csibio.aird.test.mzml.data;
15 |
16 | /**
17 | * MzMLReferenceableParamGroup class.
18 | */
19 | public class MzMLReferenceableParamGroup extends MzMLCVGroup {
20 |
21 | private String paramGroupName;
22 |
23 | /**
24 | * Constructor for MzMLReferenceableParamGroup.
25 | *
26 | * @param paramGroupName a {@link String} object.
27 | */
28 | public MzMLReferenceableParamGroup(String paramGroupName) {
29 | this.paramGroupName = paramGroupName;
30 | }
31 |
32 | /**
33 | * Getter for the field paramGroupName
.
34 | *
35 | * @return a {@link String} object.
36 | */
37 | public String getParamGroupName() {
38 | return paramGroupName;
39 | }
40 |
41 | /**
42 | * Setter for the field paramGroupName
.
43 | *
44 | * @param paramGroupName a {@link String} object.
45 | */
46 | public void setParamGroupName(String paramGroupName) {
47 | this.paramGroupName = paramGroupName;
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/JavaSDK/src/test/java/net/csibio/aird/test/mzml/data/MzMLScan.java:
--------------------------------------------------------------------------------
1 | /*
2 | * (C) Copyright 2015-2016 by MSDK Development Team
3 | *
4 | * This software is dual-licensed under either
5 | *
6 | * (a) the terms of the GNU Lesser General Public License version 2.1 as published by the Free
7 | * Software Foundation
8 | *
9 | * or (per the licensee's choosing)
10 | *
11 | * (b) the terms of the Eclipse Public License v1.0 as published by the Eclipse Foundation.
12 | */
13 |
14 | package net.csibio.aird.test.mzml.data;
15 |
16 | import java.util.Optional;
17 |
18 | /**
19 | * MzMLScan class.
20 | */
21 | public class MzMLScan extends MzMLCVGroup {
22 |
23 | Optional scanWindowList;
24 |
25 | /**
26 | * Constructor for MzMLScan.
27 | */
28 | public MzMLScan() {
29 | this.scanWindowList = Optional.ofNullable(null);
30 | }
31 |
32 | /**
33 | * Getter for the field scanWindowList
.
34 | *
35 | * @return a {@link Optional} object.
36 | */
37 | public Optional getScanWindowList() {
38 | return scanWindowList;
39 | }
40 |
41 | /**
42 | * Setter for the field scanWindowList
.
43 | *
44 | * @param scanWindowList a {@link MzMLScanWindowList} object.
45 | */
46 | public void setScanWindowList(MzMLScanWindowList scanWindowList) {
47 | this.scanWindowList = Optional.ofNullable(scanWindowList);
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/JavaSDK/src/test/java/net/csibio/aird/test/mzml/data/MzMLScanList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * (C) Copyright 2015-2016 by MSDK Development Team
3 | *
4 | * This software is dual-licensed under either
5 | *
6 | * (a) the terms of the GNU Lesser General Public License version 2.1 as published by the Free
7 | * Software Foundation
8 | *
9 | * or (per the licensee's choosing)
10 | *
11 | * (b) the terms of the Eclipse Public License v1.0 as published by the Eclipse Foundation.
12 | */
13 |
14 | package net.csibio.aird.test.mzml.data;
15 |
16 | import java.util.ArrayList;
17 |
18 | /**
19 | * MzMLScanList class.
20 | */
21 | public class MzMLScanList extends MzMLCVGroup {
22 |
23 | private final ArrayList scans;
24 |
25 | /**
26 | * Constructor for MzMLScanList.
27 | */
28 | public MzMLScanList() {
29 | this.scans = new ArrayList<>();
30 | }
31 |
32 | /**
33 | * Getter for the field scans
.
34 | *
35 | * @return a {@link ArrayList} object.
36 | */
37 | public ArrayList getScans() {
38 | return scans;
39 | }
40 |
41 | /**
42 | * addScan.
43 | *
44 | * @param scan a {@link io.github.msdk.io.mzml.data.MzMLScan} object.
45 | */
46 | public void addScan(MzMLScan scan) {
47 | scans.add(scan);
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/JavaSDK/src/test/java/net/csibio/aird/test/mzml/data/MzMLScanWindow.java:
--------------------------------------------------------------------------------
1 | /*
2 | * (C) Copyright 2015-2016 by MSDK Development Team
3 | *
4 | * This software is dual-licensed under either
5 | *
6 | * (a) the terms of the GNU Lesser General Public License version 2.1 as published by the Free
7 | * Software Foundation
8 | *
9 | * or (per the licensee's choosing)
10 | *
11 | * (b) the terms of the Eclipse Public License v1.0 as published by the Eclipse Foundation.
12 | */
13 |
14 | package net.csibio.aird.test.mzml.data;
15 |
16 | /**
17 | * MzMLScanWindow class.
18 | */
19 | public class MzMLScanWindow extends MzMLCVGroup {
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/JavaSDK/src/test/java/net/csibio/aird/test/mzml/data/MzMLScanWindowList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * (C) Copyright 2015-2016 by MSDK Development Team
3 | *
4 | * This software is dual-licensed under either
5 | *
6 | * (a) the terms of the GNU Lesser General Public License version 2.1 as published by the Free
7 | * Software Foundation
8 | *
9 | * or (per the licensee's choosing)
10 | *
11 | * (b) the terms of the Eclipse Public License v1.0 as published by the Eclipse Foundation.
12 | */
13 |
14 | package net.csibio.aird.test.mzml.data;
15 |
16 | import java.util.ArrayList;
17 |
18 | /**
19 | * MzMLScanWindowList class.
20 | */
21 | public class MzMLScanWindowList {
22 |
23 | private final ArrayList scanWindows;
24 |
25 | /**
26 | * Constructor for MzMLScanWindowList.
27 | */
28 | public MzMLScanWindowList() {
29 | this.scanWindows = new ArrayList<>();
30 | }
31 |
32 | /**
33 | * Getter for the field scanWindows
.
34 | *
35 | * @return a {@link ArrayList} object.
36 | */
37 | public ArrayList getScanWindows() {
38 | return scanWindows;
39 | }
40 |
41 | /**
42 | * addScanWindow.
43 | *
44 | * @param scanWindow a {@link MzMLScanWindow} object.
45 | */
46 | public void addScanWindow(MzMLScanWindow scanWindow) {
47 | scanWindows.add(scanWindow);
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/JavaSDK/src/test/java/net/csibio/aird/test/mzml/util/FileMemoryMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * (C) Copyright 2015-2017 by MSDK Development Team
3 | *
4 | * This software is dual-licensed under either
5 | *
6 | * (a) the terms of the GNU Lesser General Public License version 2.1 as published by the Free
7 | * Software Foundation
8 | *
9 | * or (per the licensee's choosing)
10 | *
11 | * (b) the terms of the Eclipse Public License v1.0 as published by the Eclipse Foundation.
12 | */
13 |
14 | package net.csibio.aird.test.mzml.util;
15 |
16 | import java.io.File;
17 | import java.io.IOException;
18 | import java.io.RandomAccessFile;
19 | import java.nio.channels.FileChannel;
20 |
21 | /**
22 | *
23 | * Used to load a {@link File File} onto a {@link io.github.msdk.io.mzml.util.ByteBufferInputStream
24 | * ByteBufferInputStream}
25 | *
26 | */
27 | public abstract class FileMemoryMapper {
28 |
29 | /**
30 | *
31 | * Used to load a {@link File File} onto a {@link io.github.msdk.io.mzml.util.ByteBufferInputStream
32 | * ByteBufferInputStream} *
33 | *
34 | *
35 | * @param file the {@link File File} to be mapped
36 | * @return a {@link io.github.msdk.io.mzml2.util.io.ByteBufferInputStream ByteBufferInputStream}
37 | * @throws IOException if any
38 | */
39 | public static ByteBufferInputStream mapToMemory(File file) throws IOException {
40 |
41 | RandomAccessFile aFile = new RandomAccessFile(file, "r");
42 | FileChannel inChannel = aFile.getChannel();
43 | ByteBufferInputStream is = ByteBufferInputStream.map(inChannel, FileChannel.MapMode.READ_ONLY);
44 | aFile.close();
45 |
46 | return is;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/JavaSDK/src/test/java/net/csibio/aird/test/sliceV2/TestSliceV2.java:
--------------------------------------------------------------------------------
1 | package net.csibio.aird.test.sliceV2;
2 |
3 | import com.alibaba.fastjson2.JSON;
4 | import net.csibio.aird.bean.common.Xic;
5 | import net.csibio.aird.parser.ColumnParser;
6 | import org.junit.Test;
7 |
8 | import java.io.IOException;
9 |
10 | public class TestSliceV2 {
11 |
12 | static String indexPath = "F:\\测试\\SA1.index";
13 | static String indexPath2 = "F:\\测试\\SampleA_1.index";
14 | static String oldIndexPath = "F:\\测试\\V1\\SA1.index";
15 |
16 | @Test
17 | public void testEIC() throws IOException {
18 | long start = System.currentTimeMillis();
19 |
20 | ColumnParser parserNew = new ColumnParser(indexPath);
21 | System.out.println("索引初始化时间为:"+(System.currentTimeMillis() - start)+"毫秒");
22 | start = System.currentTimeMillis();
23 | // ColumnParser parserOld = new ColumnParser(oldIndexPath);
24 | Xic newXic = parserNew.calcXicByMz(313.1733, 0.015);
25 | System.out.println("构建EIC单次的时间:"+(System.currentTimeMillis() - start)+"毫秒");
26 | start = System.currentTimeMillis();
27 | for (int i = 0; i < 10; i++) {
28 | Xic xic = parserNew.calcXicByMz(313.1733+i*5, 0.015);
29 | }
30 | System.out.println("构建EIC 10次的时间:"+(System.currentTimeMillis() - start)+"毫秒");
31 | // Xic oldXic = parserOld.calcXicByMz(313.1733, 0.015);
32 | // System.out.println(JSON.toJSONString(newXic.getRts()));
33 | System.out.println(JSON.toJSONString(newXic.getInts()));
34 | // System.out.println(JSON.toJSONString(oldXic.getRts()));
35 | // System.out.println(JSON.toJSONString(oldXic.getInts()));
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/JavaSDK/src/test/java/net/csibio/aird/test/util/AirdScanUtilTest.java:
--------------------------------------------------------------------------------
1 | package net.csibio.aird.test.util;
2 |
3 | import net.csibio.aird.util.AirdScanUtil;
4 | import org.junit.Test;
5 |
6 | public class AirdScanUtilTest {
7 |
8 | @Test
9 | public void scanIndexFiles_Test() {
10 | assert AirdScanUtil.isAirdFile("D:\\omicsdata\\proteomics\\C20181208yix_HCC_DIA_T_46A.aird");
11 | assert AirdScanUtil.isAirdFile("sssd.AirD");
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/JavaSDK/src/test/java/net/csibio/aird/test/util/StackCompressUtilTest.java:
--------------------------------------------------------------------------------
1 | package net.csibio.aird.test.util;
2 |
3 | import java.util.ArrayList;
4 | import java.util.Arrays;
5 | import java.util.List;
6 | import net.csibio.aird.bean.Layers;
7 | import net.csibio.aird.util.StackCompressUtil;
8 | import org.junit.Test;
9 |
10 | public class StackCompressUtilTest {
11 |
12 | @Test
13 | //测试256个数组经过堆叠压缩再解压,前后是否改变
14 | public void stackZDPD_Test1() {
15 | List arrGroup = new ArrayList<>();
16 | for (int j = 0; j < 256; j++) {
17 | int[] mz = new int[1000 + (int) Math.random() * 100];
18 | mz[0] = 10000;
19 | for (int i = 1; i < mz.length; i++) {
20 | mz[i] = mz[i - 1] + (int) Math.random() * 1000;
21 | }
22 | arrGroup.add(mz);
23 | }
24 | Layers layers = StackCompressUtil.stackEncode(arrGroup, false);
25 | List decompressArrGroup = StackCompressUtil.stackDecode(layers);
26 | boolean pass = true;
27 | for (int i = 0; i < arrGroup.size(); i++) {
28 | pass = pass && Arrays.equals(arrGroup.get(i), decompressArrGroup.get(i));
29 | if (!pass) {
30 | break;
31 | }
32 | }
33 | assert pass;
34 | }
35 |
36 | @Test
37 | //测试1-10000个随机数组经过堆叠压缩再解压,前后是否改变
38 | public void stackZDPD_Test2() {
39 | List arrGroup = new ArrayList<>();
40 | int arrNum = 1 + (int) Math.random() * 10000;
41 | for (int j = 0; j < arrNum; j++) {
42 | int[] mz = new int[1000 + (int) Math.random() * 100];
43 | mz[0] = 10000;
44 | for (int i = 1; i < mz.length; i++) {
45 | mz[i] = mz[i - 1] + (int) Math.random() * 1000;
46 | }
47 | arrGroup.add(mz);
48 | }
49 | Layers layers = StackCompressUtil.stackEncode(arrGroup, false);
50 | List decompressArrGroup = StackCompressUtil.stackDecode(layers);
51 | boolean pass = true;
52 | for (int i = 0; i < arrGroup.size(); i++) {
53 | pass = pass && Arrays.equals(arrGroup.get(i), decompressArrGroup.get(i));
54 | if (!pass) {
55 | break;
56 | }
57 | }
58 | assert pass;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/JavaSDK/src/test/java/net/csibio/aird/test/xixi/MainTest.java:
--------------------------------------------------------------------------------
1 | package net.csibio.aird.test.xixi;
2 |
3 | import net.csibio.aird.bean.AirdInfo;
4 | import net.csibio.aird.bean.Compressor;
5 | import net.csibio.aird.bean.DDAMs;
6 | import net.csibio.aird.bean.common.Spectrum;
7 | import net.csibio.aird.compressor.ByteCompressor;
8 | import net.csibio.aird.compressor.ByteTrans;
9 | import net.csibio.aird.compressor.XDPD;
10 | import net.csibio.aird.enums.ByteCompType;
11 | import net.csibio.aird.parser.DDAParser;
12 | import org.junit.Test;
13 |
14 | import java.util.Arrays;
15 | import java.util.Comparator;
16 | import java.util.HashMap;
17 | import java.util.List;
18 | import java.util.concurrent.ConcurrentHashMap;
19 | import java.util.concurrent.atomic.AtomicLong;
20 |
21 | import static net.csibio.aird.enums.ByteCompType.Zlib;
22 |
23 | public class MainTest {
24 |
25 | static String indexPath = "D:\\Repo\\DDA_Control_r1.json";
26 | static int MB = 1024 * 1024;
27 | static int KB = 1024;
28 |
29 | @Test
30 | public void testV1() throws Exception {
31 | DDAParser parser = new DDAParser(indexPath);
32 | AirdInfo airdInfo = parser.getAirdInfo();
33 | List msList = parser.readAllToMemory();
34 | System.out.println(msList.size());
35 | Spectrum spectrum = msList.get(0).getSpectrum();
36 |
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/PyAirdSDK/.gitignore:
--------------------------------------------------------------------------------
1 | /dist
2 | /build
3 | /.idea
4 | /AirdSDK.egg-info
5 |
--------------------------------------------------------------------------------
/PyAirdSDK/Beans/BlockIndex.py:
--------------------------------------------------------------------------------
1 | from Beans.CV import CV
2 | from Beans.WindowRange import WindowRange
3 |
4 |
5 | class BlockIndex:
6 |
7 | def __init__(self, dict):
8 | self.level = dict['level'] if 'level' in dict else None
9 | self.startPtr = dict['startPtr'] if 'startPtr' in dict else None
10 | self.endPtr = dict['endPtr'] if 'endPtr' in dict else None
11 | self.num = dict['num'] if 'num' in dict else None
12 | rangeList = []
13 | if "rangeList" in dict and len(dict['rangeList']) > 0:
14 | for rangeDict in dict['rangeList']:
15 | rangeList.append(WindowRange(rangeDict))
16 | self.rangeList = rangeList
17 | self.nums = dict['nums'] if 'nums' in dict else None
18 | self.rts = dict['rts'] if 'rts' in dict else None
19 | self.tics = dict['tics'] if 'tics' in dict else None
20 | self.injectionTimes = dict['injectionTimes'] if 'injectionTimes' in dict else None
21 | self.basePeakIntensities = dict['basePeakIntensities'] if 'basePeakIntensities' in dict else None
22 | self.basePeakMzs = dict['basePeakMzs'] if 'basePeakMzs' in dict else None
23 | self.mzs = dict['mzs'] if 'mzs' in dict else None
24 | self.tags = dict['tags'] if 'tags' in dict else None
25 | self.ints = dict['ints'] if 'ints' in dict else None
26 | self.mobilities = dict['mobilities'] if 'mobilities' in dict else None
27 | cvList = []
28 | if "cvList" in dict and len(dict['cvList']) > 0:
29 | for cvDict in dict['cvList']:
30 | cvList.append(CV(cvDict))
31 | self.cvList = cvList
32 |
33 | self.features = dict['features'] if 'features' in dict else None
34 |
35 | def getParentNum(self):
36 | if self.level is 2:
37 | return self.num
38 | else:
39 | return -1
40 |
--------------------------------------------------------------------------------
/PyAirdSDK/Beans/CV.py:
--------------------------------------------------------------------------------
1 | class CV:
2 |
3 | def __init__(self, dict):
4 | self.cvid = dict['cvid'] if 'cvid' in dict else None
5 | self.value = dict['value'] if 'value' in dict else None
6 | self.units = dict['units'] if 'units' in dict else None
7 |
8 |
--------------------------------------------------------------------------------
/PyAirdSDK/Beans/Common/Spectrum.py:
--------------------------------------------------------------------------------
1 | class Spectrum:
2 |
3 | def __init__(self, mzs, ints, mobilities):
4 | self.mzs = mzs
5 | self.ints = ints
6 | self.mobilities = mobilities
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/PyAirdSDK/Beans/Common/Xic.py:
--------------------------------------------------------------------------------
1 | class Xic:
2 |
3 | def __init__(self, rts, ints, mzs):
4 | self.rts = rts
5 | self.ints = ints
6 | self.mzs = mzs
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/PyAirdSDK/Beans/Common/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSi-Studio/Aird-SDK/5ceb09523ecc756427a2c5d682786ebd617f4432/PyAirdSDK/Beans/Common/__init__.py
--------------------------------------------------------------------------------
/PyAirdSDK/Beans/Compressor.py:
--------------------------------------------------------------------------------
1 | class Compressor:
2 |
3 | def __init__(self, dict):
4 | self.target = dict['target'] if 'target' in dict else None
5 | self.methods = dict['methods'] if 'methods' in dict else None
6 | self.precision = dict['precision'] if 'precision' in dict else None
7 | self.digit = dict['digit'] if 'digit' in dict else None
8 | self.byteOrder = dict['byteOrder'] if 'byteOrder' in dict else "LITTLE_ENDIAN"
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/PyAirdSDK/Beans/DDAMs.py:
--------------------------------------------------------------------------------
1 | class DDAMs:
2 |
3 | def __init__(self, rt, spectrum):
4 | self.num = None
5 | self.rt = rt
6 | self.tic = None
7 | self.cvList = None
8 | self.range = None
9 | self.spectrum = spectrum
10 | self.ms2List = None
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/PyAirdSDK/Beans/DDAPasefMs.py:
--------------------------------------------------------------------------------
1 | class DDAPasefMs:
2 |
3 | def __init__(self, rt, spectrum):
4 | self.num = None
5 | self.rt = rt
6 | self.tic = None
7 | self.cvList = None
8 | self.range = None
9 | self.spectrum = spectrum
10 | self.ms2List = None
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/PyAirdSDK/Beans/DataProcessing.py:
--------------------------------------------------------------------------------
1 | class DataProcessing:
2 |
3 | def __init__(self, dict):
4 | self.processingOperations = dict['processingOperations'] if 'processingOperations' in dict else None
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/PyAirdSDK/Beans/Instrument.py:
--------------------------------------------------------------------------------
1 | class Instrument:
2 |
3 | def __init__(self, dict):
4 | self.manufacturer = dict['manufacturer'] if 'manufacturer' in dict else None
5 | self.ionisation = dict['ionisation'] if 'ionisation' in dict else None
6 | self.resolution = dict['resolution'] if 'resolution' in dict else None
7 | self.model = dict['model'] if 'model' in dict else None
8 | self.source = dict['source'] if 'source' in dict else None
9 | self.analyzer = dict['analyzer'] if 'analyzer' in dict else None
10 | self.detector = dict['detector'] if 'detector' in dict else None
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/PyAirdSDK/Beans/Layers.py:
--------------------------------------------------------------------------------
1 | class Layers:
2 |
3 | def __init__(self, mzArray, tagArray, digit):
4 | self.mzArray = mzArray
5 | self.tagArray = tagArray
6 | self.digit = digit
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/PyAirdSDK/Beans/MobiInfo.py:
--------------------------------------------------------------------------------
1 | class MobiInfo:
2 | def __init__(self, dict):
3 | self.dictStart = dict['dictStart'] if 'dictStart' in dict else None
4 | self.dictEnd = dict['dictEnd'] if 'dictEnd' in dict else None
5 | self.unit = dict['unit'] if 'unit' in dict else None
6 | self.type = dict['type'] if 'type' in dict else None
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/PyAirdSDK/Beans/ParentFile.py:
--------------------------------------------------------------------------------
1 | class ParentFile:
2 |
3 | def __init__(self, dict):
4 | self.name = dict['name'] if 'name' in dict else None
5 | self.location = dict['location'] if 'location' in dict else None
6 | self.type = dict['type'] if 'type' in dict else None
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/PyAirdSDK/Beans/Software.py:
--------------------------------------------------------------------------------
1 | class Software:
2 |
3 | def __init__(self, dict):
4 | self.name = dict['name'] if 'name' in dict else None
5 | self.version = dict['version'] if 'version' in dict else None
6 | self.type = dict['type'] if 'type' in dict else None
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/PyAirdSDK/Beans/WindowRange.py:
--------------------------------------------------------------------------------
1 | class WindowRange:
2 |
3 | def __init__(self, dict):
4 | self.start = dict['start'] if 'start' in dict else None
5 | self.end = dict['end'] if 'end' in dict else None
6 | self.mz = dict['mz'] if 'mz' in dict else None
7 | self.charge = dict['charge'] if 'charge' in dict else None
8 | self.features = dict['features'] if 'features' in dict else None
--------------------------------------------------------------------------------
/PyAirdSDK/Beans/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSi-Studio/Aird-SDK/5ceb09523ecc756427a2c5d682786ebd617f4432/PyAirdSDK/Beans/__init__.py
--------------------------------------------------------------------------------
/PyAirdSDK/Compressor/ByteComp/BrotliWrapper.py:
--------------------------------------------------------------------------------
1 | from Enums.ByteCompType import ByteCompType
2 | import brotli
3 |
4 |
5 | class BrotliWrapper:
6 |
7 | def getName(self):
8 | return ByteCompType.Brotli
9 |
10 | def encode(self, input):
11 | return brotli.compress(input)
12 |
13 | def decode(self, input, offset, length):
14 | return brotli.decompress(input[offset: offset + length])
15 |
--------------------------------------------------------------------------------
/PyAirdSDK/Compressor/ByteComp/SnappyWrapper.py:
--------------------------------------------------------------------------------
1 | from Enums.ByteCompType import ByteCompType
2 | import snappy
3 |
4 |
5 | class SnappyWrapper:
6 |
7 | def getName(self):
8 | return ByteCompType.Snappy
9 |
10 | def encode(self, input):
11 | return snappy.compress(input)
12 |
13 | def decode(self, input, offset, length):
14 | return snappy.decompress(input[offset: offset + length])
15 |
--------------------------------------------------------------------------------
/PyAirdSDK/Compressor/ByteComp/ZlibWrapper.py:
--------------------------------------------------------------------------------
1 | from Enums.ByteCompType import ByteCompType
2 | import zlib
3 |
4 |
5 | class ZlibWrapper:
6 |
7 | def getName(self):
8 | return ByteCompType.Zlib
9 |
10 | def encode(self, input):
11 | return zlib.compress(input)
12 |
13 | def decode(self, input, offset, length):
14 | return zlib.decompress(input[offset: offset+length])
15 |
--------------------------------------------------------------------------------
/PyAirdSDK/Compressor/ByteComp/ZstdWrapper.py:
--------------------------------------------------------------------------------
1 | import zstandard as zstd
2 |
3 | from Enums.ByteCompType import ByteCompType
4 |
5 |
6 | class ZstdWrapper:
7 |
8 | def getName(self):
9 | return ByteCompType.Zstd
10 |
11 | def encode(self, input):
12 | return zstd.compress(input)
13 |
14 | def decode(self, input, offset, length):
15 | return zstd.decompress(input[offset: offset + length])
16 |
--------------------------------------------------------------------------------
/PyAirdSDK/Compressor/ByteComp/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSi-Studio/Aird-SDK/5ceb09523ecc756427a2c5d682786ebd617f4432/PyAirdSDK/Compressor/ByteComp/__init__.py
--------------------------------------------------------------------------------
/PyAirdSDK/Compressor/ByteTrans.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 |
3 |
4 | class ByteTrans:
5 |
6 | @staticmethod
7 | def intToByte(ints):
8 | res = bytes()
9 | length = len(ints)
10 | for i in range(0, length):
11 | res += ints[i].to_bytes(4, 'little')
12 |
13 | return res
14 |
15 | @staticmethod
16 | def byteToInt(bytes):
17 | length = len(bytes)
18 | res = [None] * int(length / 4)
19 | k = 0
20 | for i in range(0, length, 4):
21 | res[k] = (int.from_bytes(bytes[i: i + 4], 'little', signed=True))
22 | k = k + 1
23 |
24 | return np.array(res, dtype=np.uint32).ravel()
25 |
--------------------------------------------------------------------------------
/PyAirdSDK/Compressor/Delta.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 |
3 |
4 | class Delta:
5 |
6 | @staticmethod
7 | def delta(data):
8 | res = [0] * len(data)
9 | res[0] = data[0]
10 | for i in range(1, len(data)):
11 | res[i] = data[i] - data[i-1]
12 | return res
13 |
14 | @staticmethod
15 | def recover(data):
16 | res = [0] * len(data)
17 | res[0] = data[0]
18 | for i in range(1, len(data)):
19 | res[i] = data[i] + res[i - 1]
20 | return res
21 |
22 |
--------------------------------------------------------------------------------
/PyAirdSDK/Compressor/IntComp/BinPackingWrapper.py:
--------------------------------------------------------------------------------
1 | from Compressor.IntCompressor import IntCompressor
2 | from Enums.IntCompType import IntCompType
3 | from pyfastpfor import *
4 |
5 |
6 | class BinPackingWrapper:
7 |
8 | def __init__(self):
9 | self.codec = getCodec('fastbinarypacking32') # binary packing with variable byte
10 |
11 | def getName(self):
12 | return IntCompType.BP
13 |
14 | def encode(self, input):
15 | compressed = IntCompressor.encode(self.codec, input)
16 | return compressed
17 |
18 | def decode(self, input, offset, length):
19 | decompressed = IntCompressor.decode(self.codec, input, offset, length)
20 | return decompressed
21 |
--------------------------------------------------------------------------------
/PyAirdSDK/Compressor/IntComp/EmptyWrapper.py:
--------------------------------------------------------------------------------
1 | from Enums.IntCompType import IntCompType
2 |
3 |
4 | class EmptyWrapper:
5 |
6 | def getName(self):
7 | return IntCompType.Empty
8 |
9 | def encode(self, input):
10 | return input
11 |
12 | def decode(self, input, offset, length):
13 | return input[offset: offset + length]
14 |
--------------------------------------------------------------------------------
/PyAirdSDK/Compressor/IntComp/VarByteWrapper.py:
--------------------------------------------------------------------------------
1 | from Compressor.IntCompressor import IntCompressor
2 | from Enums.IntCompType import IntCompType
3 | from pyfastpfor import *
4 |
5 |
6 | class VarByteWrapper:
7 |
8 | def __init__(self):
9 | self.codec = getCodec('varint')
10 |
11 | def getName(self):
12 | return IntCompType.VB
13 |
14 | def encode(self, input):
15 | compressed = IntCompressor().encode(self.codec, input)
16 | return compressed
17 |
18 | def decode(self, input, offset, length):
19 | decompressed = IntCompressor().decode(self.codec, input, offset, length)
20 | return decompressed
21 |
--------------------------------------------------------------------------------
/PyAirdSDK/Compressor/IntComp/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSi-Studio/Aird-SDK/5ceb09523ecc756427a2c5d682786ebd617f4432/PyAirdSDK/Compressor/IntComp/__init__.py
--------------------------------------------------------------------------------
/PyAirdSDK/Compressor/IntCompressor.py:
--------------------------------------------------------------------------------
1 | from pyfastpfor import *
2 | from Enums.IntCompType import IntCompType
3 | import numpy as np
4 |
5 |
6 | class IntCompressor:
7 |
8 | @staticmethod
9 | def encode(codec, input):
10 | array = np.array(input, dtype=np.uint32).ravel()
11 | arraySize = len(input)
12 | inpComp = np.zeros(arraySize + 1024, dtype=np.uint32).ravel()
13 | compSize = codec.encodeArray(array, arraySize, inpComp, len(inpComp))
14 | compressed = np.insert(inpComp[:compSize], 0, arraySize)
15 | return compressed
16 |
17 | @staticmethod
18 | def decode(codec, input, offset, length):
19 | input = input[offset:offset + length]
20 | originalSize = input[0]
21 | input = input[1: len(input)]
22 | decompress = np.zeros(originalSize, dtype=np.uint32).ravel()
23 | codec.decodeArray(input, input.size, decompress, originalSize)
24 | return decompress
25 |
--------------------------------------------------------------------------------
/PyAirdSDK/Compressor/IntegratedIntCompressor.py:
--------------------------------------------------------------------------------
1 | from pyfastpfor import *
2 |
3 | from Compressor.Delta import Delta
4 | from Enums.IntCompType import IntCompType
5 | import numpy as np
6 |
7 |
8 | class IntegratedIntCompressor:
9 |
10 | @staticmethod
11 | def encode(codec, input):
12 | array = np.array(input, dtype=np.uint32).ravel()
13 | arraySize = len(input)
14 | delta4(array, len(array))
15 | inpComp = np.zeros(arraySize + 1024, dtype=np.uint32).ravel()
16 | compSize = codec.encodeArray(array, arraySize, inpComp, len(inpComp))
17 | compressed = np.insert(inpComp[:compSize], 0, arraySize)
18 | return compressed.tolist()
19 |
20 | @staticmethod
21 | def decode(codec, input, offset, length):
22 | input = input[offset:offset + length]
23 | originalSize = input[0]
24 | input = input[1: len(input)]
25 | decompress = np.zeros(originalSize, dtype=np.uint32).ravel()
26 | codec.decodeArray(input, input.size, decompress, originalSize)
27 | prefixSum1(decompress, decompress.size)
28 | return decompress
--------------------------------------------------------------------------------
/PyAirdSDK/Compressor/SortedIntComp/DeltaWrapper.py:
--------------------------------------------------------------------------------
1 | from Compressor.Delta import Delta
2 | from Enums.SortedIntCompType import SortedIntCompType
3 |
4 |
5 | class DeltaWrapper:
6 |
7 | def __init__(self):
8 | pass
9 |
10 | def getName(self):
11 | return SortedIntCompType.Delta
12 |
13 | def encode(self, input):
14 | return Delta.delta(input)
15 |
16 | def decode(self, input, offset, length):
17 | return Delta.recover(input[offset: offset + length])
18 |
--------------------------------------------------------------------------------
/PyAirdSDK/Compressor/SortedIntComp/IntegratedBinPackingWrapper.py:
--------------------------------------------------------------------------------
1 | from Compressor.IntegratedIntCompressor import IntegratedIntCompressor
2 | from Enums.IntCompType import IntCompType
3 | from pyfastpfor import *
4 |
5 |
6 | class IntegratedBinPackingWrapper:
7 |
8 | def __init__(self):
9 | self.codec = getCodec('fastbinarypacking32')
10 |
11 | def getName(self):
12 | return IntCompType.BP
13 |
14 | def encode(self, input):
15 | compressed = IntegratedIntCompressor().encode(self.codec, input)
16 | return compressed
17 |
18 | def decode(self, input, offset, length):
19 | decompressed = IntegratedIntCompressor().decode(self.codec, input, offset, length)
20 | return decompressed
21 |
--------------------------------------------------------------------------------
/PyAirdSDK/Compressor/SortedIntComp/IntegratedVarByteWrapper.py:
--------------------------------------------------------------------------------
1 | from Compressor.IntegratedIntCompressor import IntegratedIntCompressor
2 | from Enums.IntCompType import IntCompType
3 | from pyfastpfor import *
4 |
5 |
6 | class IntegratedVarByteWrapper:
7 |
8 | def __init__(self):
9 | self.codec = getCodec('varint')
10 |
11 | def getName(self):
12 | return IntCompType.BP
13 |
14 | def encode(self, input):
15 | compressed = IntegratedIntCompressor().encode(self.codec, input)
16 | return compressed
17 |
18 | def decode(self, input, offset, length):
19 | decompressed = IntegratedIntCompressor().decode(self.codec, input, offset, length)
20 | return decompressed
21 |
--------------------------------------------------------------------------------
/PyAirdSDK/Compressor/SortedIntComp/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSi-Studio/Aird-SDK/5ceb09523ecc756427a2c5d682786ebd617f4432/PyAirdSDK/Compressor/SortedIntComp/__init__.py
--------------------------------------------------------------------------------
/PyAirdSDK/Compressor/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSi-Studio/Aird-SDK/5ceb09523ecc756427a2c5d682786ebd617f4432/PyAirdSDK/Compressor/__init__.py
--------------------------------------------------------------------------------
/PyAirdSDK/Constants/Features.py:
--------------------------------------------------------------------------------
1 | class Features:
2 | original_width = "owid"
3 | original_precursor_mz_start = "oMzStart"
4 | original_precursor_mz_end = "oMzEnd"
5 | raw_id = "rawId"
6 | ignore_zero_intensity = "ignoreZeroIntensity"
7 | overlap = "overlap"
8 | slope = "slope"
9 | intercept = "intercept"
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/PyAirdSDK/Constants/PSI.py:
--------------------------------------------------------------------------------
1 | class PSI:
2 |
3 | MS_RT_SCAN_START = "1000016"
4 | MS_RT_RETENTION_TIME = "1000894"
5 | MS_RT_RETENTION_TIME_LOCAL = "1000895"
6 | MS_RT_RETENTION_TIME_NORMALIZED = "1000896"
7 | cvMSLevel = "1000511"
8 | cvMS1Spectrum = "1000579"
9 | cvMz = "1000040"
10 | cvChargeState = "1000041"
11 | cvUnitsMin1 = "1000038"
12 | cvUnitsMin2 = "UO:0000031"
13 | cvUnitsSec = "UO:0000010"
14 | cvScanFilter = "1000512"
15 | cvPrecursorMz = "1000744"
16 | cvPolarityPositive = "1000130"
17 | cvPolarityNegative = "1000129"
18 | cvCentroidSpectrum = "1000127"
19 | cvProfileSpectrum = "1000128"
20 | cvTIC = "1000285"
21 | cvLowestMz = "1000528"
22 | cvHighestMz = "1000527"
23 | cvScanWindowUpperLimit = "1000500"
24 | cvScanWindowLowerLimit = "1000501"
25 | cvChromatogramTIC = "1000235"
26 | cvChromatogramMRM_SRM = "1001473"
27 | cvChromatogramSIC = "1000627"
28 | cvChromatogramBPC = "1000628"
29 | cvActivationEnergy = "1000045"
30 | cvPercentCollisionEnergy = "1000138"
31 | cvActivationEnergy2 = "1000509"
32 | cvActivationCID = "1000133"
33 | cvElectronCaptureDissociation = "1000250"
34 | cvHighEnergyCID = "1000422"
35 | cvLowEnergyCID = "1000433"
36 | cvIsolationWindowTarget = "1000827"
37 | cvIsolationWindowLowerOffset = "1000828"
38 | cvIsolationWindowUpperOffset = "1000829"
39 | cvMzArray = "1000514"
40 | cvIntensityArray = "1000515"
41 | cvRetentionTimeArray = "1000595"
42 | cvUVSpectrum = "1000804"
43 | cvUnitsIntensity1 = "1000131"
44 | cvMobilityDriftTime = "1002476"
45 | cvMobilityDriftTimeUnit = "UO:0000028"
46 | cvMobilityInverseReduced = "1002815"
47 | cvMobilityInverseReducedUnit = "1002814"
48 | cvBasePeakMz = "1000504"
49 | cvBasePeakIntensity = "1000505"
--------------------------------------------------------------------------------
/PyAirdSDK/Constants/SuffixConst.py:
--------------------------------------------------------------------------------
1 | class SuffixConst:
2 | JSON = ".json"
3 | AIRD = ".aird"
4 | MZXML = ".mzxml"
5 | MZML = ".mzml"
6 | RAW = ".raw"
7 | WIFF = ".wiff"
8 | SCAN = ".scan"
9 | D = ".d"
10 |
--------------------------------------------------------------------------------
/PyAirdSDK/Constants/SymbolConst.py:
--------------------------------------------------------------------------------
1 | class SymbolConst:
2 | COMMA = ","
3 | TAB = "\t"
4 | RETURN = "\r"
5 | DOT = "."
6 | DELIMITER = "-"
7 | UNDERLINE = "_"
8 | BAR = "|"
9 | SPACE = " "
10 |
--------------------------------------------------------------------------------
/PyAirdSDK/Constants/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSi-Studio/Aird-SDK/5ceb09523ecc756427a2c5d682786ebd617f4432/PyAirdSDK/Constants/__init__.py
--------------------------------------------------------------------------------
/PyAirdSDK/Enums/AirdType.py:
--------------------------------------------------------------------------------
1 | from enum import Enum
2 |
3 |
4 | class AirdType(Enum):
5 | DIA_PASEF = "DIA_PASEF"
6 | DDA_PASEF = "DDA_PASEF"
7 | PRM_PASEF = "PRM_PASEF"
8 | DIA = "DIA"
9 | PRM = "PRM"
10 | SCANNING_SWATH = "SCANNING_SWATH"
11 | DDA = "DDA"
12 |
13 |
--------------------------------------------------------------------------------
/PyAirdSDK/Enums/ByteCompType.py:
--------------------------------------------------------------------------------
1 | from enum import Enum
2 |
3 |
4 | class ByteCompType(Enum):
5 | Zlib = 0
6 | Zstd = 1
7 | Snappy = 2
8 | Brotli = 3
9 |
--------------------------------------------------------------------------------
/PyAirdSDK/Enums/DataDim.py:
--------------------------------------------------------------------------------
1 | from enum import Enum
2 |
3 |
4 | class DataDim(Enum):
5 | TARGET_MZ = "mz"
6 | TARGET_INTENSITY = "intensity"
7 | TARGET_MOBILITY = "mobility"
8 |
9 |
--------------------------------------------------------------------------------
/PyAirdSDK/Enums/IntCompType.py:
--------------------------------------------------------------------------------
1 | from enum import Enum
2 |
3 |
4 | class IntCompType(Enum):
5 | Empty = -1
6 | VB = 2 # Variable Byte
7 | BP = 3 # Binary Packing
8 | FPF256 = 4 # fastpfor256
9 |
--------------------------------------------------------------------------------
/PyAirdSDK/Enums/MsLevel.py:
--------------------------------------------------------------------------------
1 | from enum import Enum
2 |
3 |
4 | class MsLevel(Enum):
5 | MS1 = "1"
6 | MS2 = "2"
--------------------------------------------------------------------------------
/PyAirdSDK/Enums/SortedIntCompType.py:
--------------------------------------------------------------------------------
1 | from enum import Enum
2 |
3 |
4 | class SortedIntCompType(Enum):
5 | IBP = 0
6 | IVB = 1
7 | Delta = 2
--------------------------------------------------------------------------------
/PyAirdSDK/Enums/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSi-Studio/Aird-SDK/5ceb09523ecc756427a2c5d682786ebd617f4432/PyAirdSDK/Enums/__init__.py
--------------------------------------------------------------------------------
/PyAirdSDK/Parser/DIAParser.py:
--------------------------------------------------------------------------------
1 | from Parser.BaseParser import BaseParser
2 |
3 |
4 | class DIAParser(BaseParser):
5 |
6 | pass
--------------------------------------------------------------------------------
/PyAirdSDK/Parser/PRMParser.py:
--------------------------------------------------------------------------------
1 | from Parser.BaseParser import BaseParser
2 |
3 |
4 | class PRMParser(BaseParser):
5 |
6 | pass
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/PyAirdSDK/Parser/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSi-Studio/Aird-SDK/5ceb09523ecc756427a2c5d682786ebd617f4432/PyAirdSDK/Parser/__init__.py
--------------------------------------------------------------------------------
/PyAirdSDK/Utils/AirdScanUtil.py:
--------------------------------------------------------------------------------
1 | import os
2 |
3 | from Beans.AirdInfo import AirdInfo
4 | from Constants.SuffixConst import SuffixConst
5 | from Constants.SymbolConst import SymbolConst
6 | import json
7 |
8 |
9 | class AirdScanUtil:
10 |
11 | @staticmethod
12 | def scanIndexFiles(path):
13 | fileList = []
14 | for filename in os.listdir(path):
15 | if filename.lower().endswith(SuffixConst.JSON):
16 | fileList.append(os.path.join(path, filename))
17 |
18 | return fileList
19 |
20 | @staticmethod
21 | def loadAirdInfo(indexFilePath):
22 | content = open(indexFilePath, 'r')
23 | dict = json.load(content)
24 | return AirdInfo(dict)
25 |
26 | @staticmethod
27 | def getAirdPathByIndexPath(indexPath):
28 | if indexPath is None or SymbolConst.DOT not in indexPath or SuffixConst.JSON not in indexPath.lower():
29 | return None
30 | return indexPath[0: indexPath.rindex(SymbolConst.DOT)] + SuffixConst.AIRD
31 |
32 | @staticmethod
33 | def getIndexPathByAirdPath(airdPath):
34 | if airdPath is None or SymbolConst.DOT not in airdPath or SuffixConst.AIRD not in airdPath.lower():
35 | return None
36 | return airdPath[0: airdPath.rindex(SymbolConst.DOT)] + SuffixConst.JSON
37 |
--------------------------------------------------------------------------------
/PyAirdSDK/Utils/DDAUtil.py:
--------------------------------------------------------------------------------
1 | import os
2 | from Constants.SuffixConst import SuffixConst
3 | from Constants.SymbolConst import SymbolConst
4 | import json
5 |
6 |
7 | class DDAUtil:
8 |
9 | @staticmethod
10 | def initFromIndex(ms, index, loc):
11 | if index.nums is not None and len(index.nums) > 0:
12 | ms.num = index.nums[loc]
13 | if index.cvList is not None and len(index.cvList) > 0:
14 | ms.cvList = index.cvList[loc]
15 | if index.tics is not None and len(index.tics) > 0:
16 | ms.tic = index.tics[loc]
17 | if index.rangeList is not None and len(index.rangeList) > 0:
18 | ms.range = index.rangeList[loc]
--------------------------------------------------------------------------------
/PyAirdSDK/Utils/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSi-Studio/Aird-SDK/5ceb09523ecc756427a2c5d682786ebd617f4432/PyAirdSDK/Utils/__init__.py
--------------------------------------------------------------------------------
/PyAirdSDK/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CSi-Studio/Aird-SDK/5ceb09523ecc756427a2c5d682786ebd617f4432/PyAirdSDK/__init__.py
--------------------------------------------------------------------------------
/PyAirdSDK/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import setup
2 | from setuptools import find_packages
3 |
4 |
5 | VERSION = '0.1.1'
6 |
7 | setup(
8 | name='AirdSDK', # package name
9 | version="0.0.2", # package version
10 | url="https://github.com/CSi-Studio/Aird-SDK/",
11 | author="CSi-Studio",
12 | author_email="csi@csibio.net",
13 | maintainer="Miaoshan Lu",
14 | license="Mulan PSL v2",
15 | description='Aird SDK for python. AirdPro version > 4.0.0, Not support for BP comp', # package description
16 | keywords="AirdPro, Aird, AirdSDK, ComboComp",
17 | packages=find_packages(),
18 | zip_safe=False,
19 | python_requires=">=3.6",
20 | install_requires=[
21 | "pyfastpfor>=1.3.6",
22 | "Brotli>=1.0.9",
23 | "python-snappy>=0.6.1",
24 | "zstandard>=0.18.0",
25 | ],
26 | )
27 |
--------------------------------------------------------------------------------