Esempio n. 1
0
        /// <summary>
        /// Uses a list of MassTagLights as a baseline for aligning a list of UMCLights to it, using
        /// the passed in options for processor options as well as a boolean for whether to align based on
        /// Drift Times as well.
        /// Creates an LCMS Alignment processor to do the alignment, does the alignment, and then passes
        /// back the alignment data to the caller.
        /// </summary>
        /// <param name="massTags"></param>
        /// <param name="aligneeFeatures"></param>
        /// <param name="options"></param>
        /// <returns></returns>
        private LcmsWarpAlignmentData AlignFeatures(List <MassTagLight> massTags, List <UMCLight> aligneeFeatures,
                                                    LcmsWarpAlignmentOptions options)
        {
            var alignmentProcessor = new LcmsWarpAlignmentProcessor
            {
                Options = options
            };

            alignmentProcessor.ApplyAlignmentOptions();
            alignmentProcessor.Progress += alignmentProcessor_Progress;

            var featureTest = aligneeFeatures.Find(x => x.DriftTime > 0);
            var massTagTest = massTags.Find(x => x.DriftTime > 0);

            if (featureTest != null && massTagTest == null)
            {
                Console.WriteLine("Warning! Data has drift time info, but the mass tags do not.");
            }

            alignmentProcessor.SetReferenceDatasetFeatures(massTags);

            var data = AlignFeatures(alignmentProcessor, aligneeFeatures, options);

            return(data);
        }
Esempio n. 2
0
        /// <summary>
        /// Uses a list of UMCLights as a baseline for aligning a second list of UMCLights to it, using
        /// the passed in options for processor options
        /// Creates an LCMS Alignment processor to do the alignment, does the alignment, and then passes
        /// back the alignment data to the caller.
        /// </summary>
        /// <param name="baseline"></param>
        /// <param name="aligneeFeatures"></param>
        /// <param name="options"></param>
        /// <returns></returns>
        private LcmsWarpAlignmentData AlignFeatures(List <UMCLight> baseline, List <UMCLight> aligneeFeatures, LcmsWarpAlignmentOptions options)
        {
            var alignmentProcessor = new LcmsWarpAlignmentProcessor
            {
                Options = options
            };

            alignmentProcessor.ApplyAlignmentOptions();
            alignmentProcessor.Progress += alignmentProcessor_Progress;

            var filteredBaselineFeatures = FilterFeaturesByAbundance(baseline, options) as List <UMCLight>;

            alignmentProcessor.SetReferenceDatasetFeatures(filteredBaselineFeatures);

            return(AlignFeatures(alignmentProcessor, aligneeFeatures, options));
        }