├── .gitignore ├── CSharpSDK ├── .gitignore ├── AirdManager.cs ├── AirdProLogo.png ├── AirdSDK - Backup.csproj ├── AirdSDK.csproj ├── AirdSDK.sln ├── Bean │ ├── AirdInfo.cs │ ├── BlockIndex.cs │ ├── ChromatogramIndex.cs │ ├── ColumnIndex.cs │ ├── ColumnInfo.cs │ ├── Common │ │ ├── ByteColumn.cs │ │ ├── IntPair.cs │ │ ├── IntSpectrum.cs │ │ ├── MrmPair.cs │ │ ├── Spectrum.cs │ │ └── Xic.cs │ ├── Compressor.cs │ ├── DDAMs.cs │ ├── DDAPasefMs.cs │ ├── DataProcessing.cs │ ├── Features.cs │ ├── Instrument.cs │ ├── Layers.cs │ ├── MobiInfo.cs │ ├── ParentFile.cs │ ├── Proto │ │ ├── AirdInfo.cs │ │ ├── AirdInfo.proto │ │ ├── ColumnInfo.cs │ │ ├── ColumnInfo.proto │ │ ├── WindowRange.cs │ │ └── WindowRange.proto │ ├── Software.cs │ └── WindowRange.cs ├── Compressor │ ├── BaseComp.cs │ ├── ByteComp │ │ ├── BrotliWrapper.cs │ │ ├── ByteComp.cs │ │ ├── SnappyWrapper.cs │ │ ├── ZlibWrapper.cs │ │ └── ZstdWrapper.cs │ ├── ByteCompressor.cs │ ├── ByteTrans.cs │ ├── ComboComp.cs │ ├── Delta.cs │ ├── HuffmanCode │ │ ├── HuffmanCoder.cs │ │ ├── HuffmanTree.cs │ │ ├── Node.cs │ │ ├── TestHuffmanTreeSample.cs │ │ └── TreeList.cs │ ├── IntComp │ │ ├── BinPackingWrapper.cs │ │ ├── DeltaZigzagVBWrapper.cs │ │ ├── Empty.cs │ │ ├── IntComp.cs │ │ └── VarByteWrapper.cs │ ├── IntegratedXVByte.cs │ ├── SortedIntComp │ │ ├── DeltaWrapper.cs │ │ ├── IntegratedBinPackingWrapper.cs │ │ ├── IntegratedVarByteWrapper.cs │ │ └── SortedIntComp.cs │ ├── StackLayer.cs │ ├── XDPD.cs │ ├── XVByte.cs │ └── Xor.cs ├── Constants │ ├── Features.cs │ ├── PSI.cs │ ├── SuffixConst.cs │ └── SymbolConst.cs ├── Enums │ ├── AcquisitionMethod.cs │ ├── AirdEngine.cs │ ├── AirdType.cs │ ├── ByteCompType.cs │ ├── IntCompType.cs │ ├── MsLevel.cs │ ├── ResultCodeEnum.cs │ └── SortedIntCompType.cs ├── Exception │ └── ScanException.cs ├── LICENSE ├── Parser │ ├── BaseParser.cs │ ├── ColumnParser.cs │ ├── DDAParser.cs │ ├── DDAPasefParser.cs │ ├── DIAParser.cs │ ├── DIAPasefParser.cs │ ├── MRMParser.cs │ └── PRMParser.cs ├── ThirdParty │ ├── BugFixForCSharpFastPFORCore │ │ ├── BinaryPacking.cs │ │ ├── BitPacking.cs │ │ ├── ByteIntegerCODEC.cs │ │ ├── Composition.cs │ │ ├── DeltaZigzagBinaryPacking.cs │ │ ├── DeltaZigzagEncoding.cs │ │ ├── DeltaZigzagVariableByte.cs │ │ ├── Differential │ │ │ ├── Delta.cs │ │ │ ├── IntegratedBinaryPacking.cs │ │ │ ├── IntegratedBitPacking.cs │ │ │ ├── IntegratedByteIntegerCODEC.cs │ │ │ ├── IntegratedComposition.cs │ │ │ ├── IntegratedIntCompressor.cs │ │ │ ├── IntegratedIntegerCODEC.cs │ │ │ ├── IntegratedVariableByte.cs │ │ │ ├── SkippableIntegratedComposition.cs │ │ │ ├── SkippableIntegratedIntegerCODEC.cs │ │ │ └── XorBinaryPacking.cs │ │ ├── FastPFOR.cs │ │ ├── FastPFOR128.cs │ │ ├── IntCompressor.cs │ │ ├── IntWrapper.cs │ │ ├── IntegerCODEC.cs │ │ ├── JustCopy.cs │ │ ├── NewPFD.cs │ │ ├── NewPFDS16.cs │ │ ├── NewPFDS9.cs │ │ ├── OptPFD.cs │ │ ├── OptPFDS16.cs │ │ ├── OptPFDS9.cs │ │ ├── Port │ │ │ ├── Arrays.cs │ │ │ ├── BitSet.cs │ │ │ ├── ByteBuffer.cs │ │ │ ├── ByteOrder.cs │ │ │ ├── IntBuffer.cs │ │ │ └── Integer.cs │ │ ├── S16.cs │ │ ├── S9.cs │ │ ├── Simple16.cs │ │ ├── Simple9.cs │ │ ├── SkippableComposition.cs │ │ ├── SkippableIntegerCODEC.cs │ │ ├── Synth │ │ │ ├── ClusteredDataGenerator.cs │ │ │ └── UniformDataGenerator.cs │ │ ├── Util.cs │ │ └── VariableByte.cs │ ├── MsNumpress │ │ └── MSNumpress.cs │ └── Zlib │ │ ├── Common │ │ ├── CRC32.cs │ │ └── Iso8859Dash1Encoding.cs │ │ ├── Deflate.cs │ │ ├── DeflateStream.cs │ │ ├── GZipStream.cs │ │ ├── InfTree.cs │ │ ├── Inflate.cs │ │ ├── LICENSE.jzlib.txt │ │ ├── License.zlib.txt │ │ ├── ParallelDeflateOutputStream.cs │ │ ├── Tree.cs │ │ ├── Zlib.cs │ │ ├── ZlibBaseStream.cs │ │ ├── ZlibCodec.cs │ │ ├── ZlibConstants.cs │ │ └── ZlibStream.cs ├── Utils │ ├── AirdMathUtil.cs │ ├── AirdScanUtil.cs │ ├── ArrayUtil.cs │ ├── DDAUtil.cs │ ├── FeaturesUtil.cs │ ├── FileNameUtil.cs │ ├── FileUtil.cs │ ├── NetworkUtil.cs │ └── TdfUtil.cs └── timsdata.dll ├── JavaSDK ├── .gitignore ├── AirdMetaData.json ├── LICENSE ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── csibio │ │ │ └── aird │ │ │ ├── AirdManager.java │ │ │ ├── bean │ │ │ ├── AirdInfo.java │ │ │ ├── BlockIndex.java │ │ │ ├── CV.java │ │ │ ├── ChromatogramIndex.java │ │ │ ├── ColumnIndex.java │ │ │ ├── ColumnInfo.java │ │ │ ├── Compressor.java │ │ │ ├── DDAMs.java │ │ │ ├── DDAPasefMs.java │ │ │ ├── DataProcessing.java │ │ │ ├── Instrument.java │ │ │ ├── Layers.java │ │ │ ├── MobiInfo.java │ │ │ ├── ParentFile.java │ │ │ ├── Software.java │ │ │ ├── WindowRange.java │ │ │ ├── common │ │ │ │ ├── AnyPair.java │ │ │ │ ├── AnyPairs.java │ │ │ │ ├── Column.java │ │ │ │ ├── Columns.java │ │ │ │ ├── CompressedPairs.java │ │ │ │ ├── DoublePair.java │ │ │ │ ├── DoublePairs.java │ │ │ │ ├── FloatPair.java │ │ │ │ ├── FloatPairs.java │ │ │ │ ├── IdName.java │ │ │ │ ├── IdNameAlias.java │ │ │ │ ├── IdNameType.java │ │ │ │ ├── IntPair.java │ │ │ │ ├── IntegerPair.java │ │ │ │ ├── MobiPoint.java │ │ │ │ ├── MobilityPoint.java │ │ │ │ ├── MrmPair.java │ │ │ │ ├── RawFileInfo.java │ │ │ │ ├── Spectrum.java │ │ │ │ ├── StrIntPairs.java │ │ │ │ └── Xic.java │ │ │ └── proto │ │ │ │ ├── AirdInfo.java │ │ │ │ ├── ColumnInfo.java │ │ │ │ └── WindowRange.java │ │ │ ├── compressor │ │ │ ├── ByteCompressor.java │ │ │ ├── ByteTrans.java │ │ │ ├── ComboComp.java │ │ │ ├── Delta.java │ │ │ ├── IntegratedXVByte.java │ │ │ ├── XDPD.java │ │ │ ├── XVByte.java │ │ │ ├── Xor.java │ │ │ ├── Zigzag.java │ │ │ ├── bytecomp │ │ │ │ ├── BrotliWrapper.java │ │ │ │ ├── ByteComp.java │ │ │ │ ├── SnappyWrapper.java │ │ │ │ ├── ZlibWrapper.java │ │ │ │ └── ZstdWrapper.java │ │ │ ├── intcomp │ │ │ │ ├── BinPackingWrapper.java │ │ │ │ ├── DeltaZigzagVBWrapper.java │ │ │ │ ├── Empty.java │ │ │ │ ├── IntComp.java │ │ │ │ └── VarByteWrapper.java │ │ │ └── sortedintcomp │ │ │ │ ├── DeltaWrapper.java │ │ │ │ ├── IntegratedBinPackingWrapper.java │ │ │ │ ├── IntegratedVarByteWrapper.java │ │ │ │ ├── SortIntEmptyWrapper.java │ │ │ │ └── SortedIntComp.java │ │ │ ├── constant │ │ │ ├── Features.java │ │ │ ├── PSI.java │ │ │ ├── SuffixConst.java │ │ │ └── SymbolConst.java │ │ │ ├── eic │ │ │ └── Extractor.java │ │ │ ├── enums │ │ │ ├── ActivationMethod.java │ │ │ ├── AirdEngine.java │ │ │ ├── AirdType.java │ │ │ ├── ByteCompType.java │ │ │ ├── IntCompType.java │ │ │ ├── IonizationMod.java │ │ │ ├── MsLevel.java │ │ │ ├── MsType.java │ │ │ ├── PolarityType.java │ │ │ ├── ResultCodeEnum.java │ │ │ └── SortedIntCompType.java │ │ │ ├── exception │ │ │ └── ScanException.java │ │ │ ├── opencl │ │ │ └── XIC.java │ │ │ ├── parser │ │ │ ├── BaseParser.java │ │ │ ├── ColumnParser.java │ │ │ ├── DDAParser.java │ │ │ ├── DDAPasefParser.java │ │ │ ├── DIAParser.java │ │ │ ├── DIAPasefParser.java │ │ │ ├── MRMParser.java │ │ │ └── PRMParser.java │ │ │ ├── sample │ │ │ ├── OpenCLQuery.java │ │ │ └── SampleCode.java │ │ │ ├── structure │ │ │ └── SortInt.java │ │ │ └── util │ │ │ ├── AirdMathUtil.java │ │ │ ├── AirdScanUtil.java │ │ │ ├── ArrayUtil.java │ │ │ ├── DDAUtil.java │ │ │ ├── DataUtil.java │ │ │ ├── FeatureUtil.java │ │ │ ├── FileSizeUtil.java │ │ │ ├── FileUtil.java │ │ │ ├── PrecisionUtil.java │ │ │ └── StackCompressUtil.java │ └── resources │ │ └── clkernel │ │ ├── XICKernel1.cpp │ │ ├── XICKernel10.cpp │ │ ├── XICKernel20.cpp │ │ ├── XICKernel5.cpp │ │ └── XICKernel50.cpp │ └── test │ ├── java │ └── net │ │ └── csibio │ │ └── aird │ │ ├── test │ │ ├── AirdV3Try │ │ │ ├── AirdV2TestPrepare.java │ │ │ ├── AirdV3Try.java │ │ │ ├── AirdV3Try2.java │ │ │ ├── AirdV3Try3.java │ │ │ ├── AirdV3Try4Int.java │ │ │ ├── AirdV3Try53D.java │ │ │ ├── Compressor │ │ │ │ ├── AdaptiveIntegerCompressor.java │ │ │ │ ├── CompressiveSensingCompressor.java │ │ │ │ ├── DeferencialEncodingIntegberCompressor.java │ │ │ │ ├── PredictiveIntegerCompressor.java │ │ │ │ ├── QuadraticPredictioinIntegerCompressor.java │ │ │ │ ├── SparseMatrixCompressor.java │ │ │ │ ├── VariableIntegerCompressor.java │ │ │ │ └── WaveCompressor.java │ │ │ ├── MS1DF.java │ │ │ └── MS1DFforIm.java │ │ ├── CompV3Test.java │ │ ├── DDAParserTest.java │ │ ├── DIAParserTest.java │ │ ├── DIAPasefParserTest.java │ │ ├── FastPForLearn.java │ │ ├── JOCLBandwidthTest.java │ │ ├── JOCLDeviceQuery.java │ │ ├── MRMTest.java │ │ ├── ReadMzML.java │ │ ├── SizeTest.java │ │ ├── StackZDPDTest.java │ │ ├── TestCompareLayers.java │ │ ├── TestLayers.java │ │ ├── TryForAirdV3.java │ │ ├── ZstdDictTest.java │ │ ├── airdslice │ │ │ ├── EChartsSeries.java │ │ │ ├── ReadAirdColumn.java │ │ │ ├── ReadAirdColumn1.java │ │ │ ├── ReadAirdColumn2.java │ │ │ ├── ReadAirdRow.java │ │ │ ├── ReadProtoIndex.java │ │ │ ├── TestForDDA.java │ │ │ └── XicSpeed.js │ │ ├── compare │ │ │ ├── CsvUtil.java │ │ │ ├── MzCompare.java │ │ │ └── Peak.java │ │ ├── compressor │ │ │ ├── DeltaTest.java │ │ │ ├── DiffXDPDTest.java │ │ │ ├── FastPFORTest.java │ │ │ ├── NewTry2.java │ │ │ ├── XorTest.java │ │ │ ├── intensity不同压缩器的压缩率与时间比较.java │ │ │ ├── mz不同压缩器的压缩率与时间比较.java │ │ │ ├── 测试Intensity合并后大大小.java │ │ │ ├── 测试MRMParser.java │ │ │ ├── 解压缩时间.java │ │ │ └── 解压缩时间测试.java │ │ ├── datamodel │ │ │ └── MobilityType.java │ │ ├── mzml │ │ │ ├── MzMLFileExportMethod.java │ │ │ ├── MzMLFileImportMethod.java │ │ │ ├── data │ │ │ │ ├── MzMLArrayType.java │ │ │ │ ├── MzMLBinaryDataInfo.java │ │ │ │ ├── MzMLBitLength.java │ │ │ │ ├── MzMLCV.java │ │ │ │ ├── MzMLCVGroup.java │ │ │ │ ├── MzMLCVParam.java │ │ │ │ ├── MzMLChromatogram.java │ │ │ │ ├── MzMLCompressionType.java │ │ │ │ ├── MzMLIsolationWindow.java │ │ │ │ ├── MzMLMobility.java │ │ │ │ ├── MzMLMsScan.java │ │ │ │ ├── MzMLParser.java │ │ │ │ ├── MzMLPeaksDecoder.java │ │ │ │ ├── MzMLPeaksEncoder.java │ │ │ │ ├── MzMLPrecursorActivation.java │ │ │ │ ├── MzMLPrecursorElement.java │ │ │ │ ├── MzMLPrecursorList.java │ │ │ │ ├── MzMLPrecursorSelectedIon.java │ │ │ │ ├── MzMLPrecursorSelectedIonList.java │ │ │ │ ├── MzMLProduct.java │ │ │ │ ├── MzMLProductList.java │ │ │ │ ├── MzMLRawDataFile.java │ │ │ │ ├── MzMLReferenceableParamGroup.java │ │ │ │ ├── MzMLScan.java │ │ │ │ ├── MzMLScanList.java │ │ │ │ ├── MzMLScanWindow.java │ │ │ │ ├── MzMLScanWindowList.java │ │ │ │ └── MzMLTags.java │ │ │ └── util │ │ │ │ ├── ByteBufferInputStream.java │ │ │ │ ├── FileMemoryMapper.java │ │ │ │ ├── MSNumpress.java │ │ │ │ └── TagTracker.java │ │ ├── sliceV2 │ │ │ └── TestSliceV2.java │ │ ├── thermo │ │ │ └── RawFileReader.java │ │ ├── util │ │ │ ├── AirdScanUtilTest.java │ │ │ ├── StackCompressUtilTest.java │ │ │ ├── StreamCopy.java │ │ │ └── ZipUtils.java │ │ └── xixi │ │ │ └── MainTest.java │ │ └── testutil │ │ └── FileSizeStatisticUtil.java │ └── resources │ └── library.test.json ├── PyAirdSDK ├── .gitignore ├── Beans │ ├── AirdInfo.py │ ├── BlockIndex.py │ ├── CV.py │ ├── Common │ │ ├── Spectrum.py │ │ ├── Xic.py │ │ └── __init__.py │ ├── Compressor.py │ ├── DDAMs.py │ ├── DDAPasefMs.py │ ├── DataProcessing.py │ ├── Instrument.py │ ├── Layers.py │ ├── MobiInfo.py │ ├── ParentFile.py │ ├── Software.py │ ├── WindowRange.py │ └── __init__.py ├── Compressor │ ├── ByteComp │ │ ├── BrotliWrapper.py │ │ ├── SnappyWrapper.py │ │ ├── ZlibWrapper.py │ │ ├── ZstdWrapper.py │ │ └── __init__.py │ ├── ByteTrans.py │ ├── Delta.py │ ├── IntComp │ │ ├── BinPackingWrapper.py │ │ ├── EmptyWrapper.py │ │ ├── VarByteWrapper.py │ │ └── __init__.py │ ├── IntCompressor.py │ ├── IntegratedIntCompressor.py │ ├── SortedIntComp │ │ ├── DeltaWrapper.py │ │ ├── IntegratedBinPackingWrapper.py │ │ ├── IntegratedVarByteWrapper.py │ │ └── __init__.py │ └── __init__.py ├── Constants │ ├── Features.py │ ├── PSI.py │ ├── SuffixConst.py │ ├── SymbolConst.py │ └── __init__.py ├── Enums │ ├── AirdType.py │ ├── ByteCompType.py │ ├── DataDim.py │ ├── IntCompType.py │ ├── MsLevel.py │ ├── SortedIntCompType.py │ └── __init__.py ├── Parser │ ├── BaseParser.py │ ├── DDAParser.py │ ├── DIAParser.py │ ├── PRMParser.py │ └── __init__.py ├── Utils │ ├── AirdScanUtil.py │ ├── DDAUtil.py │ └── __init__.py ├── __init__.py ├── main.py └── setup.py └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # Package Files # 14 | *.jar 15 | *.war 16 | *.nar 17 | *.ear 18 | *.zip 19 | *.tar.gz 20 | *.rar 21 | 22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 23 | hs_err_pid* 24 | /aird.iml 25 | /.idea 26 | */.idea 27 | 28 | # visual studio 29 | */.vs 30 | */obj 31 | *.pyc 32 | /*.iml 33 | /target/ 34 | -------------------------------------------------------------------------------- /CSharpSDK/.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | /.vs 3 | /bin 4 | /obj 5 | -------------------------------------------------------------------------------- /CSharpSDK/AirdProLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSi-Studio/Aird-SDK/5ceb09523ecc756427a2c5d682786ebd617f4432/CSharpSDK/AirdProLogo.png -------------------------------------------------------------------------------- /CSharpSDK/AirdSDK - Backup.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Library 5 | netstandard2.0 6 | True 7 | AirdSDK 8 | 2.2.0 9 | CSi_Studio 10 | LuMiaoShan 11 | Aird SDK for C# 12 | AirdSDK 13 | AirdProLogo.png 14 | True 15 | LICENSE 16 | 17 | 18 | 19 | latest 20 | 21 | 22 | 23 | latest 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | True 41 | \ 42 | 43 | 44 | True 45 | \ 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /CSharpSDK/AirdSDK.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.3.32825.248 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AirdSDK", "AirdSDK.csproj", "{3DE8147E-4490-4782-B5E1-723132FB88A5}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {3DE8147E-4490-4782-B5E1-723132FB88A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {3DE8147E-4490-4782-B5E1-723132FB88A5}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {3DE8147E-4490-4782-B5E1-723132FB88A5}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {3DE8147E-4490-4782-B5E1-723132FB88A5}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {C2A3872D-19CB-4903-9DAB-24A01BE1D5FE} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /CSharpSDK/Bean/ColumnInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace AirdSDK.Beans; 5 | 6 | public class ColumnInfo 7 | { 8 | public List indexList = new(); 9 | 10 | /** 11 | * [Core Field] 12 | * AcquisitionMethod, Support for DIA/SWATH, PRM, DDA, SRM/MRM, DDAPasef, DIAPasef 13 | * [核心字段] 14 | * Aird支持的采集模式的类型,目前支持SRM/MRM, DIA, PRM, DDA, DDAPasef, DIAPasef 6种 15 | */ 16 | public string type; 17 | 18 | /** 19 | * the aird file path. 20 | * 转换压缩后的aird二进制文件路径,默认读取同目录下的同名文件,如果不存在才去读本字段对应的路径 21 | */ 22 | public string airdPath; 23 | 24 | public int mzPrecision; 25 | 26 | public int intPrecision; 27 | 28 | public ColumnInfoProto ToProto() 29 | { 30 | ColumnInfoProto proto = new ColumnInfoProto(); 31 | foreach (ColumnIndex columnIndex in indexList) 32 | { 33 | proto.IndexList.Add(columnIndex.ToProto()); 34 | } 35 | 36 | proto.Type = this.type; 37 | proto.AirdPath = this.airdPath; 38 | proto.MzPrecision = this.mzPrecision; 39 | proto.IntPrecision = this.intPrecision; 40 | return proto; 41 | } 42 | 43 | public static ColumnInfo FromProto(ColumnInfoProto proto) 44 | { 45 | if (proto == null) 46 | throw new ArgumentNullException(nameof(proto)); 47 | 48 | var columnInfo = new ColumnInfo 49 | { 50 | type = proto.Type, 51 | airdPath = proto.AirdPath, 52 | mzPrecision = proto.MzPrecision, 53 | intPrecision = proto.IntPrecision 54 | }; 55 | 56 | foreach (var indexProto in proto.IndexList) 57 | { 58 | columnInfo.indexList.Add(ColumnIndex.FromProto(indexProto)); 59 | } 60 | 61 | return columnInfo; 62 | } 63 | } -------------------------------------------------------------------------------- /CSharpSDK/Bean/Common/ByteColumn.cs: -------------------------------------------------------------------------------- 1 | namespace AirdSDK.Beans.Common; 2 | 3 | public class ByteColumn 4 | { 5 | public byte[] spectraIds; 6 | public byte[] intensities; 7 | 8 | public ByteColumn(byte[] spectraIds, byte[] intensities) 9 | { 10 | this.spectraIds = spectraIds; 11 | this.intensities = intensities; 12 | } 13 | } -------------------------------------------------------------------------------- /CSharpSDK/Bean/Common/IntPair.cs: -------------------------------------------------------------------------------- 1 | namespace AirdSDK.Beans.Common; 2 | 3 | public class IntPair 4 | { 5 | public int left; 6 | public int right; 7 | 8 | public IntPair(int left, int right) 9 | { 10 | this.left = left; 11 | this.right = right; 12 | } 13 | } -------------------------------------------------------------------------------- /CSharpSDK/Bean/Common/IntSpectrum.cs: -------------------------------------------------------------------------------- 1 | namespace AirdSDK.Beans.Common; 2 | 3 | public class IntSpectrum 4 | { 5 | public int[] mzs; 6 | public double[] intensities; 7 | 8 | public IntSpectrum(int[] mzs, double[] intensities) 9 | { 10 | this.mzs = mzs; 11 | this.intensities = intensities; 12 | } 13 | } -------------------------------------------------------------------------------- /CSharpSDK/Bean/Common/MrmPair.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace AirdSDK.Beans.Common 5 | { 6 | public class MrmPair 7 | { 8 | 9 | /** 10 | * order number for current spectrum 11 | */ 12 | public int num; 13 | 14 | public string id; 15 | 16 | public string key; 17 | 18 | public WindowRange precursor; 19 | public WindowRange product; 20 | 21 | public string polarity; 22 | 23 | public string activator; 24 | 25 | public float energy; 26 | 27 | public double[] rts; 28 | public double[] ints; 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /CSharpSDK/Bean/Common/Spectrum.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | namespace AirdSDK.Beans.Common; 12 | 13 | public class Spectrum 14 | { 15 | public double[] mzs; 16 | public double[] ints; 17 | public double[] mobilities; 18 | 19 | public Spectrum(double[] mzs, double[] ints) 20 | { 21 | this.mzs = mzs; 22 | this.ints = ints; 23 | } 24 | 25 | public Spectrum(double[] mzs, double[] ints, double[] mobilities) 26 | { 27 | this.mzs = mzs; 28 | this.ints = ints; 29 | this.mobilities = mobilities; 30 | } 31 | } -------------------------------------------------------------------------------- /CSharpSDK/Bean/Common/Xic.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | namespace AirdSDK.Beans.Common; 12 | 13 | public class Xic 14 | { 15 | public double[] rts; 16 | public double[] ints; 17 | public double[] mzs; 18 | 19 | public Xic() 20 | { 21 | } 22 | 23 | public Xic(double[] rts, double[] ints, double[] mzs) 24 | { 25 | this.rts = rts; 26 | this.ints = ints; 27 | this.mzs = mzs; 28 | } 29 | 30 | public Xic(double[] rts, double[] ints) 31 | { 32 | this.rts = rts; 33 | this.ints = ints; 34 | } 35 | } -------------------------------------------------------------------------------- /CSharpSDK/Bean/DataProcessing.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | using System; 12 | using System.Collections.Generic; 13 | using System.Linq; 14 | 15 | namespace AirdSDK.Beans 16 | { 17 | /** 18 | * Description of any manipulation (from the first conversion to aird format until the creation of the current aird instance document) applied to the data. 19 | */ 20 | public class DataProcessing 21 | { 22 | /** 23 | * Any additional manipulation not included elsewhere in the dataProcessing element. 24 | */ 25 | List processingOperations = new(); 26 | 27 | public DataProcessingProto ToProto() 28 | { 29 | DataProcessingProto proto = new DataProcessingProto(); 30 | if (processingOperations != null) 31 | { 32 | processingOperations = new List(); 33 | processingOperations.AddRange(processingOperations); 34 | } 35 | return proto; 36 | } 37 | 38 | public static DataProcessing FromProto(DataProcessingProto proto) 39 | { 40 | if (proto == null) 41 | throw new ArgumentNullException(nameof(proto)); 42 | 43 | DataProcessing dataProcessing = new DataProcessing() 44 | { 45 | processingOperations = proto.ProcessingOperations.ToList() 46 | }; 47 | 48 | return dataProcessing; 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /CSharpSDK/Bean/Features.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | namespace AirdSDK.Beans 12 | { 13 | public class Features 14 | { 15 | //原始文件中前体的窗口大小,未经过overlap参数调整,precursor mz 16 | public static string original_width = "owid"; 17 | 18 | //原始文件中前体的荷质比窗口开始位置,未经过overlap参数调整,precursor mz 19 | public static string original_precursor_mz_start = "oMzStart"; 20 | 21 | //原始文件中前体的荷质比窗口结束位置,未经过overlap参数调整,precursor mz 22 | public static string original_precursor_mz_end = "oMzEnd"; 23 | 24 | //从Vendor文件中得到的msd.id 25 | public static string raw_id = "rawId"; 26 | 27 | //是否忽略Intensity为0的键值对,默认为true 28 | public static string ignore_zero_intensity = "ignoreZeroIntensity"; 29 | 30 | //SWATH的各个窗口间的重叠部分 31 | public static string overlap = "overlap"; 32 | 33 | //源文件数据格式 34 | public static string source_file_format = "sourceFileFormat"; 35 | 36 | //Aird文件版本码 37 | public static string aird_version = "aird_version"; 38 | 39 | //进行zlib压缩时使用的byteOrder编码,C#默认使用的是LITTLE_ENDIAN 40 | public static string byte_order = "byte_order"; 41 | 42 | //使用的Aird核心压缩算法,有ZDPD, StackZDPD两种 43 | public static string aird_algorithm = "aird_algorithm"; 44 | } 45 | } -------------------------------------------------------------------------------- /CSharpSDK/Bean/Layers.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | namespace AirdSDK.Beans 12 | { 13 | public class Layers 14 | { 15 | /** 16 | * 使用fastPfor算法压缩以后的mz数组 17 | * compressed mz array with fastPfor 18 | */ 19 | public byte[] mzArray; 20 | 21 | /** 22 | * mz对应的层索引 23 | * layer index of mz 24 | */ 25 | public byte[] tagArray; 26 | 27 | /** 28 | * 存储单个索引所需的位数 29 | * storage digits occupied by an index 30 | */ 31 | public int digit; 32 | 33 | public Layers() 34 | { 35 | } 36 | 37 | public Layers(byte[] mzArray, byte[] tagArray, int digit) 38 | { 39 | this.mzArray = mzArray; 40 | this.tagArray = tagArray; 41 | this.digit = digit; 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /CSharpSDK/Bean/Proto/ColumnInfo.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import "WindowRange.proto"; 3 | 4 | message ColumnInfoProto { 5 | repeated ColumnIndexProto indexList = 1; 6 | string type = 2; 7 | string airdPath = 3; 8 | int32 mzPrecision = 4; 9 | int32 intPrecision = 5; 10 | } 11 | 12 | message ColumnIndexProto { 13 | int32 level = 1; 14 | int64 startPtr = 2; 15 | int64 endPtr = 3; 16 | WindowRangeProto range = 4; 17 | int64 startMzListPtr = 5; 18 | int64 endMzListPtr = 6; 19 | int64 startRtListPtr = 7; 20 | int64 endRtListPtr = 8; 21 | int64 startSpectraIdListPtr = 9; 22 | int64 endSpectraIdListPtr = 10; 23 | int64 startIntensityListPtr = 11; 24 | int64 endIntensityListPtr = 12; 25 | repeated int32 mzs = 13; 26 | repeated int32 rts = 14; 27 | repeated int32 spectraIds = 15; 28 | repeated int32 intensities = 16; 29 | repeated int64 anchors = 17; 30 | } -------------------------------------------------------------------------------- /CSharpSDK/Bean/Proto/WindowRange.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | message WindowRangeProto { 4 | double start = 1; // 窗口开始位置 5 | double end = 2; // 窗口结束位置 6 | double mz = 3; // 荷质比 7 | int32 charge = 4; // 带电量,使用默认值 -1 表示未知 8 | string features = 5; // 特征信息 9 | } -------------------------------------------------------------------------------- /CSharpSDK/Bean/Software.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | using System; 12 | 13 | namespace AirdSDK.Beans 14 | { 15 | public class Software 16 | { 17 | //软件名称 18 | public string name; 19 | 20 | 21 | public string type = "acquisition"; 22 | 23 | //软件版本号 24 | public string version; 25 | 26 | public SoftwareProto ToProto() 27 | { 28 | SoftwareProto proto = new SoftwareProto(); 29 | 30 | if (name != null) 31 | { 32 | proto.Name = name; 33 | } 34 | if (type != null) 35 | { 36 | proto.Type = type; 37 | } 38 | if (version != null) 39 | { 40 | proto.Version = version; 41 | } 42 | return proto; 43 | } 44 | 45 | // 静态方法,用于从protobuf对象转换 46 | public static Software FromProto(SoftwareProto proto) 47 | { 48 | if (proto == null) 49 | throw new ArgumentNullException(nameof(proto)); 50 | 51 | return new Software 52 | { 53 | name = proto.Name, 54 | type = proto.Type, 55 | version = proto.Version 56 | }; 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /CSharpSDK/Compressor/BaseComp.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | namespace AirdSDK.Compressor; 12 | 13 | public abstract class BaseComp 14 | { 15 | public abstract string getName(); 16 | public abstract T[] encode(T[] uncompressed); 17 | public abstract T[] decode(T[] compressed); 18 | } -------------------------------------------------------------------------------- /CSharpSDK/Compressor/ByteComp/BrotliWrapper.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | using AirdSDK.Enums; 12 | using BrotliSharpLib; 13 | 14 | namespace AirdSDK.Compressor 15 | { 16 | public class BrotliWrapper : ByteComp 17 | { 18 | public override string getName() 19 | { 20 | return ByteCompType.Brotli.ToString(); 21 | } 22 | 23 | public override byte[] encode(byte[] data) 24 | { 25 | // byte[] compressed = Brotli.CompressBuffer(data, 0, data.Length, 3, -1, null); 26 | byte[] compressed = Brotli.CompressBuffer(data, 0, data.Length); 27 | return compressed; 28 | } 29 | 30 | public override byte[] decode(byte[] data) 31 | { 32 | byte[] uncompressed = Brotli.DecompressBuffer(data, 0, data.Length); 33 | return uncompressed; 34 | } 35 | 36 | public override byte[] decode(byte[] input, int offset, int length) 37 | { 38 | byte[] uncompressed = Brotli.DecompressBuffer(input, offset, length); 39 | return uncompressed; 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /CSharpSDK/Compressor/ByteComp/ByteComp.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | using System; 12 | using AirdSDK.Enums; 13 | 14 | namespace AirdSDK.Compressor 15 | { 16 | public abstract class ByteComp : BaseComp 17 | { 18 | public static ByteComp build(ByteCompType type) 19 | { 20 | switch (type) 21 | { 22 | case ByteCompType.Brotli: 23 | return new BrotliWrapper(); 24 | case ByteCompType.Snappy: 25 | return new SnappyWrapper(); 26 | case ByteCompType.Zstd: 27 | return new ZstdWrapper(); 28 | case ByteCompType.Zlib: 29 | return new ZlibWrapper(); 30 | default: throw new System.Exception("No Implementation for " + type); 31 | } 32 | } 33 | 34 | public static ByteCompType getType(string type) 35 | { 36 | switch (type) 37 | { 38 | case "Brotli": 39 | return ByteCompType.Brotli; 40 | case "Snappy": 41 | return ByteCompType.Snappy; 42 | case "Zstd": 43 | return ByteCompType.Zstd; 44 | case "Zlib": 45 | return ByteCompType.Zlib; 46 | default: throw new System.Exception("No Implementation for " + type); 47 | } 48 | } 49 | 50 | public abstract byte[] decode(byte[] input, int offset, int length); 51 | } 52 | } -------------------------------------------------------------------------------- /CSharpSDK/Compressor/ByteComp/SnappyWrapper.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | using AirdSDK.Enums; 12 | using IronSnappy; 13 | using System; 14 | 15 | namespace AirdSDK.Compressor 16 | { 17 | public class SnappyWrapper : ByteComp 18 | { 19 | //使用zstd将byte数组压缩 20 | public override string getName() 21 | { 22 | return ByteCompType.Snappy.ToString(); 23 | } 24 | 25 | public override byte[] encode(byte[] data) 26 | { 27 | byte[] compressed = Snappy.Encode(data); 28 | return compressed; 29 | } 30 | 31 | public override byte[] decode(byte[] data) 32 | { 33 | byte[] uncompressed = Snappy.Decode(data); 34 | return uncompressed; 35 | } 36 | 37 | public override byte[] decode(byte[] input, int offset, int length) 38 | { 39 | byte[] result = new byte[length]; 40 | Array.Copy(input, offset, result, 0, length); 41 | byte[] uncompressed = Snappy.Decode(result); 42 | return uncompressed; 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /CSharpSDK/Compressor/ByteComp/ZstdWrapper.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | using AirdSDK.Enums; 12 | using System; 13 | using ZstdNet; 14 | 15 | namespace AirdSDK.Compressor 16 | { 17 | public class ZstdWrapper : ByteComp 18 | { 19 | //使用zstd将byte数组压缩 20 | public override string getName() 21 | { 22 | return ByteCompType.Zstd.ToString(); 23 | } 24 | 25 | public override byte[] encode(byte[] data) 26 | { 27 | var compressor = new ZstdNet.Compressor(); 28 | var compressedData = compressor.Wrap(data); 29 | return compressedData; 30 | } 31 | 32 | public override byte[] decode(byte[] data) 33 | { 34 | var decompressor = new Decompressor(); 35 | var decompressedData = decompressor.Unwrap(data); 36 | return decompressedData; 37 | } 38 | 39 | public override byte[] decode(byte[] input, int offset, int length) 40 | { 41 | byte[] result = new byte[length]; 42 | Array.Copy(input, offset, result, 0, length); 43 | 44 | var decompressor = new Decompressor(); 45 | var uncompressed = decompressor.Unwrap(result); 46 | 47 | return uncompressed; 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /CSharpSDK/Compressor/HuffmanCode/Node.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | namespace AirdSDK.Compressor 12 | { 13 | public class Node 14 | { 15 | public HuffmanTree data; 16 | public Node link; 17 | 18 | public Node(HuffmanTree newData) 19 | { 20 | data = newData; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /CSharpSDK/Compressor/IntComp/BinPackingWrapper.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | using AirdSDK.Enums; 12 | using CSharpFastPFOR; 13 | 14 | namespace AirdSDK.Compressor 15 | { 16 | public class BinPackingWrapper : IntComp 17 | { 18 | //使用BinaryPacking算法将未排序的int数组进行压缩 19 | public override string getName() 20 | { 21 | return IntCompType.BP.ToString(); 22 | } 23 | 24 | public override int[] encode(int[] uncompressed) 25 | { 26 | int[] compressedInts = new IntCompressor().compress(uncompressed); 27 | return compressedInts; 28 | } 29 | 30 | //使用BinaryPacking算法对已经压缩的int数组进行解压缩 31 | public override int[] decode(int[] compressed) 32 | { 33 | int[] sortedInts = new IntCompressor().uncompress(compressed); 34 | return sortedInts; 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /CSharpSDK/Compressor/IntComp/DeltaZigzagVBWrapper.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | using AirdSDK.Enums; 12 | using CSharpFastPFOR; 13 | using CSharpFastPFOR.Port; 14 | 15 | namespace AirdSDK.Compressor 16 | { 17 | public class DeltaZigzagVBWrapper : IntComp 18 | { 19 | public override string getName() 20 | { 21 | return IntCompType.DZVB.ToString(); 22 | } 23 | 24 | public override int[] encode(int[] uncompressed) 25 | { 26 | IntegerCODEC codec = new DeltaZigzagVariableByte(); 27 | int[] compressed = new int[uncompressed.Length + uncompressed.Length / 100 + 1024];// could need more 28 | IntWrapper outputoffset = new IntWrapper(1); 29 | codec.compress(uncompressed, new IntWrapper(0), uncompressed.Length, compressed, outputoffset); 30 | compressed = Arrays.copyOf(compressed, outputoffset.intValue()); 31 | compressed[0] = uncompressed.Length; 32 | return compressed; 33 | } 34 | 35 | public override int[] decode(int[] compressed) 36 | { 37 | if (compressed.Length == 0) { 38 | return new int[0]; 39 | } 40 | IntegerCODEC codec = new DeltaZigzagVariableByte(); 41 | int[] decompressed = new int[compressed[0]]; 42 | codec.uncompress(compressed, new IntWrapper(1), compressed.Length - 1, decompressed, new IntWrapper(0)); 43 | return decompressed; 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /CSharpSDK/Compressor/IntComp/Empty.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | using AirdSDK.Enums; 12 | 13 | namespace AirdSDK.Compressor 14 | { 15 | public class Empty : IntComp 16 | { 17 | public override string getName() 18 | { 19 | return IntCompType.Empty.ToString(); 20 | } 21 | 22 | public override int[] encode(int[] uncompressed) 23 | { 24 | return uncompressed; 25 | } 26 | 27 | public override int[] decode(int[] compressed) 28 | { 29 | return compressed; 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /CSharpSDK/Compressor/IntComp/IntComp.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | using AirdSDK.Enums; 12 | 13 | namespace AirdSDK.Compressor 14 | { 15 | public abstract class IntComp : BaseComp 16 | { 17 | public static IntComp build(IntCompType type) 18 | { 19 | switch (type) 20 | { 21 | case IntCompType.VB: 22 | return new VarByteWrapper(); 23 | case IntCompType.BP: 24 | return new BinPackingWrapper(); 25 | case IntCompType.DZVB: 26 | return new DeltaZigzagVBWrapper(); 27 | case IntCompType.Empty: 28 | return new Empty(); 29 | default: throw new System.Exception("No Implementation for " + type); 30 | } 31 | } 32 | 33 | public static IntCompType getType(string type) 34 | { 35 | switch (type) 36 | { 37 | case "VB": 38 | return IntCompType.VB; 39 | case "BP": 40 | return IntCompType.BP; 41 | case "DZVB": 42 | return IntCompType.DZVB; 43 | case "Empty": 44 | return IntCompType.Empty; 45 | default: throw new System.Exception("No Implementation for " + type); 46 | } 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /CSharpSDK/Compressor/IntComp/VarByteWrapper.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | using AirdSDK.Enums; 12 | using CSharpFastPFOR; 13 | 14 | namespace AirdSDK.Compressor 15 | { 16 | public class VarByteWrapper : IntComp 17 | { 18 | //使用VariableByte算法将未排序的int数组进行压缩 19 | public override string getName() 20 | { 21 | return IntCompType.VB.ToString(); 22 | } 23 | 24 | public override int[] encode(int[] uncompressed) 25 | { 26 | int[] intValues = new IntCompressor(new VariableByte()).compress(uncompressed); 27 | return intValues; 28 | } 29 | 30 | //使用VariableByte算法对已经压缩的int数组进行解压缩 31 | public override int[] decode(int[] compressed) 32 | { 33 | int[] intValues = new IntCompressor(new VariableByte()).uncompress(compressed); 34 | return intValues; 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /CSharpSDK/Compressor/SortedIntComp/DeltaWrapper.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | using AirdSDK.Enums; 12 | 13 | namespace AirdSDK.Compressor 14 | { 15 | public class DeltaWrapper : SortedIntComp 16 | { 17 | //使用VariableByte算法将排序了的int数组进行压缩 18 | public override string getName() 19 | { 20 | return SortedIntCompType.Delta.ToString(); 21 | } 22 | 23 | public override int[] encode(int[] uncompressed) 24 | { 25 | int[] compressed = Delta.delta(uncompressed); 26 | return compressed; 27 | } 28 | 29 | //使用VariableByte算法对已经压缩的int数组进行解压缩 30 | public override int[] decode(int[] compressed) 31 | { 32 | int[] uncompressed = Delta.recover(compressed); 33 | return uncompressed; 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /CSharpSDK/Compressor/SortedIntComp/IntegratedBinPackingWrapper.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | using AirdSDK.Enums; 12 | using CSharpFastPFOR.Differential; 13 | 14 | namespace AirdSDK.Compressor 15 | { 16 | public class IntegratedBinPackingWrapper : SortedIntComp 17 | { 18 | //使用FastPfor算法将排序了的int数组进行压缩,注意:target数组必须是排序后的数组 19 | public override string getName() 20 | { 21 | return SortedIntCompType.IBP.ToString(); 22 | } 23 | 24 | public override int[] encode(int[] uncompressed) 25 | { 26 | int[] compressed = new IntegratedIntCompressor().compress(uncompressed); 27 | return compressed; 28 | } 29 | 30 | //使用PFor算法对已经压缩的int数组进行解压缩 31 | public override int[] decode(int[] compressed) 32 | { 33 | int[] uncompressed = new IntegratedIntCompressor().uncompress(compressed); 34 | return uncompressed; 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /CSharpSDK/Compressor/SortedIntComp/IntegratedVarByteWrapper.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | using AirdSDK.Enums; 12 | using CSharpFastPFOR.Differential; 13 | 14 | namespace AirdSDK.Compressor 15 | { 16 | public class IntegratedVarByteWrapper : SortedIntComp 17 | { 18 | //使用VariableByte算法将排序了的int数组进行压缩 19 | public override string getName() 20 | { 21 | return SortedIntCompType.IVB.ToString(); 22 | } 23 | 24 | public override int[] encode(int[] uncompressed) 25 | { 26 | int[] compressed = new IntegratedIntCompressor(new IntegratedVariableByte()).compress(uncompressed); 27 | return compressed; 28 | } 29 | 30 | //使用VariableByte算法对已经压缩的int数组进行解压缩 31 | public override int[] decode(int[] compressed) 32 | { 33 | int[] uncompressed = new IntegratedIntCompressor(new IntegratedVariableByte()).uncompress(compressed); 34 | return uncompressed; 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /CSharpSDK/Compressor/Xor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | namespace AirdSDK.Compressor; 12 | 13 | public class Xor 14 | { 15 | /** 16 | * Apply differential coding (in-place). 17 | * 18 | * @param data data to be modified 19 | */ 20 | public static int[] xor(int[] data) 21 | { 22 | int[] res = new int[data.Length]; 23 | for (int i = data.Length - 1; i > 0; --i) 24 | { 25 | res[i] = data[i] ^ data[i - 1]; 26 | } 27 | 28 | res[0] = data[0]; 29 | return res; 30 | } 31 | 32 | /** 33 | * Undo differential coding (in-place). Effectively computes a prefix sum. 34 | * 35 | * @param data to be modified. 36 | */ 37 | public static int[] recover(int[] data) 38 | { 39 | int[] res = new int[data.Length]; 40 | res[0] = data[0]; 41 | for (int i = 1; i < data.Length; ++i) 42 | { 43 | res[i] = data[i] - data[i - 1]; 44 | } 45 | 46 | return res; 47 | } 48 | } -------------------------------------------------------------------------------- /CSharpSDK/Constants/Features.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | using System; 12 | 13 | namespace AirdSDK.Constants; 14 | 15 | public class Features 16 | { 17 | /** 18 | * 原始文件中前体的窗口大小,未经过overlap参数调整,precursor mz The precursor width in the vendor file, which is not 19 | * fixed by overlap 20 | */ 21 | public static String original_width = "owid"; 22 | 23 | /** 24 | * 原始文件中前体的荷质比窗口开始位置,未经过overlap参数调整,precursor mz The precursor mz start in the vendor file, which 25 | * is not fixed by overlap 26 | */ 27 | public static String original_precursor_mz_start = "oMzStart"; 28 | 29 | /** 30 | * 原始文件中前体的荷质比窗口结束位置,未经过overlap参数调整,precursor mz The precursor mz end in the vendor file, which is 31 | * not fixed by overlap 32 | */ 33 | public static String original_precursor_mz_end = "oMzEnd"; 34 | 35 | /** 36 | * 从Vendor文件中得到的msd.id msd.id from the vendor file 37 | */ 38 | public static String raw_id = "rawId"; 39 | 40 | /** 41 | * 是否忽略Intensity为0的键值对,默认为true If ignore the zero intensity pairs 42 | */ 43 | public static String ignore_zero_intensity = "ignoreZeroIntensity"; 44 | 45 | /** 46 | * SWATH的各个窗口间的重叠部分 the overlap between adjacent swath windows 47 | */ 48 | public static String overlap = "overlap"; 49 | 50 | /** 51 | * irt所得斜率 the slope value by IRT algorithm 52 | */ 53 | public static String slope = "slope"; 54 | 55 | /** 56 | * irt所得截距 the intercept value by IRT algorithm 57 | */ 58 | public static String intercept = "intercept"; 59 | } -------------------------------------------------------------------------------- /CSharpSDK/Constants/SuffixConst.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | using System; 12 | 13 | namespace AirdSDK.Constants; 14 | 15 | public class SuffixConst 16 | { 17 | public static string JSON = ".json"; 18 | public static string INDEX = ".index"; 19 | public static string CJSON = ".cjson"; 20 | public static string CINDEX = ".cindex"; 21 | public static string AIRD = ".aird"; 22 | public static string MZXML = ".mzxml"; 23 | public static string MZML = ".mzml"; 24 | public static string RAW = ".raw"; 25 | public static string WIFF = ".wiff"; 26 | public static string SCAN = ".scan"; 27 | public static string D = ".d"; 28 | } -------------------------------------------------------------------------------- /CSharpSDK/Constants/SymbolConst.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | namespace AirdSDK.Constants; 12 | 13 | public class SymbolConst 14 | { 15 | public const string COMMA = ","; 16 | public const string TAB = "\t"; 17 | public const string RETURN = "\r"; 18 | public const string DOT = "."; 19 | public const string DELIMITER = "-"; 20 | public const string BAR = "|"; 21 | public const string SPACE = " "; 22 | public const string AMPERSAND = "&"; 23 | public const string ASTERISK = "*"; 24 | public const string AT = "@"; 25 | public const string BACKSLASH = "\\"; 26 | public const string COLON = ":"; 27 | public const string DOLLAR = "$"; 28 | public const string DOUBLEQUOTE = "\""; 29 | public const string EQUAL = "="; 30 | public const string EXCLAMATION = "!"; 31 | public const string HASH = "#"; 32 | public const string HYPHEN = "-"; 33 | public const string PERCENT = "%"; 34 | public const string PLUS = "+"; 35 | public const string QUESTION = "?"; 36 | public const string SINGLEQUOTE = "'"; 37 | public const string SLASH = "/"; 38 | public const string TILDE = "~"; 39 | public const string UNDERSCORE = "_"; 40 | } -------------------------------------------------------------------------------- /CSharpSDK/Enums/AcquisitionMethod.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | namespace AirdSDK.Enums 12 | { 13 | public static class AcquisitionMethod 14 | { 15 | public const string DIA_PASEF = "DIA_PASEF"; 16 | public const string DDA_PASEF = "DDA_PASEF"; 17 | public const string PRM_PASEF = "PRM_PASEF"; 18 | public const string DIA = "DIA"; // Precursor-mz -> MS2 Group 19 | public const string PRM = "PRM"; // Precursor-mz -> MS2 Group 20 | public const string SCANNING_SWATH = "SCANNING_SWATH"; // 暂未支持 21 | public const string DDA = "DDA"; // MS1 -> MS2 Group 22 | public const string MRM = "MRM"; // Chromatogram 23 | } 24 | } -------------------------------------------------------------------------------- /CSharpSDK/Enums/AirdEngine.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | namespace AirdSDK.Enums 12 | { 13 | public enum AirdEngine 14 | { 15 | RowCompression = 0, 16 | ColumnCompression = 1 17 | } 18 | } -------------------------------------------------------------------------------- /CSharpSDK/Enums/AirdType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | using System; 12 | 13 | namespace AirdSDK.Enums 14 | { 15 | [Obsolete("use AcquisitionMethod instead")] 16 | public static class AirdType 17 | { 18 | public const string DIA_PASEF = "DIA_PASEF"; 19 | public const string DDA_PASEF = "DDA_PASEF"; 20 | public const string PRM_PASEF = "PRM_PASEF"; 21 | public const string DIA = "DIA"; // Precursor-mz -> MS2 Group 22 | public const string PRM = "PRM"; // Precursor-mz -> MS2 Group 23 | public const string SCANNING_SWATH = "SCANNING_SWATH"; // 暂未支持 24 | public const string DDA = "DDA"; // MS1 -> MS2 Group 25 | public const string SRM = "SRM"; // Chromatogram 26 | } 27 | } -------------------------------------------------------------------------------- /CSharpSDK/Enums/ByteCompType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | namespace AirdSDK.Enums 12 | { 13 | public enum ByteCompType 14 | { 15 | Zlib = 0, 16 | Zstd = 1, 17 | Snappy = 2, 18 | Brotli = 3, 19 | } 20 | } -------------------------------------------------------------------------------- /CSharpSDK/Enums/IntCompType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | namespace AirdSDK.Enums 12 | { 13 | public enum IntCompType 14 | { 15 | Empty = -1, //Empty, No Compressor 16 | VB = 2, //Variable Byte 17 | BP = 3, //Binary Packing 18 | DZVB = 4, //Delta Zigzag Variable Byte 19 | } 20 | } -------------------------------------------------------------------------------- /CSharpSDK/Enums/MsLevel.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | namespace AirdSDK.Enums 12 | { 13 | public static class MsLevel 14 | { 15 | public const string MS1 = "1"; 16 | public const string MS2 = "2"; 17 | } 18 | } -------------------------------------------------------------------------------- /CSharpSDK/Enums/SortedIntCompType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | namespace AirdSDK.Enums 12 | { 13 | public enum SortedIntCompType 14 | { 15 | IBP = 0, //Integrated Binary Packing 16 | IVB = 1, //Integrated Variable Byte 17 | Delta = 2, //Delta Trans 18 | } 19 | } -------------------------------------------------------------------------------- /CSharpSDK/Exception/ScanException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | using AirdSDK.Enums; 12 | 13 | namespace AirdSDK.Exception; 14 | 15 | public class ScanException : System.Exception 16 | 17 | { 18 | public ResultCodeEnum resultCode; 19 | 20 | /** 21 | * 构造函数 22 | * 23 | * @param resultCode result code 24 | */ 25 | public ScanException(ResultCodeEnum resultCode) 26 | { 27 | this.resultCode = resultCode; 28 | } 29 | } -------------------------------------------------------------------------------- /CSharpSDK/Parser/DIAParser.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | using AirdSDK.Beans; 12 | using AirdSDK.Enums; 13 | 14 | namespace AirdSDK.Parser; 15 | 16 | public class DIAParser : BaseParser 17 | { 18 | public DIAParser(string indexFilePath) : base(indexFilePath) 19 | { 20 | } 21 | 22 | public DIAParser(string indexFilePath, AirdInfo airdInfo) : base(indexFilePath, airdInfo) 23 | { 24 | } 25 | 26 | /** 27 | * 构造函数 28 | * 29 | * @param airdPath aird file path 30 | * @param mzCompressor mz compressor 31 | * @param intCompressor intensity compressor 32 | * @throws ScanException scan exception 33 | */ 34 | public DIAParser(string airdPath, Beans.Compressor mzCompressor, Beans.Compressor intCompressor) : base(airdPath, 35 | mzCompressor, intCompressor, null, AcquisitionMethod.DIA) 36 | { 37 | } 38 | } -------------------------------------------------------------------------------- /CSharpSDK/Parser/PRMParser.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | using AirdSDK.Beans; 12 | 13 | namespace AirdSDK.Parser; 14 | 15 | public class PRMParser : DIAParser 16 | { 17 | public PRMParser(string indexFilePath) : base(indexFilePath) 18 | { 19 | } 20 | 21 | public PRMParser(string indexFilePath, AirdInfo airdInfo) : base(indexFilePath, airdInfo) 22 | { 23 | } 24 | } -------------------------------------------------------------------------------- /CSharpSDK/ThirdParty/BugFixForCSharpFastPFORCore/Differential/IntegratedByteIntegerCODEC.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is released under the 3 | * Apache License Version 2.0 http://www.apache.org/licenses/. 4 | * 5 | * (c) Daniel Lemire, http://lemire.me/en/ 6 | */ 7 | 8 | /** 9 | * Interface describing a CODEC to compress integers to bytes. 10 | * 11 | * "Integrated" means that it uses differential coding. 12 | * 13 | * @author Daniel Lemire 14 | * 15 | */ 16 | namespace CSharpFastPFOR.Differential 17 | { 18 | public interface IntegratedByteIntegerCODEC : ByteIntegerCODEC 19 | { 20 | } 21 | } -------------------------------------------------------------------------------- /CSharpSDK/ThirdParty/BugFixForCSharpFastPFORCore/Differential/IntegratedIntegerCODEC.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is released under the 3 | * Apache License Version 2.0 http://www.apache.org/licenses/. 4 | * 5 | * (c) Daniel Lemire, http://lemire.me/en/ 6 | */ 7 | 8 | /** 9 | * This is just like IntegerCODEC, except that it indicates that delta coding is 10 | * "integrated", so that you don't need a separate step for delta coding. 11 | * 12 | * @author Daniel Lemire 13 | */ 14 | namespace CSharpFastPFOR.Differential 15 | { 16 | public interface IntegratedIntegerCODEC : IntegerCODEC 17 | { 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /CSharpSDK/ThirdParty/BugFixForCSharpFastPFORCore/JustCopy.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is released under the 3 | * Apache License Version 2.0 http://www.apache.org/licenses/. 4 | * 5 | * (c) Daniel Lemire, http://lemire.me/en/ 6 | */ 7 | 8 | /** 9 | * @author Daniel Lemire 10 | * 11 | */ 12 | 13 | using System; 14 | 15 | namespace CSharpFastPFOR 16 | { 17 | public class JustCopy : IntegerCODEC, SkippableIntegerCODEC 18 | { 19 | public void headlessCompress(int[] @in, IntWrapper inpos, int inlength, int[] @out, IntWrapper outpos) 20 | { 21 | Array.Copy(@in, inpos.get(), @out, outpos.get(), inlength); 22 | inpos.add(inlength); 23 | outpos.add(inlength); 24 | } 25 | 26 | public void uncompress(int[] @in, IntWrapper inpos, int inlength, int[] @out, IntWrapper outpos) 27 | { 28 | headlessUncompress(@in, inpos, inlength, @out, outpos, inlength); 29 | } 30 | 31 | public void headlessUncompress(int[] @in, IntWrapper inpos, int inlength, int[] @out, IntWrapper outpos, int num) 32 | { 33 | Array.Copy(@in, inpos.get(), @out, outpos.get(), num); 34 | inpos.add(num); 35 | outpos.add(num); 36 | } 37 | 38 | public void compress(int[] @in, IntWrapper inpos, int inlength, int[] @out, IntWrapper outpos) 39 | { 40 | headlessCompress(@in, inpos, inlength, @out, outpos); 41 | } 42 | 43 | public override string ToString() 44 | { 45 | return nameof(JustCopy); 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /CSharpSDK/ThirdParty/BugFixForCSharpFastPFORCore/Port/Arrays.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | namespace CSharpFastPFOR.Port 5 | { 6 | public class Arrays 7 | { 8 | private static void rangeCheck(int arrayLen, int fromIndex, int toIndex) 9 | { 10 | if (fromIndex > toIndex) 11 | throw new ArgumentOutOfRangeException("fromIndex(" + fromIndex + ") > toIndex(" + toIndex + ")"); 12 | 13 | if (fromIndex < 0) 14 | throw new ArgumentOutOfRangeException("fromIndex"); 15 | 16 | if (toIndex > arrayLen) 17 | throw new ArgumentOutOfRangeException("toIndex"); 18 | } 19 | 20 | public static void fill(T[] array, int start, int end, T value) 21 | { 22 | if (array == null) 23 | throw new ArgumentNullException("array"); 24 | 25 | rangeCheck(array.Length, start, end); 26 | 27 | for (int i = start; i < end; i++) 28 | { 29 | array[i] = value; 30 | } 31 | } 32 | 33 | public static T[] copyOf(T[] original, int newLength) 34 | { 35 | T[] copy = new T[newLength]; 36 | Array.Copy(original, 0, copy, 0, Math.Min(original.Length, newLength)); 37 | return copy; 38 | } 39 | 40 | public static void fill(T[] array, T value) 41 | { 42 | fill(array, 0, array.Length, value); 43 | } 44 | 45 | public static void sort(int[] array) 46 | { 47 | Array.Sort(array); 48 | } 49 | 50 | public static string toString(int[] ints) 51 | { 52 | return string.Join(", ", ints); 53 | } 54 | 55 | public static bool equals(int[] first, int[] second) 56 | { 57 | return first.SequenceEqual(second); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /CSharpSDK/ThirdParty/BugFixForCSharpFastPFORCore/Port/BitSet.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | 3 | namespace CSharpFastPFOR.Port 4 | { 5 | public class BitSet 6 | { 7 | private BitArray _bitArray; 8 | 9 | public BitSet(int max) 10 | { 11 | _bitArray = new BitArray(max); 12 | } 13 | 14 | public bool get(int i) 15 | { 16 | return _bitArray[i]; 17 | } 18 | 19 | public void set(int i) 20 | { 21 | _bitArray[i] = true; 22 | } 23 | 24 | public int nextSetBit(int fromIndex) 25 | { 26 | for (int j = fromIndex; j < _bitArray.Length; j++) 27 | { 28 | if (_bitArray[j]) 29 | return j; 30 | } 31 | 32 | return -1; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /CSharpSDK/ThirdParty/BugFixForCSharpFastPFORCore/Port/ByteOrder.cs: -------------------------------------------------------------------------------- 1 | namespace CSharpFastPFOR.Port 2 | { 3 | public enum ByteOrder 4 | { 5 | LITTLE_ENDIAN, 6 | BIG_ENDIAN 7 | } 8 | } -------------------------------------------------------------------------------- /CSharpSDK/ThirdParty/BugFixForCSharpFastPFORCore/Port/IntBuffer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace CSharpFastPFOR.Port 5 | { 6 | public class IntBuffer 7 | { 8 | private readonly MemoryStream _ms; 9 | private readonly ByteOrder _order; 10 | 11 | public IntBuffer(MemoryStream ms, ByteOrder order) 12 | { 13 | _ms = ms; 14 | _order = order; 15 | } 16 | 17 | public void get(int[] dst, int offset, int length) 18 | { 19 | int end = offset + length; 20 | 21 | BinaryReader br = new BinaryReader(_ms); 22 | 23 | for (int i = offset; i < end; i++) 24 | { 25 | int value = br.ReadInt32(); 26 | 27 | if (BitConverter.IsLittleEndian && _order == ByteOrder.BIG_ENDIAN) 28 | value = reverseBytes(value); 29 | dst[i] = value; 30 | } 31 | } 32 | 33 | public static int reverseBytes(int i) 34 | { 35 | return ((int)((uint)i >> 24)) | 36 | ((i >> 8) & 0xFF00) | 37 | ((i << 8) & 0xFF0000) | 38 | ((i << 24)); 39 | } 40 | 41 | private static void checkBounds(int off, int len, int size) 42 | { 43 | if ((off | len | (off + len) | (size - (off + len))) < 0) 44 | throw new IndexOutOfRangeException(); 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /CSharpSDK/ThirdParty/BugFixForCSharpFastPFORCore/Port/Integer.cs: -------------------------------------------------------------------------------- 1 | namespace CSharpFastPFOR.Port 2 | { 3 | public class Integer 4 | { 5 | private int v; 6 | 7 | public Integer(int v) 8 | { 9 | this.v = v; 10 | } 11 | 12 | public static int numberOfLeadingZeros(int x) 13 | { 14 | x |= (x >> 1); 15 | x |= (x >> 2); 16 | x |= (x >> 4); 17 | x |= (x >> 8); 18 | x |= (x >> 16); 19 | return (sizeof(int) * 8 - Ones(x)); 20 | } 21 | 22 | public static int Ones(int x) 23 | { 24 | x -= ((x >> 1) & 0x55555555); 25 | x = (((x >> 2) & 0x33333333) + (x & 0x33333333)); 26 | x = (((x >> 4) + x) & 0x0f0f0f0f); 27 | x += (x >> 8); 28 | x += (x >> 16); 29 | return (x & 0x0000003f); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /CSharpSDK/ThirdParty/Zlib/LICENSE.jzlib.txt: -------------------------------------------------------------------------------- 1 | The ZLIB library, available as Ionic.Zlib.dll or as part of DotNetZip, 2 | is a ported-then-modified version of jzlib. The following applies to jzlib: 3 | 4 | JZlib 0.0.* were released under the GNU LGPL license. Later, we have switched 5 | over to a BSD-style license. 6 | 7 | ------------------------------------------------------------------------------ 8 | Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright 17 | notice, this list of conditions and the following disclaimer in 18 | the documentation and/or other materials provided with the distribution. 19 | 20 | 3. The names of the authors may not be used to endorse or promote products 21 | derived from this software without specific prior written permission. 22 | 23 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, 24 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 25 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, 26 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, 27 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 28 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 29 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 30 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 31 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 32 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | -------------------------------------------------------------------------------- /CSharpSDK/ThirdParty/Zlib/License.zlib.txt: -------------------------------------------------------------------------------- 1 | The ZLIB library, available as Ionic.Zlib.dll or as part of DotNetZip, 2 | is a ported-then-modified version of jzlib, which itself is based on 3 | zlib-1.1.3, the well-known C-language compression library. 4 | 5 | The following notice applies to zlib: 6 | 7 | ----------------------------------------------------------------------- 8 | 9 | Copyright (C) 1995-2004 Jean-loup Gailly and Mark Adler 10 | 11 | The ZLIB software is provided 'as-is', without any express or implied 12 | warranty. In no event will the authors be held liable for any damages 13 | arising from the use of this software. 14 | 15 | Permission is granted to anyone to use this software for any purpose, 16 | including commercial applications, and to alter it and redistribute it 17 | freely, subject to the following restrictions: 18 | 19 | 1. The origin of this software must not be misrepresented; you must not 20 | claim that you wrote the original software. If you use this software 21 | in a product, an acknowledgment in the product documentation would be 22 | appreciated but is not required. 23 | 2. Altered source versions must be plainly marked as such, and must not be 24 | misrepresented as being the original software. 25 | 3. This notice may not be removed or altered from any source distribution. 26 | 27 | Jean-loup Gailly jloup@gzip.org 28 | Mark Adler madler@alumni.caltech.edu 29 | 30 | 31 | ----------------------------------------------------------------------- 32 | -------------------------------------------------------------------------------- /CSharpSDK/Utils/ArrayUtil.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | using System.Collections.Generic; 12 | 13 | namespace AirdSDK.Utils; 14 | public class ArrayUtil 15 | { 16 | public static double[] ToDoublePrimitive(List list) 17 | { 18 | double[] array = new double[list.Count]; 19 | for (int i = 0; i < list.Count; i++) 20 | { 21 | array[i] = list[i]; 22 | } 23 | 24 | return array; 25 | } 26 | 27 | public static int[] ToIntArray(List list) 28 | { 29 | int[] array = new int[list.Count]; 30 | for (int i = 0; i < list.Count; i++) 31 | { 32 | array[i] = list[i]; 33 | } 34 | 35 | return array; 36 | } 37 | } -------------------------------------------------------------------------------- /CSharpSDK/Utils/FileUtil.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | using System.IO; 12 | 13 | namespace AirdSDK.Utils; 14 | 15 | public class FileUtil 16 | { 17 | /** 18 | * read all the string in the target file 19 | * 20 | * @param file 文件对象 21 | * @return content in the file 22 | */ 23 | public static string ReadFile(FileInfo file) 24 | { 25 | string content = File.ReadAllText(file.FullName); 26 | return content; 27 | } 28 | } -------------------------------------------------------------------------------- /CSharpSDK/Utils/NetworkUtil.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Studio 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | using System; 12 | using System.Collections.Generic; 13 | using System.Net; 14 | using System.Net.Sockets; 15 | 16 | namespace AirdSDK.Utils; 17 | 18 | public class NetworkUtil 19 | { 20 | //获取本地IP的方法 21 | public static List GetHostIpList() 22 | { 23 | List ipList = new List(); 24 | foreach (IPAddress address in Dns.GetHostEntry(Dns.GetHostName()).AddressList) 25 | { 26 | if (address.AddressFamily == AddressFamily.InterNetwork) 27 | { 28 | string ip = Convert.ToString(address); 29 | ipList.Add(ip); 30 | } 31 | } 32 | 33 | return ipList; 34 | } 35 | } -------------------------------------------------------------------------------- /CSharpSDK/timsdata.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSi-Studio/Aird-SDK/5ceb09523ecc756427a2c5d682786ebd617f4432/CSharpSDK/timsdata.dll -------------------------------------------------------------------------------- /JavaSDK/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # Package Files # 14 | *.jar 15 | *.war 16 | *.nar 17 | *.ear 18 | *.zip 19 | *.tar.gz 20 | *.rar 21 | 22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 23 | hs_err_pid* 24 | /aird.iml 25 | /.idea 26 | /aird-sdk-java.iml 27 | /aird-sdk.iml 28 | /target/ 29 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/CV.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.bean; 12 | 13 | import lombok.Data; 14 | 15 | /** 16 | * Controlled Vocabulary 17 | */ 18 | @Data 19 | public class CV { 20 | 21 | /** 22 | * cv id:cv name 23 | */ 24 | String cvid; 25 | 26 | /** 27 | * cv value 28 | */ 29 | String value; 30 | 31 | /** 32 | * unit id:unit name 33 | */ 34 | String units; 35 | } 36 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/ColumnInfo.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.bean; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | @Data 9 | public class ColumnInfo { 10 | 11 | List indexList; 12 | 13 | /** 14 | * [Core Field] 15 | * AcquisitionMethod, Support for DIA/SWATH, PRM, DDA, SRM/MRM, DDAPasef, DIAPasef 16 | * [核心字段] 17 | * Aird支持的采集模式的类型,目前支持SRM/MRM, DIA, PRM, DDA, DDAPasef, DIAPasef 6种 18 | */ 19 | String type; 20 | 21 | /** 22 | * the aird file path. 23 | * 转换压缩后的aird二进制文件路径,默认读取同目录下的同名文件,如果不存在才去读本字段对应的路径 24 | */ 25 | String airdPath; 26 | 27 | int mzPrecision; 28 | 29 | int intPrecision; 30 | 31 | public static ColumnInfo fromProto(net.csibio.aird.bean.proto.ColumnInfo.ColumnInfoProto proto){ 32 | ColumnInfo columnInfo = new ColumnInfo(); 33 | columnInfo.setType(proto.getType()); 34 | columnInfo.setAirdPath(proto.getAirdPath()); 35 | columnInfo.setIntPrecision(proto.getIntPrecision()); 36 | columnInfo.setMzPrecision(proto.getMzPrecision()); 37 | if (proto.getIndexListCount() > 0) { 38 | List indexList = new ArrayList(); 39 | for (int i = 0; i < proto.getIndexListCount(); i++) { 40 | net.csibio.aird.bean.proto.ColumnInfo.ColumnIndexProto indexProto = proto.getIndexList(i); 41 | indexList.add(ColumnIndex.fromProto(indexProto)); 42 | } 43 | columnInfo.setIndexList(indexList); 44 | } 45 | return columnInfo; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/DataProcessing.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.bean; 12 | 13 | import lombok.Data; 14 | import net.csibio.aird.bean.proto.AirdInfo; 15 | 16 | import java.util.ArrayList; 17 | import java.util.List; 18 | 19 | /** 20 | * data processing information 21 | */ 22 | @Data 23 | public class DataProcessing { 24 | 25 | /** 26 | * Any additional manipulation not included elsewhere in the dataProcessing element. 27 | */ 28 | List processingOperations; 29 | 30 | public static DataProcessing fromProto(AirdInfo.DataProcessingProto proto) { 31 | if (proto == null) { 32 | return null; 33 | } 34 | 35 | DataProcessing dataProcessing = new DataProcessing(); 36 | 37 | // 处理 processingOperations 列表 38 | List operationsList = new ArrayList<>(); 39 | operationsList.addAll(proto.getProcessingOperationsList()); 40 | dataProcessing.setProcessingOperations(operationsList); 41 | 42 | return dataProcessing; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/Layers.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.bean; 12 | 13 | import lombok.Data; 14 | 15 | @Data 16 | public class Layers { 17 | 18 | /** 19 | * 使用fastPfor算法压缩以后的mz数组 compressed mz array with fastPfor 20 | */ 21 | byte[] mzArray; 22 | 23 | /** 24 | * mz对应的层索引 layer index of mz 25 | */ 26 | byte[] tagArray; 27 | 28 | /** 29 | * 存储单个索引所需的位数 storage digits occupied by an index 30 | */ 31 | int digit; 32 | 33 | public Layers() { 34 | } 35 | 36 | public Layers(byte[] mzArray, byte[] indexArray, int digit) { 37 | this.mzArray = mzArray; 38 | this.tagArray = indexArray; 39 | this.digit = digit; 40 | } 41 | 42 | 43 | } 44 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/MobiInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.bean; 12 | 13 | import lombok.Data; 14 | import net.csibio.aird.bean.proto.AirdInfo; 15 | 16 | @Data 17 | public class MobiInfo { 18 | 19 | /** 20 | * start position in the aird for mobi array 21 | */ 22 | long dictStart; 23 | 24 | /** 25 | * end position in the aird for mobi array 26 | */ 27 | long dictEnd; 28 | 29 | /** 30 | * ion mobility unit 31 | */ 32 | String unit; 33 | 34 | /** 35 | * ion mobility value 36 | */ 37 | Double value; 38 | 39 | /** 40 | * ion mobility type, see MobilityType 41 | */ 42 | String type; 43 | 44 | public static MobiInfo fromProto(AirdInfo.MobiInfoProto proto) { 45 | if (proto == null) { 46 | return null; 47 | } 48 | 49 | MobiInfo mobiInfo = new MobiInfo(); 50 | mobiInfo.dictStart = proto.getDictStart(); 51 | mobiInfo.dictEnd = proto.getDictEnd(); 52 | mobiInfo.unit = proto.getUnit(); 53 | mobiInfo.value = proto.getValue(); 54 | mobiInfo.type = proto.getType(); 55 | 56 | return mobiInfo; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/ParentFile.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.bean; 12 | 13 | import lombok.Data; 14 | import net.csibio.aird.bean.proto.AirdInfo; 15 | 16 | @Data 17 | public class ParentFile { 18 | 19 | /** 20 | * 文件名称 The parent file name 21 | */ 22 | String name; 23 | 24 | /** 25 | * 文件位置 The parent file location 26 | */ 27 | String location; 28 | 29 | /** 30 | * 文件类型 The parent file type. Usually refers to the suffix of the file 31 | */ 32 | String formatType; 33 | 34 | public static ParentFile fromProto(AirdInfo.ParentFileProto proto) { 35 | if (proto == null) { 36 | return null; 37 | } 38 | 39 | ParentFile parentFile = new ParentFile(); 40 | parentFile.setName(proto.getName()); 41 | parentFile.setLocation(proto.getLocation()); 42 | parentFile.setFormatType(proto.getFormatType()); 43 | 44 | return parentFile; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/Software.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.bean; 12 | 13 | import lombok.Data; 14 | import net.csibio.aird.bean.proto.AirdInfo; 15 | 16 | @Data 17 | public class Software { 18 | 19 | /** 20 | * 软件名称 The software name 21 | */ 22 | String name; 23 | 24 | /** 25 | * 软件版本号 The software version 26 | */ 27 | String version; 28 | 29 | /** 30 | * 软件类型 The software function type 31 | */ 32 | String type; 33 | 34 | public static Software fromProto(AirdInfo.SoftwareProto proto) { 35 | if (proto == null) { 36 | return null; 37 | } 38 | 39 | Software software = new Software(); 40 | software.setName(proto.getName()); 41 | software.setVersion(proto.getVersion()); 42 | software.setType(proto.getType()); 43 | 44 | return software; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/common/AnyPair.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.bean.common; 12 | 13 | import lombok.Data; 14 | 15 | /** 16 | * Pair for any type 17 | * 18 | * @param type T 19 | * @param type R 20 | */ 21 | @Data 22 | public class AnyPair { 23 | 24 | /** 25 | * Type T 26 | */ 27 | T left; 28 | 29 | /** 30 | * Type R 31 | */ 32 | R right; 33 | 34 | /** 35 | * 构造函数 36 | */ 37 | public AnyPair() { 38 | } 39 | 40 | /** 41 | * 构造函数 42 | * 43 | * @param l value A 44 | * @param r value B 45 | */ 46 | public AnyPair(T l, R r) { 47 | this.left = l; 48 | this.right = r; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/common/AnyPairs.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.bean.common; 12 | 13 | import lombok.Data; 14 | 15 | import java.io.Serializable; 16 | 17 | /** 18 | * Pairs for any array typ 19 | * 20 | * @param Type of the array A 21 | * @param Type of the array B 22 | */ 23 | @Data 24 | public class AnyPairs implements Serializable { 25 | 26 | /** 27 | * instance x 28 | */ 29 | T[] x; 30 | 31 | /** 32 | * instance y 33 | */ 34 | D[] y; 35 | 36 | /** 37 | * 构造函数 38 | */ 39 | public AnyPairs() { 40 | } 41 | 42 | /** 43 | * 构造函数 44 | * 45 | * @param x array X 46 | * @param y array Y 47 | */ 48 | public AnyPairs(T[] x, D[] y) { 49 | this.x = x; 50 | this.y = y; 51 | } 52 | 53 | /** 54 | * the pairs length 55 | * 56 | * @return the pairs length 57 | */ 58 | public int length() { 59 | if (x == null) { 60 | return 0; 61 | } 62 | return x.length; 63 | } 64 | 65 | /** 66 | * x instance 67 | * 68 | * @return the x instance 69 | */ 70 | public T[] getX() { 71 | return x; 72 | } 73 | 74 | /** 75 | * y instance 76 | * 77 | * @return the y instance 78 | */ 79 | public D[] getY() { 80 | return y; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/common/Column.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.bean.common; 2 | 3 | public record Column(int spectraId, double intensity) { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/common/Columns.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.bean.common; 2 | 3 | public record Columns(int[] spectraIds, double[] intensities) { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/common/CompressedPairs.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.bean.common; 2 | 3 | public record CompressedPairs(byte[] left, byte[] right) { 4 | } 5 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/common/DoublePair.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.bean.common; 12 | 13 | /** 14 | * double pair 15 | * 16 | * @param left double left 17 | * @param right double right 18 | */ 19 | public record DoublePair(double left, double right) { 20 | 21 | } 22 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/common/DoublePairs.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.bean.common; 12 | 13 | /** 14 | * double array pairs 15 | * 16 | * @param x double array x 17 | * @param y double array y 18 | */ 19 | public record DoublePairs(double[] x, double[] y) { 20 | 21 | } -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/common/FloatPair.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.bean.common; 12 | 13 | public record FloatPair(float left, float right) { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/common/FloatPairs.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.bean.common; 12 | 13 | public record FloatPairs(float[] x, float[] y) { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/common/IdName.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.bean.common; 12 | 13 | public record IdName(String id, String name) { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/common/IdNameAlias.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.bean.common; 12 | 13 | public record IdNameAlias(String id, String name, String alias) { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/common/IdNameType.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.bean.common; 2 | 3 | public record IdNameType(String id, String name, String type) { 4 | 5 | } -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/common/IntPair.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.bean.common; 12 | 13 | public record IntPair(int left, int right) { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/common/IntegerPair.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.bean.common; 12 | 13 | public record IntegerPair(Integer left, Integer right) { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/common/MobiPoint.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.bean.common; 2 | 3 | public record MobiPoint(int mz, int intensity, int mobi) { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/common/MobilityPoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.bean.common; 12 | 13 | /** 14 | * Ion Mobility Point 15 | * @param mz 16 | * @param intensity 17 | * @param mobility 18 | */ 19 | public record MobilityPoint(double mz, double intensity, double mobility) { 20 | 21 | } 22 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/common/MrmPair.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.bean.common; 2 | 3 | import lombok.Data; 4 | import net.csibio.aird.bean.WindowRange; 5 | 6 | @Data 7 | public class MrmPair { 8 | 9 | /** 10 | * order number for current spectrum 11 | */ 12 | int num; 13 | 14 | String id; 15 | 16 | String key; 17 | 18 | WindowRange precursor; 19 | WindowRange product; 20 | String polarity; 21 | String activator; 22 | Float energy; 23 | 24 | double[] rts; 25 | double[] ints; 26 | } 27 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/common/RawFileInfo.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.bean.common; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class RawFileInfo { 7 | 8 | String fileName; 9 | String filePath; 10 | Long fileSize; 11 | String extension; 12 | boolean isFile; 13 | boolean isFolder; 14 | } 15 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/common/Spectrum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.bean.common; 12 | 13 | import lombok.Data; 14 | 15 | @Data 16 | public class Spectrum { 17 | 18 | private double[] mzs; 19 | private double[] ints; 20 | private double[] mobilities; 21 | 22 | public Spectrum(double[] mzs, double[] ints) { 23 | this.mzs = mzs; 24 | this.ints = ints; 25 | } 26 | 27 | public Spectrum(double[] mzs, double[] ints, double[] mobilities) { 28 | this.mzs = mzs; 29 | this.ints = ints; 30 | this.mobilities = mobilities; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/common/StrIntPairs.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.bean.common; 12 | 13 | public record StrIntPairs(String[] x, int[] y) { 14 | 15 | } -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/bean/common/Xic.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.bean.common; 12 | 13 | import lombok.Data; 14 | import org.apache.commons.lang3.ArrayUtils; 15 | 16 | import java.util.List; 17 | 18 | @Data 19 | public class Xic { 20 | 21 | public double[] rts; 22 | public double[] ints; 23 | 24 | //用于存储每一张光谱图中计算XIC时最大的mz 25 | public double[] mzs; 26 | 27 | public Xic() { 28 | } 29 | 30 | public Xic(double[] rts, double[] ints) { 31 | this.rts = rts; 32 | this.ints = ints; 33 | } 34 | 35 | public Xic(List rtList, List intensityList, List mzList) { 36 | this.setRts(ArrayUtils.toPrimitive(rtList.toArray(new Double[0]))); 37 | this.setInts(ArrayUtils.toPrimitive(intensityList.toArray(new Double[0]))); 38 | 39 | if (mzList == null) { 40 | this.setMzs(null); 41 | } else { 42 | this.setMzs(ArrayUtils.toPrimitive(mzList.toArray(new Double[0]))); 43 | } 44 | } 45 | 46 | public Xic(double[] rts, double[] ints, double[] mzs) { 47 | this.rts = rts; 48 | this.ints = ints; 49 | this.mzs = mzs; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/compressor/Delta.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.compressor; 12 | 13 | /** 14 | * Delta Encoder 15 | */ 16 | public class Delta { 17 | 18 | /** 19 | * Apply differential coding (in-place). 20 | * 21 | * @param data data to be modified 22 | */ 23 | public static int[] delta(int[] data) { 24 | int[] res = new int[data.length]; 25 | res[0] = data[0]; 26 | for (int i = 1; i < data.length; i++) { 27 | res[i] = data[i] - data[i - 1]; 28 | } 29 | return res; 30 | } 31 | 32 | /** 33 | * Undo differential coding (in-place). Effectively computes a prefix sum. 34 | * 35 | * @param data to be modified. 36 | */ 37 | public static int[] recover(int[] data) { 38 | int[] res = new int[data.length]; 39 | res[0] = data[0]; 40 | for (int i = 1; i < data.length; ++i) { 41 | res[i] = data[i] + res[i - 1]; 42 | } 43 | return res; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/compressor/Xor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.compressor; 12 | 13 | public class Xor { 14 | 15 | /** 16 | * Apply differential coding (in-place). 17 | * 18 | * @param data data to be modified 19 | */ 20 | public static int[] xor(int[] data) { 21 | int[] res = new int[data.length]; 22 | for (int i = data.length - 1; i > 0; --i) { 23 | res[i] = data[i] ^ data[i - 1]; 24 | } 25 | res[0] = data[0]; 26 | return res; 27 | } 28 | 29 | /** 30 | * Undo differential coding (in-place). Effectively computes a prefix sum. 31 | * 32 | * @param data to be modified. 33 | */ 34 | public static int[] recover(int[] data) { 35 | int[] res = new int[data.length]; 36 | res[0] = data[0]; 37 | for (int i = 1; i < data.length; ++i) { 38 | res[i] = data[i] - data[i - 1]; 39 | } 40 | return res; 41 | } 42 | } -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/compressor/Zigzag.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.compressor; 2 | 3 | public class Zigzag { 4 | 5 | /** 6 | * Apply differential coding (in-place). 7 | * 8 | * @param data data to be modified 9 | */ 10 | public static int[] encode(int[] data) { 11 | int[] res = new int[data.length]; 12 | for (int i = 1; i < data.length; i++) { 13 | res[i] = (data[i] << 1) ^ (data[i] >> 31); 14 | } 15 | return res; 16 | } 17 | 18 | /** 19 | * Undo differential coding (in-place). Effectively computes a prefix sum. 20 | * 21 | * @param data to be modified. 22 | */ 23 | public static int[] decode(int[] data) { 24 | int[] res = new int[data.length]; 25 | for (int i = 1; i < data.length; i++) { 26 | res[i] = (data[i] >>> 1) ^ -(data[i] & 1); 27 | } 28 | return res; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/compressor/bytecomp/ByteComp.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.compressor.bytecomp; 12 | 13 | /** 14 | * Byte Compressor Interface 15 | */ 16 | public interface ByteComp { 17 | 18 | /** 19 | * Compresses a byte array 20 | * 21 | * @return the byte compressor name 22 | */ 23 | String getName(); 24 | 25 | /** 26 | * @param uncompressed uncompressed byte array 27 | * @return the compressed byte array 28 | */ 29 | byte[] encode(byte[] uncompressed); 30 | 31 | /** 32 | * @param compressed compressed byte array 33 | * @return the compressed byte array 34 | */ 35 | byte[] decode(byte[] compressed); 36 | 37 | /** 38 | * @param input input byte array 39 | * @param offset offset byte 40 | * @param length length 41 | * @return the uncompressed byte array 42 | */ 43 | byte[] decode(byte[] input, int offset, int length); 44 | } 45 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/compressor/bytecomp/SnappyWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.compressor.bytecomp; 12 | 13 | import net.csibio.aird.enums.ByteCompType; 14 | import org.xerial.snappy.Snappy; 15 | 16 | import java.io.IOException; 17 | import java.util.Arrays; 18 | 19 | public class SnappyWrapper implements ByteComp { 20 | 21 | @Override 22 | public String getName() { 23 | return ByteCompType.Snappy.getName(); 24 | } 25 | 26 | @Override 27 | public byte[] encode(byte[] input) { 28 | try { 29 | return Snappy.compress(input); 30 | } catch (IOException e) { 31 | e.printStackTrace(); 32 | } 33 | return null; 34 | } 35 | 36 | @Override 37 | public byte[] decode(byte[] input) { 38 | try { 39 | return Snappy.uncompress(input); 40 | } catch (IOException e) { 41 | e.printStackTrace(); 42 | } 43 | return null; 44 | } 45 | 46 | @Override 47 | public byte[] decode(byte[] input, int offset, int length) { 48 | return decode(Arrays.copyOfRange(input, offset, offset + length)); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/compressor/intcomp/BinPackingWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.compressor.intcomp; 12 | 13 | import me.lemire.integercompression.IntCompressor; 14 | import net.csibio.aird.enums.IntCompType; 15 | 16 | /** 17 | * Binary Packing Wrapper implementation 18 | */ 19 | public class BinPackingWrapper implements IntComp { 20 | 21 | @Override 22 | public String getName() { 23 | return IntCompType.BP.getName(); 24 | } 25 | 26 | /** 27 | * Delta+VByte+ByteCompressor Encoder. Default ByteCompressor is Zlib. The compress target must be 28 | * sorted integers. 29 | * 30 | * @param uncompressed the sorted integers 31 | * @return the compressed data 32 | */ 33 | @Override 34 | public int[] encode(int[] uncompressed) { 35 | int[] compressedInts = new IntCompressor().compress(uncompressed); 36 | return compressedInts; 37 | } 38 | 39 | @Override 40 | public int[] decode(int[] compressed) { 41 | int[] uncompressed = new IntCompressor().uncompress(compressed); 42 | return uncompressed; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/compressor/intcomp/DeltaZigzagVBWrapper.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.compressor.intcomp; 2 | 3 | import me.lemire.integercompression.*; 4 | import net.csibio.aird.enums.IntCompType; 5 | 6 | import java.util.Arrays; 7 | 8 | public class DeltaZigzagVBWrapper implements IntComp { 9 | @Override 10 | public String getName() { 11 | return IntCompType.DZVB.getName(); 12 | } 13 | 14 | @Override 15 | public int[] encode(int[] uncompressed) { 16 | IntegerCODEC codec = new DeltaZigzagVariableByte(); 17 | int[] compressed = new int[uncompressed.length + uncompressed.length / 100 + 1024];// could need more 18 | IntWrapper outputoffset = new IntWrapper(1); 19 | codec.compress(uncompressed, new IntWrapper(0), uncompressed.length, compressed, outputoffset); 20 | compressed = Arrays.copyOf(compressed, outputoffset.intValue()); 21 | compressed[0] = uncompressed.length; 22 | return compressed; 23 | } 24 | 25 | @Override 26 | public int[] decode(int[] compressed) { 27 | if (compressed.length == 0) { 28 | return new int[0]; 29 | } 30 | IntegerCODEC codec = new DeltaZigzagVariableByte(); 31 | int[] decompressed = new int[compressed[0]]; 32 | codec.uncompress(compressed, new IntWrapper(1), compressed.length - 1, decompressed, new IntWrapper(0)); 33 | return decompressed; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/compressor/intcomp/Empty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.compressor.intcomp; 12 | 13 | import net.csibio.aird.enums.IntCompType; 14 | 15 | /** 16 | * Empty Compressor as integer compressor 17 | */ 18 | public class Empty implements IntComp { 19 | 20 | @Override 21 | public String getName() { 22 | return IntCompType.Empty.getName(); 23 | } 24 | 25 | @Override 26 | public int[] encode(int[] uncompressed) { 27 | return uncompressed; 28 | } 29 | 30 | @Override 31 | public int[] decode(int[] compressed) { 32 | return compressed; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/compressor/intcomp/IntComp.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.compressor.intcomp; 12 | 13 | /** 14 | * Integer compressor interface 15 | */ 16 | public interface IntComp { 17 | 18 | /** 19 | * Compresses the given byte array. 20 | * 21 | * @return the Integer compressor name 22 | */ 23 | String getName(); 24 | 25 | /** 26 | * Decompresses the given byte array. 27 | * 28 | * @param uncompressed the sorted integers 29 | * @return the compressed data 30 | */ 31 | int[] encode(int[] uncompressed); 32 | 33 | /** 34 | * Decompresses the given byte array. 35 | * 36 | * @param compressed the compressed sorted integers 37 | * @return the decompressed data 38 | */ 39 | int[] decode(int[] compressed); 40 | } 41 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/compressor/intcomp/VarByteWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.compressor.intcomp; 12 | 13 | import me.lemire.integercompression.IntCompressor; 14 | import me.lemire.integercompression.VariableByte; 15 | import net.csibio.aird.enums.IntCompType; 16 | 17 | public class VarByteWrapper implements IntComp { 18 | 19 | @Override 20 | public String getName() { 21 | return IntCompType.VB.getName(); 22 | } 23 | 24 | /** 25 | * Delta+VByte+ByteCompressor Encoder. Default ByteCompressor is Zlib. The compress target must be 26 | * sorted integers. 27 | * 28 | * @param uncompressed the sorted integers 29 | * @return the compressed data 30 | */ 31 | @Override 32 | public int[] encode(int[] uncompressed) { 33 | int[] compressedInts = new IntCompressor(new VariableByte()).compress(uncompressed); 34 | return compressedInts; 35 | } 36 | 37 | @Override 38 | public int[] decode(int[] compressed) { 39 | int[] uncompressed = new IntCompressor(new VariableByte()).uncompress(compressed); 40 | return uncompressed; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/compressor/sortedintcomp/DeltaWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.compressor.sortedintcomp; 12 | 13 | import net.csibio.aird.compressor.Delta; 14 | import net.csibio.aird.enums.SortedIntCompType; 15 | 16 | /** 17 | * 入参必须是有序数组,经过SIMD优化的算法 18 | */ 19 | public class DeltaWrapper implements SortedIntComp { 20 | 21 | @Override 22 | public String getName() { 23 | return SortedIntCompType.IBP.getName(); 24 | } 25 | 26 | /** 27 | * trans the data with delta coding 28 | * 29 | * @param uncompressed sorted integers to be compressed 30 | * @return compressed data 31 | */ 32 | @Override 33 | public int[] encode(int[] uncompressed) { 34 | int[] compressed = Delta.delta(uncompressed); 35 | return compressed; 36 | } 37 | 38 | /** 39 | * recover the data with delta coding 40 | * 41 | * @param compressed 压缩对象 42 | * @return decompressed data 43 | */ 44 | @Override 45 | public int[] decode(int[] compressed) { 46 | int[] uncompressed = Delta.recover(compressed); 47 | return uncompressed; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/compressor/sortedintcomp/IntegratedBinPackingWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.compressor.sortedintcomp; 12 | 13 | import me.lemire.integercompression.differential.IntegratedIntCompressor; 14 | import net.csibio.aird.enums.SortedIntCompType; 15 | 16 | /** 17 | * 入参必须是有序数组,经过SIMD优化的算法 18 | */ 19 | public class IntegratedBinPackingWrapper implements SortedIntComp { 20 | 21 | @Override 22 | public String getName() { 23 | return SortedIntCompType.IBP.getName(); 24 | } 25 | 26 | /** 27 | * compress the data with fastpfor algorithm 28 | * 29 | * @param uncompressed sorted integers to be compressed 30 | * @return compressed data 31 | */ 32 | @Override 33 | public int[] encode(int[] uncompressed) { 34 | int[] compressed = new IntegratedIntCompressor().compress(uncompressed); 35 | return compressed; 36 | } 37 | 38 | /** 39 | * decompress the data with fastpfor algorithm 40 | * 41 | * @param compressed 压缩对象 42 | * @return decompressed data 43 | */ 44 | @Override 45 | public int[] decode(int[] compressed) { 46 | int[] uncompressed = new IntegratedIntCompressor().uncompress(compressed); 47 | return uncompressed; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/compressor/sortedintcomp/IntegratedVarByteWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.compressor.sortedintcomp; 12 | 13 | import me.lemire.integercompression.differential.IntegratedIntCompressor; 14 | import me.lemire.integercompression.differential.IntegratedVariableByte; 15 | import net.csibio.aird.enums.SortedIntCompType; 16 | 17 | public class IntegratedVarByteWrapper implements SortedIntComp { 18 | 19 | @Override 20 | public String getName() { 21 | return SortedIntCompType.IVB.getName(); 22 | } 23 | 24 | /** 25 | * Delta+VByte+ByteCompressor Encoder. Default ByteCompressor is Zlib. The compress target must be 26 | * sorted integers. 27 | * 28 | * @param uncompressed the sorted integers 29 | * @return the compressed data 30 | */ 31 | @Override 32 | public int[] encode(int[] uncompressed) { 33 | int[] compressedInts = new IntegratedIntCompressor(new IntegratedVariableByte()).compress(uncompressed); 34 | return compressedInts; 35 | } 36 | 37 | @Override 38 | public int[] decode(int[] compressed) { 39 | int[] uncompressed = new IntegratedIntCompressor(new IntegratedVariableByte()).uncompress(compressed); 40 | return uncompressed; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/compressor/sortedintcomp/SortIntEmptyWrapper.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.compressor.sortedintcomp; 2 | 3 | public class SortIntEmptyWrapper implements SortedIntComp{ 4 | @Override 5 | public String getName() { 6 | return "Empty"; 7 | } 8 | 9 | @Override 10 | public int[] encode(int[] uncompressed) { 11 | return uncompressed; 12 | } 13 | 14 | @Override 15 | public int[] decode(int[] compressed) { 16 | return compressed; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/compressor/sortedintcomp/SortedIntComp.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.compressor.sortedintcomp; 12 | 13 | public interface SortedIntComp { 14 | 15 | String getName(); 16 | 17 | int[] encode(int[] uncompressed); 18 | 19 | int[] decode(int[] compressed); 20 | } 21 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/constant/SuffixConst.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.constant; 12 | 13 | public class SuffixConst { 14 | 15 | public static final String JSON = ".json"; 16 | public static final String CJSON = ".cjson"; 17 | public static final String INDEX = ".index"; 18 | public static final String CINDEX = ".cindex"; 19 | public static final String AIRD = ".aird"; 20 | 21 | public static final String MZXML = ".mzxml"; 22 | 23 | public static final String MZML = ".mzml"; 24 | 25 | //Thermo 26 | public static final String RAW = ".raw"; 27 | 28 | //Sciex 29 | public static final String WIFF = ".wiff"; 30 | public static final String SCAN = ".scan"; 31 | 32 | //Bruker,Agilent 33 | public static final String D = ".d"; 34 | } 35 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/constant/SymbolConst.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.constant; 12 | 13 | public class SymbolConst { 14 | 15 | public static final String COMMA = ","; 16 | public static final String TAB = "\t"; 17 | public static final String RETURN = "\r"; 18 | public static final String DOT = "."; 19 | public static final String DELIMITER = "-"; 20 | public static final String UNDERLINE = "_"; 21 | public static final String BAR = "|"; 22 | public static final String SPACE = " "; 23 | public static final String LEFT_SLASH = "/"; 24 | public static final String RIGHT_SLASH = "\\"; 25 | public static final String DOUBLE_QUOTA = "\""; 26 | public static final String QUOTA = "'"; 27 | } 28 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/enums/AirdEngine.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.enums; 12 | 13 | /** 14 | * Activation Method 15 | */ 16 | public enum AirdEngine { 17 | 18 | /** 19 | * CID Activation Method 20 | */ 21 | RowCompression("RowCompression", 0), 22 | 23 | /** 24 | * HCD Activation Method 25 | */ 26 | ColumnCompression("ColumnCompression", 1), 27 | 28 | ; 29 | 30 | /** 31 | * Activation Name 32 | */ 33 | private final String name; 34 | 35 | /** 36 | * Activation Description 37 | */ 38 | private final int code; 39 | 40 | /** 41 | * 构造函数 42 | * 43 | * @param name engine name 44 | * @param code engine code 45 | */ 46 | AirdEngine(String name, int code) { 47 | this.code = code; 48 | this.name = name; 49 | } 50 | 51 | /** 52 | * @return the name 53 | */ 54 | public String getName() { 55 | return name; 56 | } 57 | 58 | /** 59 | * @return the code 60 | */ 61 | public int getCode() { 62 | return code; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/enums/IonizationMod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.enums; 12 | 13 | public enum IonizationMod { 14 | 15 | ESI("ESI"), 16 | EI("EI"), 17 | ; 18 | 19 | String name; 20 | 21 | IonizationMod(String name) { 22 | this.name = name; 23 | } 24 | 25 | public String getName() { 26 | return name; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/enums/MsLevel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.enums; 12 | 13 | public enum MsLevel { 14 | MS1("MS1", 1), MS2("MS2", 2); 15 | 16 | String name; 17 | Integer code; 18 | 19 | MsLevel(String name, Integer code) { 20 | this.name = name; 21 | this.code = code; 22 | } 23 | 24 | public Integer getCode() { 25 | return code; 26 | } 27 | 28 | public String getName() { 29 | return name; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/enums/MsType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.enums; 12 | 13 | public enum MsType { 14 | 15 | PROFILE("PROFILE"), THRESHOLDED("THRESHOLDED"), CENTROIDED("CENTROIDED"), 16 | ; 17 | public String name; 18 | 19 | MsType(String name) { 20 | this.name = name; 21 | } 22 | 23 | public static MsType getType(String typeName) { 24 | return valueOf(typeName); 25 | } 26 | 27 | public String getName() { 28 | return name; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/enums/PolarityType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.enums; 12 | 13 | /** 14 | * Represents the polarity of ionization. 15 | */ 16 | public enum PolarityType { 17 | 18 | POSITIVE("POSITIVE", 1), NEGATIVE("NEGATIVE", -1), NEUTRAL("NEUTRAL", 0), 19 | ; 20 | 21 | private final int code; 22 | private final String name; 23 | 24 | PolarityType(String name, int code) { 25 | this.name = name; 26 | this.code = code; 27 | } 28 | 29 | public static PolarityType fromCode(int code) { 30 | for (PolarityType p : values()) { 31 | if (p.getCode() == code) { 32 | return p; 33 | } 34 | } 35 | return null; 36 | } 37 | 38 | public int getCode() { 39 | return code; 40 | } 41 | 42 | public String getName() { 43 | return name; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/enums/SortedIntCompType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.enums; 12 | 13 | public enum SortedIntCompType { 14 | 15 | /** 16 | * Integrated Binary Packing 17 | */ 18 | IBP(0, "IBP"), 19 | 20 | /** 21 | * Integrated Variable Byte 22 | */ 23 | IVB(1, "IVB"), 24 | /** 25 | * Delta trans with no integer compression algorithm 26 | */ 27 | Delta(2, "Delta"), 28 | 29 | Unknown(-999, "Unknown"), 30 | ; 31 | 32 | public String name; 33 | public int code; 34 | 35 | SortedIntCompType(int code, String name) { 36 | this.code = code; 37 | this.name = name; 38 | } 39 | 40 | public static SortedIntCompType getByName(String name) { 41 | for (SortedIntCompType value : values()) { 42 | if (value.getName().equals(name)) { 43 | return value; 44 | } 45 | } 46 | return SortedIntCompType.Unknown; 47 | } 48 | 49 | public String getName() { 50 | return name; 51 | } 52 | 53 | public int getCode() { 54 | return code; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/exception/ScanException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.exception; 12 | 13 | import net.csibio.aird.enums.ResultCodeEnum; 14 | 15 | /** 16 | * Scan Exception 17 | */ 18 | public class ScanException extends RuntimeException { 19 | 20 | private static final long serialVersionUID = 4564124491192825748L; 21 | 22 | /** 23 | * result code 24 | */ 25 | public ResultCodeEnum resultCode; 26 | 27 | /** 28 | * 构造函数 29 | */ 30 | public ScanException() { 31 | super(); 32 | } 33 | 34 | /** 35 | * 构造函数 36 | * 37 | * @param resultCode result code 38 | */ 39 | public ScanException(ResultCodeEnum resultCode) { 40 | super(resultCode.getMessage()); 41 | this.resultCode = resultCode; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/parser/DIAParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.parser; 12 | 13 | import net.csibio.aird.bean.AirdInfo; 14 | import net.csibio.aird.bean.Compressor; 15 | import net.csibio.aird.enums.AirdType; 16 | import net.csibio.aird.exception.ScanException; 17 | 18 | /** 19 | * DIA Parser 20 | */ 21 | public class DIAParser extends BaseParser { 22 | 23 | /** 24 | * 构造函数 25 | * 26 | * @param indexFilePath index file path 27 | * @throws ScanException scan exception 28 | */ 29 | public DIAParser(String indexFilePath) throws Exception { 30 | super(indexFilePath); 31 | } 32 | 33 | /** 34 | * 构造函数 35 | * 36 | * @param indexFilePath index file path 37 | * @param airdInfo airdInfo 38 | * @throws Exception exception 39 | */ 40 | public DIAParser(String indexFilePath, AirdInfo airdInfo) throws Exception { 41 | super(indexFilePath, airdInfo); 42 | } 43 | 44 | /** 45 | * 构造函数 46 | * 47 | * @param airdPath aird file path 48 | * @param mzCompressor mz compressor 49 | * @param intCompressor intensity compressor 50 | * @throws ScanException scan exception 51 | */ 52 | public DIAParser(String airdPath, Compressor mzCompressor, Compressor intCompressor) throws Exception { 53 | super(airdPath, mzCompressor, intCompressor, null, AirdType.DIA.getName()); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/parser/PRMParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.parser; 12 | 13 | import net.csibio.aird.bean.AirdInfo; 14 | import net.csibio.aird.exception.ScanException; 15 | 16 | /** 17 | * @see DIAParser PRM Parser now can be replaced by DIA Parser because the have the same inner logic 18 | * for spectra storage. 19 | */ 20 | public class PRMParser extends DIAParser { 21 | 22 | /** 23 | * 构造函数 24 | * 25 | * @param indexFilePath index file path 26 | * @throws ScanException scan exception 27 | */ 28 | public PRMParser(String indexFilePath) throws Exception { 29 | super(indexFilePath); 30 | } 31 | 32 | public PRMParser(String indexFilePath, AirdInfo airdInfo) throws Exception { 33 | super(indexFilePath, airdInfo); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/structure/SortInt.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | package net.csibio.aird.structure; 12 | 13 | import lombok.Data; 14 | 15 | /** 16 | * Try for Aird V2 17 | */ 18 | @Data 19 | public class SortInt implements Comparable { 20 | 21 | int number; 22 | Integer layer; //二进制表达,表示所在的原层数 23 | 24 | /** 25 | * 构造函数 26 | * 27 | * @param number how many number 28 | * @param layer the stack layers count 29 | */ 30 | public SortInt(int number, Integer layer) { 31 | this.number = number; 32 | this.layer = layer; 33 | } 34 | 35 | @Override 36 | public int compareTo(Object obj) { 37 | SortInt sortInt = (SortInt) obj; 38 | return this.number - sortInt.number; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/util/DataUtil.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.util; 2 | 3 | public class DataUtil { 4 | 5 | /** 6 | * 从Aird中读取的Intensity数据采用了一种特殊的转换规则,需要通过本函数转换 7 | * @param originIntensities 8 | * @param intPrecision 9 | * @return 10 | */ 11 | public static double[] parseIntensity(int[] originIntensities, double intPrecision){ 12 | double[] intensities = new double[originIntensities.length]; 13 | for (int i = 0; i < originIntensities.length; i++) { 14 | double intensity = originIntensities[i]; 15 | if (intensity < 0) { 16 | intensity = Math.pow(2, -intensity / 100000d); 17 | } 18 | intensities[i] = intensity / intPrecision; 19 | } 20 | return intensities; 21 | } 22 | 23 | public static double fetchIntensity(int origin, double intPrecision){ 24 | double intensity = origin; 25 | if (intensity < 0) { 26 | intensity = Math.pow(2, -intensity / 100000d); 27 | } 28 | return intensity / intPrecision; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/util/FileSizeUtil.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.util; 2 | 3 | import net.csibio.aird.bean.common.RawFileInfo; 4 | 5 | import java.io.File; 6 | import java.text.DecimalFormat; 7 | import java.util.TreeMap; 8 | 9 | public class FileSizeUtil { 10 | public static TreeMap sum(String folder) throws Exception { 11 | File root = new File(folder); 12 | TreeMap sizeMap = new TreeMap<>(); 13 | File[] files = root.listFiles(); 14 | if (files == null) { 15 | return sizeMap; 16 | } 17 | for (File file : files) { 18 | RawFileInfo raw = FileUtil.buildRawInfo(file.getPath()); 19 | if (raw != null) { 20 | sizeMap.merge(raw.getFileName(), raw.getFileSize(), Long::sum); 21 | } 22 | } 23 | return sizeMap; 24 | } 25 | 26 | public static String getSizeLabel(long size) { 27 | if (size == 0) { 28 | return "0"; 29 | } 30 | 31 | if (size < 1024) { 32 | return size + " Byte"; 33 | } 34 | 35 | DecimalFormat df = new DecimalFormat("#.##"); 36 | if (size < 1024 * 1024) { 37 | return df.format(size / 1024d) + "KB"; 38 | } 39 | 40 | if (size < 1024 * 1024 * 1024) { 41 | return df.format(size / 1024d / 1024) + "MB"; 42 | } 43 | 44 | return df.format(size / 1024d / 1024 / 1024) + "GB"; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /JavaSDK/src/main/java/net/csibio/aird/util/PrecisionUtil.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.util; 2 | 3 | public class PrecisionUtil { 4 | 5 | public static double trunc(double origin, double dp){ 6 | return Math.round(origin*dp)/dp; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /JavaSDK/src/test/java/net/csibio/aird/test/AirdV3Try/Compressor/AdaptiveIntegerCompressor.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.test.AirdV3Try.Compressor; 2 | 3 | import java.util.ArrayList; 4 | import java.util.HashMap; 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | public class AdaptiveIntegerCompressor { 9 | public static int[] encode(int[] data) { 10 | int[] freqMap = new int[data.length]; 11 | // 统计差分值出现的频率 12 | for (int diff : data) { 13 | freqMap[Math.abs(diff)]++; 14 | } 15 | 16 | int[] encoded = new int[data.length * 2]; 17 | int index = 0; 18 | for (int diff : data) { 19 | int length = String.valueOf(Math.abs(freqMap[Math.abs(diff)])).length(); 20 | encoded[index++] = length; 21 | encoded[index++] = diff; 22 | } 23 | return encoded; 24 | } 25 | 26 | public static int[] decode(int[] encoded) { 27 | int[] decoded = new int[encoded.length / 2]; 28 | for (int i = 0, j = 0; i < encoded.length; i += 2, j++) { 29 | int length = encoded[i]; 30 | int diff = encoded[i + 1]; 31 | decoded[j] = diff; 32 | } 33 | return decoded; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /JavaSDK/src/test/java/net/csibio/aird/test/AirdV3Try/Compressor/DeferencialEncodingIntegberCompressor.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.test.AirdV3Try.Compressor; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class DeferencialEncodingIntegberCompressor { 7 | public static int[] encode(int[] data) { 8 | int[] compressed = new int[data.length]; 9 | int prev = 0; 10 | for (int i = 0; i < data.length; i++) { 11 | int diff = data[i] - prev; 12 | compressed[i] = diff; 13 | prev = data[i]; 14 | } 15 | return compressed; 16 | } 17 | 18 | public static int[] decode(int[] compressed) { 19 | int[] decompressed = new int[compressed.length]; 20 | int prev = 0; 21 | for (int i = 0; i < compressed.length; i++) { 22 | int diff = compressed[i]; 23 | decompressed[i] = prev + diff; 24 | prev = decompressed[i]; 25 | } 26 | return decompressed; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /JavaSDK/src/test/java/net/csibio/aird/test/AirdV3Try/Compressor/PredictiveIntegerCompressor.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.test.AirdV3Try.Compressor; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class PredictiveIntegerCompressor { 7 | /** 8 | * 对数据进行预测编码 9 | * @param data 原始整形数据序列 10 | * @return 预测编码后的数据序列 11 | */ 12 | public static List encode(int[] data) { 13 | List encoded = new ArrayList<>(); 14 | int prev = 0; 15 | for (int num : data) { 16 | int predicted = prev; 17 | int error = num - predicted; 18 | encoded.add(error); 19 | prev = num; 20 | } 21 | return encoded; 22 | } 23 | 24 | /** 25 | * 对预测编码数据进行解码 26 | * @param encoded 预测编码后的数据序列 27 | * @return 解码后的原始整形数据序列 28 | */ 29 | public static int[] decode(List encoded) { 30 | int[] decoded = new int[encoded.size()]; 31 | int prev = 0; 32 | for (int i = 0; i < encoded.size(); i++) { 33 | int error = encoded.get(i); 34 | decoded[i] = prev + error; 35 | prev = decoded[i]; 36 | } 37 | return decoded; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /JavaSDK/src/test/java/net/csibio/aird/test/AirdV3Try/Compressor/QuadraticPredictioinIntegerCompressor.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.test.AirdV3Try.Compressor; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class QuadraticPredictioinIntegerCompressor { 7 | public static int[] encode(int[] data) { 8 | int[] encoded = new int[data.length]; 9 | int prev1 = 0, prev2 = 0; 10 | for (int i = 0; i < data.length; i++) { 11 | int predicted = getQuadraticPrediction(prev1, prev2); 12 | int error = data[i] - predicted; 13 | encoded[i] = error; 14 | prev2 = prev1; 15 | prev1 = data[i]; 16 | } 17 | return encoded; 18 | } 19 | 20 | public static int[] decode(int[] encoded) { 21 | int[] decoded = new int[encoded.length]; 22 | int prev1 = 0, prev2 = 0; 23 | for (int i = 0; i < encoded.length; i++) { 24 | int predicted = getQuadraticPrediction(prev1, prev2); 25 | int error = encoded[i]; 26 | decoded[i] = predicted + error; 27 | prev2 = prev1; 28 | prev1 = decoded[i]; 29 | } 30 | return decoded; 31 | } 32 | 33 | private static int getQuadraticPrediction(int prev1, int prev2) { 34 | return prev1 * 2 - prev2; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /JavaSDK/src/test/java/net/csibio/aird/test/AirdV3Try/Compressor/VariableIntegerCompressor.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.test.AirdV3Try.Compressor; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class VariableIntegerCompressor { 7 | public static int[] encode(int[] data) { 8 | int[] encoded = new int[data.length * 2]; 9 | int index = 0; 10 | for (int diff : data) { 11 | int length = String.valueOf(Math.abs(diff)).length(); 12 | encoded[index++] = length; 13 | encoded[index++] = diff; 14 | } 15 | return encoded; 16 | } 17 | 18 | public static int[] decode(int[] encoded) { 19 | int[] decoded = new int[encoded.length / 2]; 20 | for (int i = 0, j = 0; i < encoded.length; i += 2, j++) { 21 | int length = encoded[i]; 22 | int diff = encoded[i + 1]; 23 | decoded[j] = diff; 24 | } 25 | return decoded; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /JavaSDK/src/test/java/net/csibio/aird/test/AirdV3Try/Compressor/WaveCompressor.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.test.AirdV3Try.Compressor; 2 | 3 | import com.alibaba.fastjson2.JSON; 4 | import jwave.JWave; 5 | import jwave.Transform; 6 | import jwave.TransformBuilder; 7 | import jwave.transforms.AncientEgyptianDecomposition; 8 | import jwave.transforms.FastWaveletTransform; 9 | import jwave.transforms.wavelets.Wavelet; 10 | import jwave.transforms.wavelets.daubechies.Daubechies20; 11 | import jwave.transforms.wavelets.haar.Haar1; 12 | 13 | public class WaveCompressor { 14 | public static double[] encode(double[] mz) { 15 | // 创建小波变换实例 16 | Transform transform =new Transform( 17 | new AncientEgyptianDecomposition( 18 | new FastWaveletTransform( 19 | new Daubechies20( ) ) ) ); 20 | System.out.println(JSON.toJSON(mz)); 21 | double[] arrFreqOrHilb = transform.forward(mz); 22 | 23 | return arrFreqOrHilb; 24 | } 25 | 26 | 27 | } 28 | -------------------------------------------------------------------------------- /JavaSDK/src/test/java/net/csibio/aird/test/DIAPasefParserTest.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.test;/* 2 | * Copyright (c) 2020 CSi Biotech 3 | * AirdSDK and AirdPro are licensed under Mulan PSL v2. 4 | * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 | * You may obtain a copy of Mulan PSL v2 at: 6 | * http://license.coscl.org.cn/MulanPSL2 7 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 8 | * See the Mulan PSL v2 for more details. 9 | */ 10 | 11 | 12 | import com.alibaba.fastjson2.JSON; 13 | import java.math.BigDecimal; 14 | import java.util.ArrayList; 15 | import java.util.Comparator; 16 | import java.util.List; 17 | import java.util.TreeMap; 18 | import java.util.concurrent.atomic.AtomicLong; 19 | import java.util.stream.Collectors; 20 | import net.csibio.aird.bean.AirdInfo; 21 | import net.csibio.aird.bean.BlockIndex; 22 | import net.csibio.aird.bean.common.Spectrum; 23 | import net.csibio.aird.eic.Extractor; 24 | import net.csibio.aird.parser.DIAParser; 25 | import net.csibio.aird.parser.DIAPasefParser; 26 | import net.csibio.aird.util.FileUtil; 27 | import org.junit.Test; 28 | 29 | public class DIAPasefParserTest { 30 | 31 | @Test 32 | public void testReadFun() throws Exception { 33 | DIAPasefParser parser = new DIAPasefParser("D:\\MzmineTest\\PXD033904_PASEF\\Aird\\20220302_tims1_nElute_8cm_DOl_Phospho_7min_rep1_Slot1-94_1_1811.json"); 34 | AirdInfo airdInfo = parser.getAirdInfo(); 35 | for (BlockIndex blockIndex : airdInfo.getIndexList()) { 36 | TreeMap map = parser.getSpectra(blockIndex); 37 | System.out.println(map.size()); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /JavaSDK/src/test/java/net/csibio/aird/test/StackZDPDTest.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.test; 2 | 3 | 4 | import org.junit.Test; 5 | 6 | public class StackZDPDTest { 7 | 8 | @Test 9 | public void 测试读取时间() { 10 | assert 1 == 1; 11 | } 12 | 13 | @Test 14 | public void 测试读取时间1() { 15 | 16 | } 17 | 18 | @Test 19 | public void 测试读取时间2() { 20 | assert 1 == 1; 21 | } 22 | 23 | @Test 24 | public void 测试读取时间3() { 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /JavaSDK/src/test/java/net/csibio/aird/test/airdslice/EChartsSeries.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.test.airdslice; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class EChartsSeries { 7 | 8 | String name; 9 | double[] data; 10 | String type = "line"; 11 | 12 | public EChartsSeries(String name, double[] data){ 13 | this.name = name; 14 | this.data = data; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /JavaSDK/src/test/java/net/csibio/aird/test/airdslice/ReadAirdColumn2.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.test.airdslice; 2 | 3 | import net.csibio.aird.parser.ColumnParser; 4 | import org.junit.Test; 5 | 6 | public class ReadAirdColumn2 { 7 | 8 | static String filePath = "C:\\Users\\LMS\\Desktop\\8b73647b-ba05-473c-91e5-0546b88dc139.cjson"; 9 | 10 | 11 | // static double[] targets = new double[]{967.97259, 487.3524, 753.61337, 711.56642, 864.63014, 755.55625, 647.51225, 829.79845, 637.51225, 429.79845}; 12 | static double[] targets = new double[]{967.97259}; 13 | static double[] targets2 = new double[]{967.97259}; 14 | // double[] targets = new double[]{864.63014}; 15 | 16 | @Test 17 | public void speedTest() throws Exception { 18 | ColumnParser parser = new ColumnParser(filePath); 19 | long start = System.currentTimeMillis(); 20 | parser.calcXic(374.24475-0.015, 374.24475+0.015, null, null, null); 21 | System.out.println("Cost:" + (System.currentTimeMillis() - start)); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /JavaSDK/src/test/java/net/csibio/aird/test/airdslice/ReadProtoIndex.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.test.airdslice; 2 | 3 | import net.csibio.aird.parser.BaseParser; 4 | import net.csibio.aird.parser.ColumnParser; 5 | import net.csibio.aird.parser.DDAParser; 6 | import org.junit.Test; 7 | 8 | import java.io.IOException; 9 | 10 | public class ReadProtoIndex { 11 | 12 | public static String cindexPath = "D:\\Aird2.0\\32.cindex"; 13 | public static String cjsonIndexPath2 = "D:\\Aird2.0\\32.cjson"; 14 | public static String jsonPath = "D:\\Aird2.0\\33.json"; 15 | public static String indexPath = "D:\\Aird2.0\\33.index"; 16 | @Test 17 | public void readProtoIndex() throws Exception { 18 | ColumnParser columnParser = new ColumnParser(cindexPath); 19 | ColumnParser columnParser2 = new ColumnParser(cjsonIndexPath2); 20 | long start = System.currentTimeMillis(); 21 | BaseParser parser = new DDAParser(jsonPath); 22 | System.out.println("JSON Parse 时间:"+(System.currentTimeMillis() - start)); 23 | start = System.currentTimeMillis(); 24 | BaseParser parser2 = new DDAParser(indexPath); 25 | System.out.println("Protobuf Parse 时间:"+(System.currentTimeMillis() - start)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /JavaSDK/src/test/java/net/csibio/aird/test/compare/Peak.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.test.compare; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Peak { 7 | 8 | String group; 9 | float rt; 10 | float rtStart; 11 | float rtEnd; 12 | 13 | float mz; 14 | float mzStart; 15 | float mzEnd; 16 | 17 | float height; 18 | float area; 19 | 20 | float intMin; 21 | float intMax; 22 | 23 | @Override 24 | public boolean equals(Object arg0) { 25 | Peak o = (Peak) arg0; 26 | return Math.abs(this.mz - o.mz) <= 0.001 && Math.abs(this.rt - o.rt) <= 0.1; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /JavaSDK/src/test/java/net/csibio/aird/test/compressor/DeltaTest.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.test.compressor; 2 | 3 | import net.csibio.aird.compressor.Delta; 4 | import org.junit.Test; 5 | 6 | import java.util.Arrays; 7 | 8 | public class DeltaTest { 9 | 10 | @Test 11 | public void test() { 12 | int[] test = {1, 3, 44, 6, 7, 8, 93}; 13 | int[] temp = Delta.delta(test); 14 | int[] recover = Delta.recover(temp); 15 | assert Arrays.equals(test, recover); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /JavaSDK/src/test/java/net/csibio/aird/test/compressor/FastPFORTest.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.test.compressor; 2 | 3 | import net.csibio.aird.compressor.IntegratedXVByte; 4 | import net.csibio.aird.compressor.sortedintcomp.IntegratedBinPackingWrapper; 5 | import org.junit.Test; 6 | 7 | public class FastPFORTest { 8 | 9 | @Test 10 | public void test() { 11 | int size = 10; 12 | int[] test = new int[size]; 13 | for (int i = 0; i < size; i++) { 14 | test[i] = (int) (Math.random() * 1000); 15 | } 16 | int[] encode = new IntegratedBinPackingWrapper().encode(test); 17 | byte[] encode2 = new IntegratedXVByte().encode(test); 18 | 19 | int[] decode = new IntegratedBinPackingWrapper().decode(encode); 20 | int[] decode2 = new IntegratedXVByte().decode(encode2); 21 | System.out.println("Hello"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /JavaSDK/src/test/java/net/csibio/aird/test/compressor/XorTest.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.test.compressor; 2 | 3 | import net.csibio.aird.compressor.Xor; 4 | import org.junit.Test; 5 | 6 | import java.util.Arrays; 7 | 8 | public class XorTest { 9 | 10 | @Test 11 | public void test() { 12 | int[] test = {1, 1, 2}; 13 | int[] xor = Xor.xor(test); 14 | int[] recover = Xor.recover(xor); 15 | assert Arrays.equals(test, recover); 16 | } 17 | } -------------------------------------------------------------------------------- /JavaSDK/src/test/java/net/csibio/aird/test/compressor/测试MRMParser.java: -------------------------------------------------------------------------------- 1 | package net.csibio.aird.test.compressor; 2 | 3 | import net.csibio.aird.bean.AirdInfo; 4 | import net.csibio.aird.bean.common.MrmPair; 5 | import net.csibio.aird.parser.MRMParser; 6 | import org.junit.Test; 7 | 8 | import java.util.List; 9 | 10 | public class 测试MRMParser { 11 | 12 | @Test 13 | public void test() throws Exception { 14 | MRMParser MRMParser = new MRMParser("D:/iota_sp_gr_3-1.json"); 15 | AirdInfo airdInfo = MRMParser.getAirdInfo(); 16 | List 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 | --------------------------------------------------------------------------------