コード例 #1
0
        protected override string GetValue(SapPredicted predict)
        {
            var fs = predict.Ms2.FileScans.FirstOrDefault(m => expectScans.ContainsKey(m.LongFileName));

            predict.Expect = fs != null ? new TargetVariant()
            {
                Source = expectScans[fs.LongFileName].Source.ToString(),
                Target = new HashSet <string>(new[] { expectScans[fs.LongFileName].Target.ToString() })
            } : null;

            return(base.GetValue(predict) + string.Format("\t{0}\t{1}",
                                                          predict.Expect == null ? string.Empty : string.Format("{0} => {1}", predict.Expect.Source, predict.Expect.Target.Merge(",")),
                                                          predict.IsExpect));
        }
        protected void CheckSAP(List <SapPredicted> predicted, MS2Item query, MS2Item libms2, SapMatchedCount ms3match)
        {
            foreach (var aa in libms2.AminoacidCompsition)
            {
                var lst = options.SubstitutionDeltaMassMap[aa];
                //the list has been ordered by deltamass
                foreach (var ts in lst)
                {
                    var targetMz = libms2.Precursor + ts.DeltaMass / query.Charge;
                    if (targetMz < query.MinPrecursorMz)
                    {
                        continue;
                    }

                    if (targetMz > query.MaxPrecursorMz)
                    {
                        break;
                    }

                    var curp = new SapPredicted()
                    {
                        Ms2     = query,
                        LibMs2  = libms2,
                        Matched = ms3match,
                        Target  = new TargetVariant()
                        {
                            Source     = ts.Source,
                            Target     = ts.Target,
                            DeltaMass  = ts.DeltaMass,
                            TargetType = ts.TargetType
                        }
                    };

                    predicted.Add(curp);
                }
            }
        }
        protected void CheckTerminalLoss(List <SapPredicted> predicted, MS2Item query, MS2Item libms2, SapMatchedCount ms3match)
        {
            foreach (var nl in libms2.TerminalLoss)
            {
                if (nl.Precursor >= query.MinPrecursorMz && nl.Precursor <= query.MaxPrecursorMz)
                {
                    var curp = new SapPredicted()
                    {
                        Ms2     = query,
                        LibMs2  = libms2,
                        Matched = ms3match,
                        Target  = new TargetVariant()
                        {
                            Source     = PeptideUtils.GetPureSequence(libms2.Peptide),
                            Target     = new HashSet <string>(new[] { nl.Sequence }),
                            DeltaMass  = (nl.Precursor - libms2.Precursor) * libms2.Charge,
                            TargetType = nl.IsNterminal ? VariantType.NTerminalLoss : VariantType.CTerminalLoss
                        }
                    };

                    predicted.Add(curp);
                }
            }
        }