/// <summary> /// Define custom SIC list values /// </summary> /// <param name="eScanType"></param> /// <param name="scanOrAcqTimeToleranceValue"></param> /// <param name="mzSearchSpecs"></param> /// <returns>True if success, false if error</returns> public bool SetCustomSICListValues( eCustomSICScanTypeConstants eScanType, float scanOrAcqTimeToleranceValue, List <clsCustomMZSearchSpec> mzSearchSpecs) { ResetMzSearchValues(); ScanToleranceType = eScanType; // This value is used if scanOrAcqTimeToleranceList is blank or for any entries in scanOrAcqTimeToleranceList() that are zero ScanOrAcqTimeTolerance = scanOrAcqTimeToleranceValue; if (mzSearchSpecs.Count == 0) { return(true); } foreach (var mzSearchSpec in mzSearchSpecs) { AddMzSearchTarget(mzSearchSpec); } ValidateCustomSICList(); return(true); }
public bool SetCustomSICListValues( eCustomSICScanTypeConstants eScanType, double mzToleranceDa, float scanOrAcqTimeToleranceValue, double[] mzList, double[] mzToleranceList, float[] scanOrAcqTimeCenterList, float[] scanOrAcqTimeToleranceList, string[] scanComments) { if (mzToleranceList.Length > 0 && mzToleranceList.Length != mzList.Length) { // Invalid Custom SIC comment list; number of entries doesn't match return(false); } if (scanOrAcqTimeCenterList.Length > 0 && scanOrAcqTimeCenterList.Length != mzList.Length) { // Invalid Custom SIC scan center list; number of entries doesn't match return(false); } if (scanOrAcqTimeToleranceList.Length > 0 && scanOrAcqTimeToleranceList.Length != mzList.Length) { // Invalid Custom SIC scan center list; number of entries doesn't match return(false); } if (scanComments.Length > 0 && scanComments.Length != mzList.Length) { // Invalid Custom SIC comment list; number of entries doesn't match return(false); } ResetMzSearchValues(); ScanToleranceType = eScanType; // This value is used if scanOrAcqTimeToleranceList is blank or for any entries in scanOrAcqTimeToleranceList() that are zero ScanOrAcqTimeTolerance = scanOrAcqTimeToleranceValue; if (mzList.Length == 0) { return(true); } for (var index = 0; index < mzList.Length; index++) { var mzSearchSpec = new clsCustomMZSearchSpec(mzList[index]); if (mzToleranceList.Length > index && mzToleranceList[index] > 0) { mzSearchSpec.MZToleranceDa = mzToleranceList[index]; } else { mzSearchSpec.MZToleranceDa = mzToleranceDa; } if (scanOrAcqTimeCenterList.Length > index) { mzSearchSpec.ScanOrAcqTimeCenter = scanOrAcqTimeCenterList[index]; } else { mzSearchSpec.ScanOrAcqTimeCenter = 0; } // Set to 0 to indicate that the entire file should be searched if (scanOrAcqTimeToleranceList.Length > index && scanOrAcqTimeToleranceList[index] > 0) { mzSearchSpec.ScanOrAcqTimeTolerance = scanOrAcqTimeToleranceList[index]; } else { mzSearchSpec.ScanOrAcqTimeTolerance = scanOrAcqTimeToleranceValue; } if (scanComments.Length > 0 && scanComments.Length > index) { mzSearchSpec.Comment = scanComments[index]; } else { mzSearchSpec.Comment = string.Empty; } AddMzSearchTarget(mzSearchSpec); } ValidateCustomSICList(); return(true); }