/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins.</returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder( new StandardDataPinTextFilter()); builder.AddValue("id", GraffitiId); if (!string.IsNullOrEmpty(Language)) { builder.AddValue("language", Language); } if (!string.IsNullOrEmpty(Verse)) { builder.AddValue("verse", Verse); } if (!string.IsNullOrEmpty(Author)) { builder.AddValue("author", Author, filter: true, filterOptions: true); } if (Identifications?.Count > 0) { builder.AddValues("pid", Identifications.Select(i => i.Id)); } if (Date != null) { builder.AddValue("date-value", Date.GetSortValue()); } return(builder.Build(this)); }
public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append(SpectraFileInfo.FilenameWithoutExtension + "\t"); sb.Append(string.Join("|", Identifications.Select(p => p.BaseSequence).Distinct()) + '\t'); sb.Append(string.Join("|", Identifications.Select(p => p.ModifiedSequence).Distinct()) + '\t'); var t = Identifications.SelectMany(p => p.ProteinGroups.Select(v => v.ProteinGroupName)).Distinct().OrderBy(p => p); if (t.Any()) { sb.Append(string.Join(";", t) + '\t'); } else { sb.Append("" + '\t'); } sb.Append("" + Identifications.First().MonoisotopicMass + '\t'); if (!IsMbrPeak) { sb.Append("" + Identifications.First().Ms2RetentionTimeInMinutes + '\t'); } else { sb.Append("" + '\t'); } sb.Append("" + Identifications.First().PrecursorChargeState + '\t'); sb.Append("" + ClassExtensions.ToMz(Identifications.First().MonoisotopicMass, Identifications.First().PrecursorChargeState) + '\t'); sb.Append("" + Intensity + "\t"); if (Apex != null) { sb.Append("" + IsotopicEnvelopes.Min(p => p.IndexedPeak.RetentionTime) + "\t"); sb.Append("" + Apex.IndexedPeak.RetentionTime + "\t"); sb.Append("" + IsotopicEnvelopes.Max(p => p.IndexedPeak.RetentionTime) + "\t"); sb.Append("" + Apex.IndexedPeak.Mz + "\t"); sb.Append("" + Apex.ChargeState + "\t"); } else { sb.Append("" + "-" + "\t"); sb.Append("" + "-" + "\t"); sb.Append("" + "-" + "\t"); sb.Append("" + "-" + "\t"); sb.Append("" + "-" + "\t"); } sb.Append("" + NumChargeStatesObserved + "\t"); if (IsMbrPeak) { sb.Append("" + "MBR" + "\t"); } else { sb.Append("" + "MSMS" + "\t"); } sb.Append("" + (IsMbrPeak ? MbrScore.ToString() : "") + "\t"); sb.Append("" + Identifications.Count + "\t"); sb.Append("" + NumIdentificationsByBaseSeq + "\t"); sb.Append("" + NumIdentificationsByFullSeq + "\t"); sb.Append("" + SplitRT + "\t"); sb.Append("" + MassError + "\t"); return(sb.ToString()); }
public void ResolveIdentifications() { this.NumIdentificationsByBaseSeq = Identifications.Select(v => v.BaseSequence).Distinct().Count(); this.NumIdentificationsByFullSeq = Identifications.Select(v => v.ModifiedSequence).Distinct().Count(); }