Example #1
0
 private MsDataFileImpl GetDataFile(bool ignoreZeroIntensityPoints)
 {
     if (_dataFile == null)
     {
         if (DataFilePath is MsDataFilePath)
         {
             string dataFilePath       = FindDataFilePath();
             var    lockMassParameters = DataFilePath.GetLockMassParameters();
             if (dataFilePath == null)
             {
                 throw new FileNotFoundException(string.Format(
                                                     Resources
                                                     .ScanProvider_GetScans_The_data_file__0__could_not_be_found__either_at_its_original_location_or_in_the_document_or_document_parent_folder_,
                                                     DataFilePath));
             }
             int sampleIndex = SampleHelp.GetPathSampleIndexPart(dataFilePath);
             if (sampleIndex == -1)
             {
                 sampleIndex = 0;
             }
             // Full-scan extraction always uses SIM as spectra
             _dataFile = new MsDataFileImpl(dataFilePath, sampleIndex, lockMassParameters, true,
                                            combineIonMobilitySpectra: DataFilePath.GetCombineIonMobilitySpectra(),
                                            requireVendorCentroidedMS1: DataFilePath.GetCentroidMs1(),
                                            requireVendorCentroidedMS2: DataFilePath.GetCentroidMs2(),
                                            ignoreZeroIntensityPoints: ignoreZeroIntensityPoints);
         }
         else
         {
             _dataFile = DataFilePath.OpenMsDataFile(true, 0, null, ignoreZeroIntensityPoints);
         }
     }
     return(_dataFile);
 }
Example #2
0
 public static MsDataFilePath ParseUri(string url)
 {
     return(new MsDataFilePath(SampleHelp.GetPathFilePart(url),
                               SampleHelp.GetPathSampleNamePart(url),
                               SampleHelp.GetPathSampleIndexPart(url),
                               SampleHelp.GetLockmassParameters(url),
                               SampleHelp.GetCentroidMs1(url),
                               SampleHelp.GetCentroidMs2(url),
                               SampleHelp.GetCombineIonMobilitySpectra(url)));
 }
Example #3
0
 public static MsDataFileUri Parse(string url)
 {
     if (url.StartsWith(ChorusUrl.ChorusUrlPrefix))
     {
         return(new ChorusUrl(url));
     }
     return(new MsDataFilePath(SampleHelp.GetPathFilePart(url),
                               SampleHelp.GetPathSampleNamePart(url),
                               SampleHelp.GetPathSampleIndexPart(url),
                               SampleHelp.GetLockmassParameters(url),
                               SampleHelp.GetCentroidMs1(url),
                               SampleHelp.GetCentroidMs2(url)));
 }
Example #4
0
 public static MsDataFileUri Parse(string url)
 {
     if (url.StartsWith(UnifiUrl.UrlPrefix))
     {
         return(new UnifiUrl(url));
     }
     return(new MsDataFilePath(SampleHelp.GetPathFilePart(url),
                               SampleHelp.GetPathSampleNamePart(url),
                               SampleHelp.GetPathSampleIndexPart(url),
                               SampleHelp.GetLockmassParameters(url),
                               SampleHelp.GetCentroidMs1(url),
                               SampleHelp.GetCentroidMs2(url),
                               SampleHelp.GetCombineIonMobilitySpectra(url)));
 }
Example #5
0
        private MsDataFileImpl GetDataFile(bool ignoreZeroIntensityPoints)
        {
            if (_dataFile == null)
            {
                const bool simAsSpectra  = true;  // SIM always as spectra here
                const bool preferOnlyMs1 = false; // Open with all available spectra indexed

                if (DataFilePath is MsDataFilePath)
                {
                    string dataFilePath       = FindDataFilePath();
                    var    lockMassParameters = DataFilePath.GetLockMassParameters();
                    if (dataFilePath == null)
                    {
                        throw new FileNotFoundException(string.Format(
                                                            Resources
                                                            .ScanProvider_GetScans_The_data_file__0__could_not_be_found__either_at_its_original_location_or_in_the_document_or_document_parent_folder_,
                                                            DataFilePath));
                    }
                    int sampleIndex = SampleHelp.GetPathSampleIndexPart(dataFilePath);
                    if (sampleIndex == -1)
                    {
                        sampleIndex = 0;
                    }
                    // Full-scan extraction always uses SIM as spectra
                    _dataFile = new MsDataFileImpl(dataFilePath, sampleIndex,
                                                   lockMassParameters,
                                                   simAsSpectra,
                                                   combineIonMobilitySpectra: _cachedFile.HasCombinedIonMobility,
                                                   requireVendorCentroidedMS1: _cachedFile.UsedMs1Centroids,
                                                   requireVendorCentroidedMS2: _cachedFile.UsedMs2Centroids,
                                                   ignoreZeroIntensityPoints: ignoreZeroIntensityPoints);
                }
                else
                {
                    _dataFile = DataFilePath.OpenMsDataFile(simAsSpectra, preferOnlyMs1,
                                                            _cachedFile.UsedMs1Centroids, _cachedFile.UsedMs2Centroids, ignoreZeroIntensityPoints);
                }
            }
            return(_dataFile);
        }