/** * 使用直接的关键信息进行初始化 * * @param airdPath Aird文件路径 * @param mzCompressor mz压缩策略 * @param intCompressor intensity压缩策略 * @param mzPrecision mz数字精度 * @param airdType aird类型 * @throws ScanException 扫描异常 */ public BaseParser(String airdPath, Compressor mzCompressor, Compressor intCompressor, int mzPrecision, String airdType) { var indexFile = FileNameUtil.getIndexPathByAirdPath(airdPath); airdInfo = AirdScanUtil.loadAirdInfo(indexFile); try { airdFile = File.OpenRead(airdPath); } catch (FileNotFoundException e) { Console.WriteLine(e.ToString()); Console.Write(e.StackTrace); throw new Exception(ResultCodeEnum.AIRD_FILE_PARSE_ERROR.Message); } this.mzCompressor = mzCompressor; this.intCompressor = intCompressor; this.mzPrecision = mzPrecision; this.type = airdType; }
public BaseParser(string indexPath) { airdInfo = AirdScanUtil.loadAirdInfo(indexPath); if (airdInfo == null) { throw new Exception(ResultCodeEnum.AIRD_INDEX_FILE_PARSE_ERROR.Message); } try { airdFile = File.OpenRead(FileNameUtil.getAirdPathByIndexPath(indexPath)); } catch (FileNotFoundException e) { Console.WriteLine(e.ToString()); Console.Write(e.StackTrace); throw new Exception(ResultCodeEnum.AIRD_FILE_PARSE_ERROR.Message); } mzCompressor = CompressUtil.getMzCompressor(airdInfo.compressors); intCompressor = CompressUtil.getIntCompressor(airdInfo.compressors); mzPrecision = mzCompressor.precision; type = airdInfo.type; }