public override string ToString() { var sb = new StringBuilder(); sb.Append("Precursor Mass Only"); sb.AppendLine("Index partitions: " + CurrentPartition + "/" + commonParameters.TotalPartitions); sb.AppendLine("Search Decoys: " + DecoyType); sb.AppendLine("Number of proteins: " + ProteinList.Count); sb.AppendLine("Number of fixed mods: " + FixedModifications.Count); sb.AppendLine("Number of variable mods: " + VariableModifications.Count); sb.AppendLine("lp: " + string.Join(",", ProductTypes)); foreach (var digestionParams in CollectionOfDigestionParams) { sb.AppendLine("protease: " + digestionParams.Protease); sb.AppendLine("initiatorMethionineBehavior: " + digestionParams.InitiatorMethionineBehavior); sb.AppendLine("maximumMissedCleavages: " + digestionParams.MaxMissedCleavages); sb.AppendLine("minPeptideLength: " + digestionParams.MinPeptideLength); sb.AppendLine("maxPeptideLength: " + digestionParams.MaxPeptideLength); sb.AppendLine("maximumVariableModificationIsoforms: " + digestionParams.MaxModificationIsoforms); } sb.Append("Localizeable mods: " + ProteinList.Select(b => b.OneBasedPossibleLocalizedModifications.Count).Sum()); return(sb.ToString()); }
/// <summary> /// This function removes protein clusters that do not have a /// required number of additional unique peptides. /// </summary> /// <param name="minAdditionalPeptides"></param> public void filterByMinimumCoveringSet(int minAdditionalPeptides, ProteinList proteins) { if (minAdditionalPeptides == 0) return; if (statusOutput == null) { // Get the minimum protein set that can explain all the peptides List<ProteinInfo> proteinsToRemove = new List<ProteinInfo>(); foreach (ProteinList.MapPair proItr in proteins) { // Remove the protein cluster if it doesn't have the required number // of unique peptides if (proItr.Value.proteinGroup.uniquePeptideCount < minAdditionalPeptides) { proteinsToRemove.Add(proItr.Value); } else { proItr.Value.proteinGroup = null; foreach (ResultInfo r in proItr.Value.results) r.peptideGroup = null; } } foreach (ProteinInfo pro in proteinsToRemove) removeProtein(pro); } else { // Same as above with status reporting. List<ProteinInfo> proteinsToRemove = new List<ProteinInfo>(); ProteinList.Enumerator itr = proteins.GetEnumerator(); itr.MoveNext(); for (int i = 0; i < proteins.Count; ++i, itr.MoveNext()) { ProteinInfo pro = itr.Current.Value; reportStatus("testing protein " + (i + 1) + " of " + proteins.Count, i + 1 == proteins.Count); if (pro.proteinGroup.uniquePeptideCount < minAdditionalPeptides) proteinsToRemove.Add(pro); else { pro.proteinGroup = null; foreach (ResultInfo r in pro.results) r.peptideGroup = null; } } for (int i = 0; i < proteinsToRemove.Count; ++i) { reportStatus("removing protein " + (i + 1) + " of " + proteinsToRemove.Count, i + 1 == proteinsToRemove.Count); removeProtein(proteinsToRemove[i]); } } assembleProteinGroups(); assemblePeptideGroups(); assembleClusters(); // we lost the actual value by regrouping, but we know the minimum foreach (ProteinGroupInfo proGroup in proteinGroups) proGroup.uniquePeptideCount = minAdditionalPeptides; }