예제 #1
0
        private void LoadPeakScoreTable(StreamReader reader, double[][][] table)
        {
            var binLen = table[0][0].Length;

            while (true)
            {
                var line = reader.ReadLine();

                if (string.IsNullOrEmpty(line))
                {
                    break;
                }

                var tokens = line.Split(',');
                if (tokens.Length != 2)
                {
                    break;
                }

                var c = GetChargeIndex(int.Parse(tokens[0]));
                var m = MassBinning.GetBinIndex(double.Parse(tokens[1]));

                line = reader.ReadLine();
                var token = line.Split('\t');

                for (var j = 0; j < binLen; j++)
                {
                    table[c][m][j] = GetBoundedLkScore(token[j]);
                }
            }
        }
예제 #2
0
        private void LoadChargeScoreTable(StreamReader reader)
        {
            while (true)
            {
                var line = reader.ReadLine();
                if (string.IsNullOrEmpty(line))
                {
                    break;
                }

                //var tokens = line.Split(',');
                var m = MassBinning.GetBinIndex(double.Parse(line));

                line = reader.ReadLine();
                var token = line.Split('\t');

                for (var j = 0; j < ChargeBinLength; j++)
                {
                    ChargeScoreTable[m][j] = GetBoundedLkScore(token[j]);
                }
            }
        }
예제 #3
0
        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);
        }