internal MoleculeLibraryKey(ValueCache valueCache, LibraryKeyProto libraryKeyProto) : this( valueCache, SmallMoleculeLibraryAttributes.Create( valueCache.CacheValue(libraryKeyProto.MoleculeName), valueCache.CacheValue(libraryKeyProto.ChemicalFormula), libraryKeyProto.InChiKey, libraryKeyProto.OtherKeys), Adduct.FromString(libraryKeyProto.Adduct, Adduct.ADDUCT_TYPE.non_proteomic, null)) { }
public override LibraryKey ValueFromCache(ValueCache valueCache) { var libraryKey = this; if (valueCache.TryGetCachedValue(ref libraryKey)) { return(libraryKey); } libraryKey = new PeptideLibraryKey { ModifiedSequence = valueCache.CacheValue(ModifiedSequence), UnmodifiedSequence = valueCache.CacheValue(UnmodifiedSequence), Charge = Charge, }; return(valueCache.CacheValue(libraryKey)); }
public static ElibSpectrumInfo Read(ValueCache valueCache, Stream stream) { byte[] peptideModSeqBytes = new byte[PrimitiveArrays.ReadOneValue <int>(stream)]; stream.Read(peptideModSeqBytes, 0, peptideModSeqBytes.Length); var peptideModSeq = valueCache.CacheValue(Encoding.UTF8.GetString(peptideModSeqBytes)); int charge = PrimitiveArrays.ReadOneValue <int>(stream); int bestFileId = PrimitiveArrays.ReadOneValue <int>(stream); int peakBoundCount = PrimitiveArrays.ReadOneValue <int>(stream); var peakBounds = new List <KeyValuePair <int, FileData> >(); while (peakBounds.Count < peakBoundCount) { var fileId = PrimitiveArrays.ReadOneValue <int>(stream); var startTime = PrimitiveArrays.ReadOneValue <double>(stream); var endTime = PrimitiveArrays.ReadOneValue <double>(stream); var score = PrimitiveArrays.ReadOneValue <double>(stream); byte bHasApexTime = PrimitiveArrays.ReadOneValue <byte>(stream); double?apexTime; if (bHasApexTime == 0) { apexTime = null; } else { apexTime = PrimitiveArrays.ReadOneValue <double>(stream); } peakBounds.Add(new KeyValuePair <int, FileData>(fileId, new FileData(apexTime, new ExplicitPeakBounds(startTime, endTime, score)))); } return(new ElibSpectrumInfo(peptideModSeq, charge, bestFileId, peakBounds)); }
public virtual LibraryKey ValueFromCache(ValueCache valueCache) { return(valueCache.CacheValue(this)); }
public virtual ComparisonKey Cache(ValueCache valueCache) { return(valueCache.CacheValue(this)); }