diff --git a/LipidCreator/Lipid.cs b/LipidCreator/Lipid.cs index 5e673a2..cc0f84d 100644 --- a/LipidCreator/Lipid.cs +++ b/LipidCreator/Lipid.cs @@ -306,13 +306,13 @@ public static void computeFragmentData(DataTable transitionList, PrecursorData p string adduct = LipidCreator.computeAdductFormula(null, precursorData.precursorAdduct); if (monitoringType == MonitoringTypes.PRM) { - lipidRowPrecursor[LipidCreator.COLLISION_ENERGY] = CE.ToString(CultureInfo.InvariantCulture); + lipidRowPrecursor[LipidCreator.COLLISION_ENERGY] = CE >= 0 ? CE.ToString(CultureInfo.InvariantCulture) : ""; } else if (monitoringType == MonitoringTypes.SRM) { double ceValue = collisionEnergyHandler.getApex(instrument, lipidClass, adduct, "precursor"); - if (ceValue != -1) ceValue = Math.Max(Math.Min(maxCE, ceValue), minCE); - lipidRowPrecursor[LipidCreator.COLLISION_ENERGY] = ceValue.ToString(CultureInfo.InvariantCulture); + ceValue = Math.Max(Math.Min(maxCE, ceValue), minCE); + lipidRowPrecursor[LipidCreator.COLLISION_ENERGY] = (ceValue >= 0) ? ceValue.ToString(CultureInfo.InvariantCulture) : ""; } } } @@ -457,13 +457,13 @@ public static void computeFragmentData(DataTable transitionList, PrecursorData p string adduct = LipidCreator.computeAdductFormula(null, precursorData.precursorAdduct); if (monitoringType == MonitoringTypes.PRM) { - lipidRow[LipidCreator.COLLISION_ENERGY] = CE.ToString(CultureInfo.InvariantCulture); + lipidRow[LipidCreator.COLLISION_ENERGY] = CE >= 0 ? CE.ToString(CultureInfo.InvariantCulture) : ""; } else if (monitoringType == MonitoringTypes.SRM) { double ceValue = collisionEnergyHandler.getApex(instrument, lipidClass, adduct, fragName); - if (ceValue != -1) ceValue = Math.Max(Math.Min(maxCE, ceValue), minCE); - lipidRow[LipidCreator.COLLISION_ENERGY] = ceValue.ToString(CultureInfo.InvariantCulture); + ceValue = Math.Max(Math.Min(maxCE, ceValue), minCE); + lipidRow[LipidCreator.COLLISION_ENERGY] = ceValue >= 0 ? ceValue.ToString(CultureInfo.InvariantCulture) : ""; } } }