Ejemplo n.º 1
0
        private AlignmentResult getResultsForAlignment(clsAlignmentProcessor processor)
        {
            float[] scanLCValues = null;
            float[] NETValues    = null;

            float[,] scores = null;

            processor.GetAlignmentHeatMap(ref scores, ref scanLCValues, ref NETValues);

            var result = new AlignmentResult();

            result.ScanLCValues           = scanLCValues;
            result.NETValues              = NETValues;
            result.AlignmentHeatmapScores = scores;


            //get massResiduals_vs_scan and massResiduals_vs_m/z
            var residuals = processor.GetResidualData();


            result.Mass_vs_scan_ResidualsBeforeAlignment = residuals.massError;
            result.Mass_vs_scan_ResidualsAfterAlignment  = residuals.massErrorCorrected;
            result.Mass_vs_scan_ResidualsScanValues      = residuals.scans;


            result.Mass_vs_mz_ResidualsBeforeAlignment = residuals.mzMassError;
            result.Mass_vs_mz_ResidualsAfterAlignment  = residuals.mzMassErrorCorrected;
            result.Mass_vs_mz_ResidualsMZValues        = residuals.mz;


            //get stats on variability
            result.NETStDev    = processor.GetNETStandardDeviation();
            result.NETAverage  = processor.GetNETMean();
            result.MassAverage = processor.GetMassMean();
            result.MassStDev   = processor.GetMassStandardDeviation();

            double[,] massHistogramData  = null;
            double[,] netHistogramData   = null;
            double[,] driftHistogramData = null;
            processor.GetErrorHistograms(0.1, 0.002, 0.1, ref massHistogramData, ref netHistogramData, ref driftHistogramData);

            result.massHistogramData = massHistogramData;
            result.NETHistogramData  = netHistogramData;


            return(result);
        }
Ejemplo n.º 2
0
        public clsAlignmentFunction GetAlignment(List <TargetBase> massTagList, List <TargetedResultDTO> featuresToAlign)
        {
            var multialignMassTagDB = new clsMassTagDB();

            //TODO: I might be able to dynamically update these values. Take my foundFeatures and calculate their avg PPMDiff. Then use that info here.
            var alignmentOptions = new clsAlignmentOptions();

            alignmentOptions.MassCalibrationWindow         = this.AlignerParameters.MassCalibrationWindow; //note -  it seems that 50 ppm is used as a default setting in VIPER.
            alignmentOptions.ContractionFactor             = this.AlignerParameters.ContractionFactor;
            alignmentOptions.IsAlignmentBaselineAMasstagDB = this.AlignerParameters.IsAlignmentBaselineAMassTagDB;
            alignmentOptions.MassBinSize = this.AlignerParameters.MassBinSize;
            alignmentOptions.MassCalibrationLSQNumKnots      = this.AlignerParameters.MassCalibrationLSQNumKnots;
            alignmentOptions.MassCalibrationLSQZScore        = this.AlignerParameters.MassCalibrationLSQZScore;
            alignmentOptions.MassCalibrationMaxJump          = this.AlignerParameters.MassCalibrationMaxJump;
            alignmentOptions.MassCalibrationMaxZScore        = this.AlignerParameters.MassCalibrationMaxZScore;
            alignmentOptions.MassCalibrationNumMassDeltaBins = this.AlignerParameters.MassCalibrationNumMassDeltaBins;
            alignmentOptions.MassCalibrationNumXSlices       = this.AlignerParameters.MassCalibrationNumXSlices;
            alignmentOptions.MassCalibrationUseLSQ           = this.AlignerParameters.MassCalibrationUseLSQ;
            alignmentOptions.MassCalibrationWindow           = this.AlignerParameters.MassCalibrationWindow;
            alignmentOptions.MassTolerance        = this.AlignerParameters.MassToleranceForNETAlignment;
            alignmentOptions.MaxPromiscuity       = this.AlignerParameters.MaxPromiscuity;
            alignmentOptions.MaxTimeJump          = this.AlignerParameters.MaxTimeJump;
            alignmentOptions.NETBinSize           = this.AlignerParameters.NETBinSize;
            alignmentOptions.NETTolerance         = this.AlignerParameters.NETTolerance;
            alignmentOptions.NumTimeSections      = this.AlignerParameters.NumTimeSections;
            alignmentOptions.UsePromiscuousPoints = this.AlignerParameters.UsePromiscuousPoints;

            var processor = new clsAlignmentProcessor();

            processor.AlignmentOptions = alignmentOptions;


            var multiAlignMassTags = convertDeconToolsMassTagsToMultialignMassTags(massTagList);

            multialignMassTagDB.AddMassTags(multiAlignMassTags);
            processor.SetReferenceDatasetFeatures(multialignMassTagDB);

            var multialignUMCs = convertDeconToolsLCMSFeaturesToMultialignFeatures(featuresToAlign);

            processor.SetAligneeDatasetFeatures(multialignUMCs, alignmentOptions.MZBoundaries[0]);
            processor.PerformAlignmentToMSFeatures();

            this.Result = getResultsForAlignment(processor);


            return(processor.GetAlignmentFunction());
        }
Ejemplo n.º 3
0
        public clsAlignmentFunction GetAlignment(List <MassTag> massTagList, List <TargetedResult> featuresToAlign)
        {
            clsMassTagDB multialignMassTagDB = new clsMassTagDB();

            //TODO: figure out which options I need to parameterize in this class. For now, use defaults
            clsAlignmentOptions   alignmentOptions = new clsAlignmentOptions();
            clsAlignmentProcessor processor        = new clsAlignmentProcessor();


            clsMassTag[] multiAlignMassTags = convertDeconToolsMassTagsToMultialignMassTags(massTagList);

            multialignMassTagDB.AddMassTags(multiAlignMassTags);
            processor.SetReferenceDatasetFeatures(multialignMassTagDB);

            List <clsUMC> multialignUMCs = convertDeconToolsLCMSFeaturesToMultialignFeatures(featuresToAlign);

            processor.SetAligneeDatasetFeatures(multialignUMCs, alignmentOptions.MZBoundaries[0]);
            processor.PerformAlignmentToMSFeatures();

            return(processor.GetAlignmentFunction());
        }