Beispiel #1
0
        /// <summary>
        /// Aligns to a mass tag database.  The baseline provider should be able to convert a mass tag sequence into a theoretical spectrum.
        /// </summary>
        /// <param name="baseline"></param>
        /// <param name="alignee"></param>
        /// <returns></returns>
        public IEnumerable <SpectralAnchorPointMatch> Align(MassTagDatabase baseline,
                                                            IEnumerable <UMCLight> alignee, IProgress <ProgressData> progress = null)
        {
            OnProgress("Finding anchor point matches");
            var finder  = new SpectralAnchorPointFinder();
            var matches = finder.FindAnchorPoints(BaselineSpectraProvider as ISpectraProvider,
                                                  AligneeSpectraProvider as ISpectraProvider,
                                                  SpectralComparer,
                                                  Filter,
                                                  Options);

            OnProgress("Creating Alignment Functions");
            var aligner = new SpectralAnchorPointAligner();
            var spectralAnchorPointMatches = matches as SpectralAnchorPointMatch[] ?? matches.ToArray();

            //TODO: Brian modified to test alignment using LCMSWarp regression code.
            aligner.CreateAlignmentFunctions(spectralAnchorPointMatches);

            OnProgress("Transforming sub-features");
            foreach (var feature in alignee)
            {
                feature.NetAligned = feature.Net; // aligner.AlignNet(feature.Net);
            }

            return(spectralAnchorPointMatches);
        }
Beispiel #2
0
        /// <summary>
        /// Aligns two feature datasets.
        /// </summary>
        /// <param name="baseline"></param>
        /// <param name="alignee"></param>
        /// <returns></returns>
        public IEnumerable <SpectralAnchorPointMatch> Align(IEnumerable <UMCLight> baseline,
                                                            IEnumerable <UMCLight> alignee, IProgress <ProgressData> progress = null)
        {
            OnProgress("Finding anchor point matches");
            var finder  = new SpectralAnchorPointFinder();
            var matches = finder.FindAnchorPoints(BaselineSpectraProvider as ISpectraProvider,
                                                  AligneeSpectraProvider as ISpectraProvider,
                                                  SpectralComparer,
                                                  Filter,
                                                  Options);

            OnProgress("Creating Alignment Functions");
            var aligner = new SpectralAnchorPointAligner(Bandwidth);
            var spectralAnchorPointMatches = matches as SpectralAnchorPointMatch[] ?? matches.ToArray();

            aligner.CreateAlignmentFunctions(spectralAnchorPointMatches);

            OnProgress("Transforming sub-features");
            foreach (var feature in alignee)
            {
                feature.NetAligned = aligner.AlignNet(feature.Net);
                feature.Net        = feature.NetAligned;
                feature.MassMonoisotopicAligned = aligner.AlignMass(feature.MassMonoisotopic);
            }

            return(spectralAnchorPointMatches);
        }