/// <summary>
 /// Initializes a new instance of the <see cref="MolecularTarget"/> class.
 /// </summary>
 /// <param name="targetMz">
 /// The Target MZ.
 /// </param>
 /// <param name="ionization">
 /// The ionization.
 /// </param>
 /// <param name="correspondingChemical">
 /// The CorrespondingChemical Identifier.
 /// </param>
 public MolecularTarget(double targetMz, IonizationMethod ionization, string correspondingChemical)
 {
     this.MassWithAdduct = targetMz;
     this.TargetType = TargetType.Molecule;
     this.Adduct = new IonizationAdduct(ionization);
     this.correspondingChemical = correspondingChemical;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DriftTimeTarget"/> class for molercules
 /// </summary>
 /// <param name="libraryEntryName">
 /// The library Entry Name.
 /// </param>
 /// <param name="normalizedDriftTimeInMs">
 /// The drift time.
 /// </param>
 /// <param name="empiricalFormula">
 /// The empirical formula.
 /// </param>
 /// <param name="ionizationMethod">
 /// The ionization method.
 /// </param>
 /// <param name="adductMultiplier">
 /// The adduct Multiplier.
 /// </param>
 public DriftTimeTarget(string libraryEntryName, double normalizedDriftTimeInMs, string empiricalFormula, IonizationMethod ionizationMethod, int adductMultiplier = 1)
     : base(empiricalFormula, ionizationMethod, libraryEntryName, adductMultiplier)
 {
     this.NormalizedDriftTimeInMs = normalizedDriftTimeInMs;
     this.TargetType = TargetType.MoleculeWithKnownDriftTime;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MolecularTarget"/> class.
 /// </summary>
 /// <param name="empiricalFormula">
 /// The empirical formula.
 /// </param>
 /// <param name="ionization">
 /// The ionization.
 /// </param>
 /// <param name="correspondingChemical">
 /// </param>
 /// <param name="adductMultiplier">
 /// The adductMultiplier.
 /// </param>
 public MolecularTarget(string empiricalFormula, IonizationMethod ionization, string correspondingChemical, int adductMultiplier = 1)
 {
     this.correspondingChemical = correspondingChemical;
     IonizationAdduct adduct = new IonizationAdduct(ionization, adductMultiplier);
     this.Setup(empiricalFormula, adduct);
 }
        public int TestTargetDetectionWithIsomersClean(string formula, IonizationMethod method, string descriptor, string fileLocation)
        {
            MolecularTarget sample1 = new MolecularTarget(formula, method, descriptor);

            CrossSectionSearchParameters parameters1 = new CrossSectionSearchParameters(CrossSectionSearchParameters.DefaultDriftTimeToleranceInMs, CrossSectionSearchParameters.DefaultMzWindowHalfWidthInPpm,
                CrossSectionSearchParameters.DefaultNumPointForSmoothing, CrossSectionSearchParameters.DefaultFeatureFilterLevel, CrossSectionSearchParameters.DefaultAbsoluteIntensityThreshold, CrossSectionSearchParameters.DefaultPeakShapeThreshold, CrossSectionSearchParameters.DefaultIsotopicThreshold, CrossSectionSearchParameters.DefaultMaxOutliers, CrossSectionSearchParameters.DefaultPeakDetectorSelection, FitlineEnum.OrdinaryLeastSquares, CrossSectionSearchParameters.DefaultMinR2, CrossSectionSearchParameters.DefaultRelativeIntensityPercentageThreshold, "png", CrossSectionSearchParameters.DefaultInsufficientFramesFraction, testDriftTubeLength, true);

            CrossSectionWorkfow workfow1 = new CrossSectionWorkfow(fileLocation, "output", parameters1);
            CrossSectionWorkflowResult results1 = workfow1.RunCrossSectionWorkFlow(sample1, true);
            int count = results1.IdentifiedIsomers.Count();
            workfow1.Dispose();
            return count;
        }