public RankScore(ActivationMethod activationMethod, Ms2DetectorType ms2DetectorType, Enzyme enzyme, Protocol protocol) { if (activationMethod == ActivationMethod.HCD && enzyme == Enzyme.Trypsin) { var paramFile = Properties.Resources.HCD_Trypsin; var stream = new MemoryStream(); var writer = new StreamWriter(stream); writer.Write(paramFile); writer.Flush(); stream.Position = 0; _trainingParameters = new TrainingParameters(stream); } else { throw new ArgumentException("No parameter file available for selected arguments."); } }
public int GetActivationMethodIndex(ActivationMethod actMethod) { return (actMethod != ActivationMethod.ETD) ? 0 : 1; }
public double GetEdgeScore(ActivationMethod activationMethod, int charge1, double mass1, int charge2, double mass2) { var mzErrorPpm = (Math.Abs(mass1 - mass2)/mass1)*1e6; return GetEdgeScore(activationMethod, Math.Abs(charge1 - charge2), mzErrorPpm); }
public double GetEdgeScore(ActivationMethod activationMethod, int chargeDiff, double massErrorPpm) { return 0d; }
public double GetNodeScore(ActivationMethod activationMethod, bool isPrefix, double fragmentIonMass, int fragmentIonCharge, double corrScore, double distScore, double intensityScore, double massErrorPpm) { var score = GetNodeScoreWithoutMassError(activationMethod, isPrefix, fragmentIonMass, fragmentIonCharge, corrScore, distScore, intensityScore); score += GetMassErrorScore(massErrorPpm); return score; }
public double GetNodeScore(ActivationMethod activationMethod, bool isPrefix, double fragmentIonMass, DeconvolutedPeak matchedPeak, double refIntensity) { var massErrorPpm = 1e6 * ((matchedPeak.Mass - fragmentIonMass) / fragmentIonMass); return GetNodeScore(activationMethod, isPrefix, fragmentIonMass, matchedPeak.Charge, matchedPeak.Corr, matchedPeak.Dist, matchedPeak.Intensity / refIntensity, massErrorPpm); }
// minScanNum, maxScanNum, minCharge, maxCharge: inclusive public ProductSpectrum GetSummedMs2Spectrum(double monoIsotopicMass, int minScanNum, int maxScanNum, int minCharge, int maxCharge, ActivationMethod activationMethod = ActivationMethod.Unknown) { var isoEnv = Averagine.GetIsotopomerEnvelope(monoIsotopicMass); var ms2ScanNums = new List<int>(); for (var charge = minCharge; charge <= maxCharge; charge++) { var mostAbundantIsotopeMz = Ion.GetIsotopeMz(monoIsotopicMass, charge, isoEnv.MostAbundantIsotopeIndex); ms2ScanNums.AddRange(GetFragmentationSpectraScanNums(mostAbundantIsotopeMz) .Where(ms2ScanNum => ms2ScanNum >= minScanNum && ms2ScanNum <= maxScanNum && (activationMethod == ActivationMethod.Unknown || ((ProductSpectrum) GetSpectrum(ms2ScanNum)).ActivationMethod == activationMethod))) ; } var summedSpec = GetSummedSpectrum(ms2ScanNums); return new ProductSpectrum(summedSpec.Peaks, 0) {ActivationMethod = activationMethod}; }
public ChoEtl(ActivationMethod activationMethod) { _activationMethod = activationMethod; }
/// <summary> /// Get the scorer by scan number. /// </summary> /// <param name="scanNum">The scan number to get the scorer for.</param> /// <param name="precursorMass">The precursor mass to get the scorer for.</param> /// <param name="precursorCharge">The precursor charge to get the scorer for.</param> /// <param name="activationMethod">The activation method to get the scorer for.</param> /// <returns>The scorer selected based on the arguments.</returns> public IScorer GetScorer(int scanNum, double precursorMass = 0, int precursorCharge = 1, ActivationMethod activationMethod = ActivationMethod.Unknown) { IScorer scorer; if (this.scorerHash.ContainsKey(scanNum)) { scorer = this.scorerHash[scanNum]; } else { var parameters = this.scoringParameterSet.GetScoringParameters(activationMethod, precursorMass); scorer = new FlipScorer <DeconvolutedSpectrum>(parameters, this.lcmsRun.GetSpectrum(scanNum) as DeconvolutedSpectrum); this.scorerHash.Add(scanNum, scorer); } return(scorer); }
/// <summary> /// Get a summed MS2 spectrum from the dataset, with the provided limits /// </summary> /// <param name="monoIsotopicMass"></param> /// <param name="minScanNum">min scan number, inclusive</param> /// <param name="maxScanNum">max scan number, inclusive</param> /// <param name="minCharge">min charge, inclusive</param> /// <param name="maxCharge">max charge, inclusive</param> /// <param name="activationMethod"></param> /// <returns></returns> public ProductSpectrum GetSummedMs2Spectrum(double monoIsotopicMass, int minScanNum, int maxScanNum, int minCharge, int maxCharge, ActivationMethod activationMethod = ActivationMethod.Unknown) { var isoEnv = Averagine.GetIsotopomerEnvelope(monoIsotopicMass); var ms2ScanNums = new List <int>(); for (var charge = minCharge; charge <= maxCharge; charge++) { var mostAbundantIsotopeMz = Ion.GetIsotopeMz(monoIsotopicMass, charge, isoEnv.MostAbundantIsotopeIndex); ms2ScanNums.AddRange(GetFragmentationSpectraScanNums(mostAbundantIsotopeMz) .Where(ms2ScanNum => ms2ScanNum >= minScanNum && ms2ScanNum <= maxScanNum && (activationMethod == ActivationMethod.Unknown || ((ProductSpectrum)GetSpectrum(ms2ScanNum)).ActivationMethod == activationMethod))) ; } var summedSpec = GetSummedSpectrum(ms2ScanNums); return(new ProductSpectrum(summedSpec.Peaks, 0) { ActivationMethod = activationMethod }); }
/// <summary> /// Get the scorer by spectrum. /// This creates the scorer directly for that spectrum. It bypasses the scorer cache. /// </summary> /// <param name="spectrum">The spectrum number to get the scorer for.</param> /// <param name="precursorMass">The precursor mass to get the scorer for.</param> /// <param name="precursorCharge">The precursor charge to get the scorer for.</param> /// <returns>The scorer selected based on the arguments.</returns> public IScorer GetScorer(ProductSpectrum spectrum, double precursorMass, int precursorCharge, ActivationMethod activationMethod = ActivationMethod.Unknown) { var parameters = this.scoringParameterSet.GetScoringParameters(spectrum.ActivationMethod, precursorMass); var targetedDeconvolutedSpectrum = new TargetedDeconvolutedSpectrum(spectrum, 1, precursorCharge - 1); return(new FlipScorer <TargetedDeconvolutedSpectrum>(parameters, targetedDeconvolutedSpectrum)); }
public FastCsvParser(ActivationMethod activationMethod) { _activationMethod = activationMethod; }
public TxtCsvHelper(ActivationMethod activationMethod) { _activationMethod = activationMethod; }
public double GetNodeScoreWithoutMassError(ActivationMethod activationMethod, bool isPrefix, DeconvolutedPeak matchedPeak, double refIntensity) { return GetNodeScoreWithoutMassError(activationMethod, isPrefix, matchedPeak.Mass, matchedPeak.Charge, matchedPeak.Corr, matchedPeak.Dist, matchedPeak.Intensity / refIntensity); }
public Precursor() { Ions = new List<SelectedIon>(); IsolationWindowTargetMz = 0.0; IsolationWindowLowerOffset = 0.0; IsolationWindowUpperOffset = 0.0; Activation = ActivationMethod.Unknown; }
public double GetNodeScoreWithoutMassError(ActivationMethod activationMethod, bool isPrefix, double fragmentIonMass, int fragmentIonCharge, double corrScore, double distScore, double intensityScore) { var m = MassBinning.GetBinIndex(fragmentIonMass); var c = GetChargeIndex(fragmentIonCharge); var a = GetActivationMethodIndex(activationMethod); var t = GetIonTypeIndex(isPrefix); var ci = CorrBinning.GetBinIndex(corrScore); var di = DistBinning.GetBinIndex(distScore); var ii = IntensityBinning.GetBinIndex(intensityScore); var score = IonTypeScoreTable[a][t]; score += MassScoreTable[a][t][m]; score += ChargeScoreTable[m][c]; score += CorrScoreTable[c][m][ci]; score += DistScoreTable[c][m][di]; score += IntensityScoreTable[c][m][ii]; return score; }
public CommonLibrary_NET(ActivationMethod activationMethod) { _activationMethod = activationMethod; }