//Get unique and identified peptides for output //Convert the output if it's a SILAC experiment public void GetIdentifiedPeptidesOutput(List <SilacLabel> labels) { var SharedPeptides = AllPeptides.Except(UniquePeptides); if (labels == null) { //TODO add unit test with displaymodsonpeptides if (!DisplayModsOnPeptides) { UniquePeptidesOutput = GlobalVariables.CheckLengthOfOutput(string.Join("|", UniquePeptides.Select(p => p.BaseSequence).Distinct())); SharedPeptidesOutput = GlobalVariables.CheckLengthOfOutput(string.Join("|", SharedPeptides.Select(p => p.BaseSequence).Distinct())); } else { UniquePeptidesOutput = GlobalVariables.CheckLengthOfOutput(string.Join("|", UniquePeptides.Select(p => p.FullSequence).Distinct())); SharedPeptidesOutput = GlobalVariables.CheckLengthOfOutput(string.Join("|", SharedPeptides.Select(p => p.FullSequence).Distinct())); } } else { if (!DisplayModsOnPeptides) { UniquePeptidesOutput = GlobalVariables.CheckLengthOfOutput(string.Join("|", UniquePeptides.Select(p => SilacConversions.GetAmbiguousLightSequence(p.BaseSequence, labels, true)).Distinct())); SharedPeptidesOutput = GlobalVariables.CheckLengthOfOutput(string.Join("|", SharedPeptides.Select(p => SilacConversions.GetAmbiguousLightSequence(p.BaseSequence, labels, true)).Distinct())); } else { UniquePeptidesOutput = GlobalVariables.CheckLengthOfOutput(string.Join("|", UniquePeptides.Select(p => SilacConversions.GetAmbiguousLightSequence(p.FullSequence, labels, false)).Distinct())); SharedPeptidesOutput = GlobalVariables.CheckLengthOfOutput(string.Join("|", SharedPeptides.Select(p => SilacConversions.GetAmbiguousLightSequence(p.FullSequence, labels, false)).Distinct())); } } }
public override string ToString() { var sb = new StringBuilder(); // list of protein accession numbers sb.Append(ProteinGroupName); sb.Append("\t"); // genes sb.Append(GlobalVariables.CheckLengthOfOutput(string.Join("|", ListOfProteinsOrderedByAccession.Select(p => p.GeneNames.Select(x => x.Item2).FirstOrDefault())))); sb.Append("\t"); // organisms sb.Append(GlobalVariables.CheckLengthOfOutput(string.Join("|", ListOfProteinsOrderedByAccession.Select(p => p.Organism).Distinct()))); sb.Append("\t"); // list of protein names sb.Append(GlobalVariables.CheckLengthOfOutput(string.Join("|", ListOfProteinsOrderedByAccession.Select(p => p.FullName).Distinct()))); sb.Append("\t"); // list of masses var sequences = ListOfProteinsOrderedByAccession.Select(p => p.BaseSequence).Distinct(); List <double> masses = new List <double>(); foreach (var sequence in sequences) { try { masses.Add(new Proteomics.AminoAcidPolymer.Peptide(sequence).MonoisotopicMass); } catch (System.Exception) { masses.Add(double.NaN); } } sb.Append(GlobalVariables.CheckLengthOfOutput(string.Join("|", masses))); sb.Append("\t"); // number of proteins in group sb.Append("" + Proteins.Count); sb.Append("\t"); // list of unique peptides if (!DisplayModsOnPeptides) { sb.Append(GlobalVariables.CheckLengthOfOutput(string.Join("|", UniquePeptides.Select(p => p.BaseSequence).Distinct()))); } else { sb.Append(GlobalVariables.CheckLengthOfOutput(string.Join("|", UniquePeptides.Select(p => p.Sequence).Distinct()))); } sb.Append("\t"); // list of shared peptides var SharedPeptides = AllPeptides.Except(UniquePeptides); if (!DisplayModsOnPeptides) { sb.Append(GlobalVariables.CheckLengthOfOutput(string.Join("|", SharedPeptides.Select(p => p.BaseSequence).Distinct()))); } else { sb.Append(GlobalVariables.CheckLengthOfOutput(string.Join("|", SharedPeptides.Select(p => p.Sequence).Distinct()))); } sb.Append("\t"); // number of peptides if (!DisplayModsOnPeptides) { sb.Append("" + AllPeptides.Select(p => p.BaseSequence).Distinct().Count()); } else { sb.Append("" + AllPeptides.Select(p => p.Sequence).Distinct().Count()); } sb.Append("\t"); // number of unique peptides if (!DisplayModsOnPeptides) { sb.Append("" + UniquePeptides.Select(p => p.BaseSequence).Distinct().Count()); } else { sb.Append("" + UniquePeptides.Select(p => p.Sequence).Distinct().Count()); } sb.Append("\t"); // sequence coverage percent sb.Append(GlobalVariables.CheckLengthOfOutput(string.Join("|", SequenceCoveragePercent.Select(p => string.Format("{0:0}" + "%", (p * 100)))))); sb.Append("\t"); // sequence coverage sb.Append(GlobalVariables.CheckLengthOfOutput(string.Join("|", SequenceCoverageDisplayList))); sb.Append("\t"); // sequence coverage with mods sb.Append(GlobalVariables.CheckLengthOfOutput(string.Join("|", SequenceCoverageDisplayListWithMods))); sb.Append("\t"); //Detailed mods information list sb.Append(GlobalVariables.CheckLengthOfOutput(string.Join("|", ModsInfo))); sb.Append("\t"); // MS1 intensity (retrieved from FlashLFQ in the SearchTask) if (IntensitiesByFile != null && FilesForQuantification != null) { foreach (var file in FilesForQuantification) { if (IntensitiesByFile[file] > 0) { sb.Append(IntensitiesByFile[file]); } else { sb.Append(""); } sb.Append("\t"); } } // number of PSMs for listed peptides sb.Append("" + AllPsmsBelowOnePercentFDR.Count); sb.Append("\t"); // isDecoy if (IsDecoy) { sb.Append("D"); } else if (IsContaminant) { sb.Append("C"); } else { sb.Append("T"); } sb.Append("\t"); // cumulative target sb.Append(CumulativeTarget); sb.Append("\t"); // cumulative decoy sb.Append(CumulativeDecoy); sb.Append("\t"); // q value sb.Append(QValue); sb.Append("\t"); // best peptide score sb.Append(BestPeptideScore); sb.Append("\t"); // best peptide q value sb.Append(BestPeptideQValue); sb.Append("\t"); return(sb.ToString()); }