예제 #1
0
 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))
 {
 }
예제 #2
0
        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));
        }
예제 #3
0
            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));
            }
예제 #4
0
 public virtual LibraryKey ValueFromCache(ValueCache valueCache)
 {
     return(valueCache.CacheValue(this));
 }
예제 #5
0
파일: LibKeyIndex.cs 프로젝트: zrolfs/pwiz
 public virtual ComparisonKey Cache(ValueCache valueCache)
 {
     return(valueCache.CacheValue(this));
 }