Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/MSDIAL4/MsDial/MSDIAL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
<ItemGroup>
<_DeployToItem Include="$(TargetDir)\*.lbm*" />
</ItemGroup>
<DownloadFile SourceUrl="$(Lbm2Url)" DestinationFolder="$(TargetDir)" Condition="!Exists('%(_DeployToItem.FullPath)')" />
<DownloadFile SourceUrl="$(Lbm2Url)" DestinationFolder="$(TargetDir)" Condition="!Exists('%(_DeployToItem.FullPath)')" ContinueOnError="true"/>
<Exec Command="xcopy &quot;$(ProjectDir)CytoscapeLocalBrowser&quot; &quot;$(TargetDir)CytoscapeLocalBrowser&quot; /D/E/C/I/H/Y" />
</Target>
</Project>
</Project>
4 changes: 4 additions & 0 deletions src/MSDIAL5/MsdialCore/Utility/DataObjConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ public static void SetRepresentativeProperty(AlignmentSpotProperty spot) {
Mz = new MzValue(spot.MassCenter, representative.ChromXsTop.Mz.Unit),
Drift = new DriftTime(alignedPeaks.Average(peak => peak.ChromXsTop.Drift.Value), representative.ChromXsTop.Drift.Unit),
};

if (spot.QuantMass > 0) {
spot.MassCenter = spot.QuantMass;
}
Comment on lines +178 to +180
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SetRepresentativeProperty builds spot.TimesCenter (including Mz) using the current spot.MassCenter, but then conditionally overwrites spot.MassCenter with spot.QuantMass. This can leave TimesCenter.Mz inconsistent with MassCenter (and with the value later used as the spot's m/z). Consider moving the QuantMass→MassCenter assignment before constructing TimesCenter, or also updating spot.TimesCenter.Mz when MassCenter is overwritten (and ensure any dependent mass fields stay consistent).

Copilot uses AI. Check for mistakes.
}

public static AlignmentChromPeakFeature? GetRepresentativePeak(IReadOnlyList<AlignmentChromPeakFeature> alignment) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ private List<AlignmentSpotProperty> ResetQuantMasses(List<AlignmentSpotProperty>
var reference = _refer.Refer(spot.MatchResults.Representative);
if (reference is not null && _parameter.PeakPickBaseParam.IsInMassRange(reference.QuantMass)) {
spot.MassCenter = reference.QuantMass;
spot.QuantMass = reference.QuantMass;
results.Add(spot);
continue;
}
Expand All @@ -90,6 +91,7 @@ private List<AlignmentSpotProperty> ResetQuantMasses(List<AlignmentSpotProperty>

if (_parameter.IsRepresentativeQuantMassBasedOnBasePeakMz) {
spot.QuantMass = msdec.Spectrum.Argmax(s => s.Intensity).Mass;
spot.MassCenter = spot.QuantMass;
results.Add(spot);
continue;
}
Expand All @@ -110,7 +112,7 @@ private List<AlignmentSpotProperty> ResetQuantMasses(List<AlignmentSpotProperty>
else {
spot.QuantMass = msdec.Spectrum.Argmax(s => s.Intensity).Mass;
}

spot.MassCenter = spot.QuantMass;
results.Add(spot);
}
var counter = 0;
Expand Down
Loading