Beispiel #1
0
        public ChromatogramSet ChangeMSDataFilePaths(IList <MsDataFileUri> prop)
        {
            var set = ImClone(this);

            // Be sure to preserve existing file info objects
            var dictPathToFileInfo = MSDataFileInfos.ToDictionary(info => info.FilePath);
            var listFileInfos      = new List <ChromFileInfo>();

            foreach (var filePath in prop)
            {
                ChromFileInfo chromFileInfo;
                if (!dictPathToFileInfo.TryGetValue(filePath, out chromFileInfo))
                {
                    chromFileInfo = new ChromFileInfo(filePath);
                }
                listFileInfos.Add(chromFileInfo);
            }

            set.MSDataFileInfos = listFileInfos;

            if (ReferenceEquals(MSDataFileInfos, set.MSDataFileInfos))
            {
                return(this);
            }

            return(set);
        }
Beispiel #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         int result = base.GetHashCode();
         result = (result * 397) ^ MSDataFileInfos.GetHashCodeDeep();
         result = (result * 397) ^ Annotations.GetHashCode();
         result = (result * 397) ^ UseForRetentionTimeFilter.GetHashCode();
         result = (result * 397) ^ (OptimizationFunction != null ? OptimizationFunction.GetHashCode() : 0);
         result = (result * 397) ^ _rescoreCount;
         result = (result * 397) ^ AnalyteConcentration.GetHashCode();
         result = (result * 397) ^ SampleType.GetHashCode();
         return(result);
     }
 }
Beispiel #3
0
 public int IndexOfId(ChromFileInfoId fileId)
 {
     return(MSDataFileInfos.IndexOf(info => ReferenceEquals(info.Id, fileId)));
 }
Beispiel #4
0
 public int IndexOfPath(MsDataFileUri filePath)
 {
     return(MSDataFileInfos.IndexOf(info => Equals(filePath, info.FilePath)));
 }
Beispiel #5
0
 public string IsLoadedExplained()                                                                                                                                                                  // For test and debug purposes, gives a descriptive string for IsLoaded failure
 {
     return(IsLoaded ? string.Empty : "No ChromFileInfo.FileWriteTime for " + string.Join(",", MSDataFileInfos.Where(info => !info.FileWriteTime.HasValue).Select(f => f.FilePath.GetFilePath()))); // Not L10N
 }