Skip to content

Commit

Permalink
离子淌度压缩率整体提升10%
Browse files Browse the repository at this point in the history
  • Loading branch information
lumiaoshan committed Apr 12, 2024
1 parent 549ca9f commit 0b81db0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
13 changes: 7 additions & 6 deletions AirdPro/Algorithms/Compressor/PwizComp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -311,21 +311,22 @@ public override void CompressMobility(Spectrum spectrum, TempScan ts)
return;
}

TimsData[] dataArray = new TimsData[size];
List<TimsData> dataList = new List<TimsData>();
for (int t = 0; t < size; t++)
{
dataArray[t] = new TimsData(MobiDict[mobiData[t]], mzData[t], intData[t]);
dataList.Add(new TimsData(MobiDict[mobiData[t]], mzData[t], intData[t]));
}

Array.Sort(dataArray, (p1, p2) => p1.mz.CompareTo(p2.mz));
List<TimsData> sortedDataList = dataList.OrderBy(d => d.mz).ThenBy(d => d.mobilityNo).ToList();

int[] mzArray = new int[size];
int[] intensityArray = new int[size];
int[] mobilityNoArray = new int[size];
for (int i = 0; i < size; i++)
{
mzArray[i] = DataUtil.FetchMz(dataArray[i].mz, MzPrecision);
intensityArray[i] = DataUtil.FetchIntensity(dataArray[i].intensity, IntensityPrecision);
mobilityNoArray[i] = dataArray[i].mobilityNo;
mzArray[i] = DataUtil.FetchMz(sortedDataList[i].mz, MzPrecision);
intensityArray[i] = DataUtil.FetchIntensity(sortedDataList[i].intensity, IntensityPrecision);
mobilityNoArray[i] = sortedDataList[i].mobilityNo;
}

byte[] compressedMzArray = ComboComp.encode(MzIntComp, MzByteComp, mzArray);
Expand Down
9 changes: 1 addition & 8 deletions AirdPro/Converters/PwizConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ public void PredictAcquisitionMethod()
}
catch (Exception e)
{
Console.WriteLine("Chromatogram Reading Failed:"+e.Message);
Console.WriteLine("Chromatogram Reading Failed:" + e.Message);
}
}

Expand Down Expand Up @@ -829,13 +829,6 @@ protected MsIndex ParseMs1(Spectrum spectrum, int index)

using (Scan scan = spectrum.scanList.scans[0])
{
// ms1.cvs = CVUtil.trans(spectrum.cvParams);
//将对应scan的cvParams也冗余到ms1上来
// if (scan.cvParams != null)
// {
// ms1.cvs.AddRange(CVUtil.trans(scan.cvParams));
// }

ms1.filterString = CVUtil.ParseFilterString(scan, JobInfo);
ms1.rt = CVUtil.ParseRt(scan, JobInfo);
ms1.tic = CVUtil.ParseTic(spectrum);
Expand Down

0 comments on commit 0b81db0

Please sign in to comment.