//overload: peptide to peptide case private List <Stoichiometry> calcStoichiometry(Peptide pep1, Peptide pep2, string group) { List <Stoichiometry> stoich = new List <Stoichiometry>(); List <Intensity> Pep1Intensity = pep1.Intensities.Where(p => p.GroupID == group).ToList(); List <Intensity> Pep2Intensity = pep2.Intensities.Where(p => p.GroupID == group).ToList(); foreach (Intensity i1 in Pep1Intensity) { Intensity i2 = Pep2Intensity.Where(p => p.FileName == i1.FileName).ToList()[0]; Stoichiometry calcStoich = new Stoichiometry(i1, i2); if (i1.IntensityVal > 0 || i2.IntensityVal > 0) { stoich.Add(calcStoich); } } return(stoich); }
//overload for peptide:peptide case public Stoichiometry(Intensity Pep1, Intensity Pep2) { this.StoichiometryVal = Pep1.IntensityVal / Pep2.IntensityVal; this.usefulStoichiometry = (Pep1.IntensityVal > 0 && Pep2.IntensityVal > 0); }
} //true if pep Intensity > 0, false otherwise public Stoichiometry(Intensity Pep, double baseline) { this.StoichiometryVal = Pep.IntensityVal / baseline; this.usefulStoichiometry = (Pep.IntensityVal > 0); }