public IGlycoPeptideProxy Generate(IGlycan glycan, IPeptide peptide, int modifySite) { if (glycan is ITableNGlycanMassProxy) { IGlycoPeptide glycoPeptide = new GeneralGlycoPeptide(glycan, peptide, modifySite); IGlycoPeptideMassProxy glycoPeptideMassProxy = new GeneralGlycoPeptideMassProxy(glycoPeptide); foreach (double glycanMass in (glycan as ITableNGlycanMassProxy).GetMass()) { glycoPeptideMassProxy.AddMass(glycanMass + PeptideCalcMass.Instance.Compute(glycoPeptide.GetPeptide()), MassType.Branch); } foreach (double glycanMass in (glycan as ITableNGlycanMassProxy).GetCoreMass()) { glycoPeptideMassProxy.AddMass(glycanMass + PeptideCalcMass.Instance.Compute(glycoPeptide.GetPeptide()), MassType.Core); } glycoPeptideMassProxy.AddRangeMass(SingaturePeakCalcMass.Instance.ComputeComplex(glycan), MassType.Glycan); double mass = GlycanCalcMass.Instance.Compute(glycan); foreach (double peptideMass in PTMPeptideCalcMass.Compute(peptide.GetSequence(), modifySite)) { glycoPeptideMassProxy.AddMass(mass + peptideMass, MassType.Peptide); } return(glycoPeptideMassProxy); } else { throw new InvalidCastException("Can not cast to ITableNGlycanMassProxy"); } }
public IGlycoPeptide createGlyco() { int[] structTable = new int[24]; structTable[0] = 1; IPeptide peptide = new GeneralPeptide("test3", "ILGGHLDAKGSFPWQAKMVSHHNLTTGATLINEQWLLTTAK"); IGlycoPeptide glycoPeptide = new GeneralGlycoPeptide(new ComplexNGlycan(structTable), peptide, 0); return(glycoPeptide); }