Пример #1
0
        public PrecursorMatcherByBinSearchOnGlycansTemplate(List <IPeptide> peptides, List <IGlycan> glycans, double tol)
        {
            matcher   = new BinarySearch();
            parameter = new PrecursorParameter(tol);

            glycanPoints  = new List <Point>();
            calculator    = UtilMass.Instance;
            option        = UtilMassOption.Instance;
            this.peptides = peptides;


            // build points on glycans
            Dictionary <double, PrecursorPoint <IGlycan> > seen = new Dictionary <double, PrecursorPoint <IGlycan> >();

            foreach (IGlycan glycan in glycans)
            {
                double mass = calculator.CalcGlycanMass(glycan, option);
                if (!seen.ContainsKey(mass))
                {
                    PrecursorPoint <IGlycan> pt = new PrecursorPoint <IGlycan>(mass);
                    seen[mass] = pt;
                    glycanPoints.Add(pt);
                }
                seen[mass].Add(glycan);
            }
            matcher.SetPoints(glycanPoints);
        }
        public PrecursorMatcherByBinSearchOnPeptidesTemplate(List <IPeptide> peptides, List <IGlycan> glycans,
                                                             PrecursorParameter parameter)
        {
            matcher        = new BinarySearch();
            this.parameter = parameter;

            peptidePoints = new List <Point>();
            calculator    = UtilMass.Instance;
            option        = UtilMassOption.Instance;
            this.glycans  = glycans;


            // build points on peptides
            Dictionary <double, PrecursorPoint <IPeptide> > seen = new Dictionary <double, PrecursorPoint <IPeptide> >();

            foreach (IPeptide peptide in peptides)
            {
                double mass = calculator.CalcPeptideMass(peptide, option);
                if (!seen.ContainsKey(mass))
                {
                    PrecursorPoint <IPeptide> pt = new PrecursorPoint <IPeptide>(mass);
                    seen[mass] = pt;
                    peptidePoints.Add(pt);
                }
                seen[mass].Add(peptide);
            }
            matcher.SetPoints(peptidePoints);
        }
 public Y1PeptidesFilterPrecursorMatcher(IPrecursorMatcher matcher, List <IPeptide> peptides)
 {
     this.matcher = matcher;
     peptideDB    = peptides;
     calcualtor   = UtilMass.Instance;
     option       = UtilMassOption.Instance;
 }
Пример #4
0
 public BinSearchSpectrumEThcD(double tol = 20)
 {
     calculator = UtilMass.Instance;
     option     = UtilMassOption.Instance;
     parameter  = new BinSearchSpectrumEThcDParameter(tol);
     alpha      = 1.0;
     beta       = 0.0;
 }
Пример #5
0
 public BinSearchSpectrumEThcD(ISearchParameter parameter)
 {
     calculator     = UtilMass.Instance;
     option         = UtilMassOption.Instance;
     this.parameter = parameter;
     alpha          = 1.0;
     beta           = 0.0;
 }
Пример #6
0
 public TableNGlycanAccumulatedGlycanMassProxy(ITableNGlycan glycan)
 {
     this.glycan = glycan;
     calculator  = UtilMass.Instance;
     option      = UtilMassOption.Instance;
     massTable   = new HashSet <double>();
     massTable.Add(calculator.CalcGlycanMass(glycan, option));
 }
Пример #7
0
 public NGlycoPeptideNode(ITableNGlycan nGlycan, IPeptide peptide, IScore score)
 {
     glycan       = nGlycan.TableClone();
     this.peptide = peptide.Clone();
     this.score   = score.Clone();
     calculator   = UtilMass.Instance;
     option       = UtilMassOption.Instance;
     mass         = calculator.CalcGlycanMass(glycan, option) + calculator.CalcPeptideMass(peptide, option);
 }
Пример #8
0
        public void Run()
        {
            //AccumulatedStructBruteForceNGlycanCreator creator = new AccumulatedStructBruteForceNGlycanCreator();
            //creator.Generate();


            ////http://db.systemsbiology.net:8080/proteomicsToolkit/FragIonServlet.html
            IPeptide peptide = new GeneralPeptide("test", "VVLHPNYSQVD");
            //IPeptide peptide = new GeneralPeptide("test", "SRNLTK");
            //IPeptide peptide = new GeneralPeptide("test", "LCPDCPLLAPLNDSR");
            ICalcMass       calculator = UtilMass.Instance;
            ICalcMassOption option     = UtilMassOption.Instance;



            //double mass =  calculator.CalcPeptideMass(peptide, option); //1154.63213937
            //
            //double mass = calculator.CalcPeptideMass(peptide, option);
            //double mass = calculator.CalcPeptideIonMass("CHS", IonType.xIon, option);
            //Console.WriteLine(mass);
            //double mass = calculator.CalcPeptideIonMass("VVLHPNYSQV", IonType.cIon, option);
            //Console.WriteLine(mass);
            //mass = calculator.CalcPeptideIonMass("CHS", IonType.zIon, option);
            //Console.WriteLine(mass);

            //IGlycan glycan = new GeneralGlycan(6, 7, 2, 3, 0);



            IGlycan glycan = new GeneralGlycan(1, 0, 0, 0, 0);
            //option.SetPermethylation(true);

            double mass = calculator.CalcPeptideMass(peptide, option);

            mass += calculator.CalcGlycanMass(glycan, option);
            //mass = calculator.CalcGlycanYIonMass(glycan, option);
            //peptide = new GeneralPeptide("1", "EPTIDE");
            //mass = calculator.CalcPeptideIonMass(peptide, IonType.xIon, option);
            //Console.WriteLine((mass+Hydrogen)/1);

            //peptide = new GeneralPeptide("1", "TIDE");
            //mass = calculator.CalcPeptideIonMass(peptide, IonType.xIon, option);
            //Console.WriteLine((mass+Hydrogen)/1);
            //2322.82285937

            Console.WriteLine(mass);
            Console.WriteLine(mass / 1.0 + Hydrogen);
            //Console.WriteLine(calculator.CalcPPM(mass, 329.09256));

            Console.Read();
        }
        protected void Constructor(List <IAccumulatedGlycanStructureProxy> glycans)
        {
            glycansTable = new Dictionary <string, List <ITableNGlycan> >();
            calculator   = UtilMass.Instance;
            option       = UtilMassOption.Instance;
            matcher      = new BinarySearch();


            foreach (IAccumulatedGlycanStructureProxy g in glycans)
            {
                string id = g.GetName();
                if (!glycansTable.ContainsKey(id))
                {
                    glycansTable[id] = new List <ITableNGlycan>();
                }
                glycansTable[id].AddRange(g.GetSubTreeGlycans());
            }
        }
        public GeneralAccumulatedGlycoPeptideMassProxy(
            SpecialGlycoPeptide <IAccumulatedGlycanMassProxy> glycoPeptide)
        {
            calculator = UtilMass.Instance;
            option     = UtilMassOption.Instance;
            mass       = new HashSet <double>();


            this.glycoPeptide = glycoPeptide;
            foreach (double glycanMass in (glycoPeptide.GetGlycan()
                                           as IAccumulatedGlycanMassProxy).GetMass())
            {
                foreach (double peptideMass in CalcPTMPeptideMass.GetNGlycanPeptideMass(
                             GetPeptide().GetSequence(), GetPosition()))
                {
                    mass.Add(glycanMass + peptideMass);
                }
                mass.Add(glycanMass + calculator.CalcPeptideMass(glycoPeptide.GetPeptide(), option));
            }

            mass.UnionWith(CalcPTMPeptideMass.GetNonGlycanPeptideMass(GetPeptide().GetSequence(), GetPosition()));
            massList = mass.ToList();
            massList.Sort();
        }
Пример #11
0
 public FDREThcDGlycoPeptideSearchEngine()
 {
     initializer = new GeneralGlycoPeptideSearchEngineInitalizer();
     calculator  = UtilMass.Instance;
     option      = UtilMassOption.Instance;
 }