/// <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) { OnProgress("Finding anchor point matches"); var finder = new SpectralAnchorPointFinder(); var matches = finder.FindAnchorPoints(BaselineSpectraProvider, AligneeSpectraProvider, 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); }
/// <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) { OnProgress("Finding anchor point matches"); var finder = new SpectralAnchorPointFinder(); var matches = finder.FindAnchorPoints(BaselineSpectraProvider, AligneeSpectraProvider, 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); }