Java Code Examples for io.github.msdk.datamodel.RawDataFile#getName()

The following examples show how to use io.github.msdk.datamodel.RawDataFile#getName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LocalMaxCentroidingModule.java    From old-mzmine3 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void runModule(@Nonnull MZmineProject project, @Nonnull ParameterSet parameters,
    @Nonnull Collection<Task<?>> tasks) {

  final RawDataFilesSelection rawDataFiles =
      parameters.getParameter(LocalMaxCentroidingParameters.dataFiles).getValue();
  final String suffix = parameters.getParameter(LocalMaxCentroidingParameters.suffix).getValue();

  if (rawDataFiles == null || rawDataFiles.getMatchingRawDataFiles().isEmpty()) {
    logger.warn("Centroiding module started with no raw data files selected");
    return;
  }

  for (RawDataFile rawDataFile : rawDataFiles.getMatchingRawDataFiles()) {

    // Create the data structures
    DataPointStore dataStore = DataPointStoreFactory.getTmpFileDataStore();

    final String newName = rawDataFile.getName() + " " + suffix;
    LocalMaximaCentroidingAlgorithm algorithm = new LocalMaximaCentroidingAlgorithm(dataStore);

    MSDKCentroidingMethod method = new MSDKCentroidingMethod(rawDataFile, algorithm, dataStore);

    MSDKTask newTask =
        new MSDKTask("Local maxima centroiding method", rawDataFile.getName(), method);

    // Add the feature table to the project
    newTask.setOnSucceeded(e -> {
      RawDataFile newRawFile = method.getResult();
      newRawFile.setName(newName);
      project.addFile(newRawFile);
    });

    // Add the task to the queue
    tasks.add(newTask);

  }

}
 
Example 2
Source File: ExactMassCentroidingModule.java    From old-mzmine3 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void runModule(@Nonnull MZmineProject project, @Nonnull ParameterSet parameters,
    @Nonnull Collection<Task<?>> tasks) {

  final RawDataFilesSelection rawDataFiles =
      parameters.getParameter(ExactMassCentroidingParameters.dataFiles).getValue();
  final String suffix = parameters.getParameter(ExactMassCentroidingParameters.suffix).getValue();

  if (rawDataFiles == null || rawDataFiles.getMatchingRawDataFiles().isEmpty()) {
    logger.warn("Centroiding module started with no raw data files selected");
    return;
  }

  for (RawDataFile rawDataFile : rawDataFiles.getMatchingRawDataFiles()) {

    // Create the data structures
    DataPointStore dataStore = DataPointStoreFactory.getTmpFileDataStore();

    final String newName = rawDataFile.getName() + " " + suffix;
    ExactMassCentroidingAlgorithm algorithm = new ExactMassCentroidingAlgorithm(dataStore);

    MSDKCentroidingMethod method = new MSDKCentroidingMethod(rawDataFile, algorithm, dataStore);

    MSDKTask newTask =
        new MSDKTask("Exact mass centroiding method", rawDataFile.getName(), method);

    // Add the feature table to the project
    newTask.setOnSucceeded(e -> {
      RawDataFile newRawFile = method.getResult();
      newRawFile.setName(newName);
      project.addFile(newRawFile);
    });

    // Add the task to the queue
    tasks.add(newTask);

  }

}
 
Example 3
Source File: BinningCentroidingModule.java    From old-mzmine3 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void runModule(@Nonnull MZmineProject project, @Nonnull ParameterSet parameters,
    @Nonnull Collection<Task<?>> tasks) {

  final RawDataFilesSelection rawDataFiles =
      parameters.getParameter(BinningCentroidingParameters.dataFiles).getValue();
  final Double binSize = parameters.getParameter(BinningCentroidingParameters.binSize).getValue();
  final String suffix = parameters.getParameter(BinningCentroidingParameters.suffix).getValue();

  if (rawDataFiles == null || rawDataFiles.getMatchingRawDataFiles().isEmpty()) {
    logger.warn("Centroiding module started with no raw data files selected");
    return;
  }

  for (RawDataFile rawDataFile : rawDataFiles.getMatchingRawDataFiles()) {

    // Create the data structures
    DataPointStore dataStore = DataPointStoreFactory.getTmpFileDataStore();

    final String newName = rawDataFile.getName() + " " + suffix;
    BinningCentroidingAlgorithm algorithm = new BinningCentroidingAlgorithm(dataStore, binSize);

    MSDKCentroidingMethod method = new MSDKCentroidingMethod(rawDataFile, algorithm, dataStore);

    MSDKTask newTask = new MSDKTask("Binning centroiding method", rawDataFile.getName(), method);

    // Add the feature table to the project
    newTask.setOnSucceeded(e -> {
      RawDataFile newRawFile = method.getResult();
      newRawFile.setName(newName);
      project.addFile(newRawFile);
    });

    // Add the task to the queue
    tasks.add(newTask);

  }

}
 
Example 4
Source File: RecursiveCentroidingModule.java    From old-mzmine3 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void runModule(@Nonnull MZmineProject project, @Nonnull ParameterSet parameters,
    @Nonnull Collection<Task<?>> tasks) {

  final RawDataFilesSelection rawDataFiles =
      parameters.getParameter(RecursiveCentroidingParameters.dataFiles).getValue();
  final Range<Double> mzPeakWidth = RecursiveCentroidingParameters.mzPeakWidth.getValue();
  final String suffix = parameters.getParameter(RecursiveCentroidingParameters.suffix).getValue();

  if (rawDataFiles == null || rawDataFiles.getMatchingRawDataFiles().isEmpty()) {
    logger.warn("Centroiding module started with no raw data files selected");
    return;
  }

  for (RawDataFile rawDataFile : rawDataFiles.getMatchingRawDataFiles()) {

    // Create the data structures
    DataPointStore dataStore = DataPointStoreFactory.getTmpFileDataStore();

    final String newName = rawDataFile.getName() + " " + suffix;
    RecursiveCentroidingAlgorithm algorithm =
        new RecursiveCentroidingAlgorithm(dataStore, mzPeakWidth);

    MSDKCentroidingMethod method = new MSDKCentroidingMethod(rawDataFile, algorithm, dataStore);

    MSDKTask newTask =
        new MSDKTask("Recursive centroiding method", rawDataFile.getName(), method);

    // Add the feature table to the project
    newTask.setOnSucceeded(e -> {
      RawDataFile newRawFile = method.getResult();
      newRawFile.setName(newName);
      project.addFile(newRawFile);
    });

    // Add the task to the queue
    tasks.add(newTask);

  }

}
 
Example 5
Source File: WaveletCentroidingModule.java    From old-mzmine3 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void runModule(@Nonnull MZmineProject project, @Nonnull ParameterSet parameters,
    @Nonnull Collection<Task<?>> tasks) {

  final RawDataFilesSelection rawDataFiles =
      parameters.getParameter(WaveletCentroidingParameters.dataFiles).getValue();
  final Integer scaleLevel =
      parameters.getParameter(WaveletCentroidingParameters.scaleLevel).getValue();
  final Double waveletWindow =
      parameters.getParameter(WaveletCentroidingParameters.waveletWindow).getValue();
  final String suffix = parameters.getParameter(WaveletCentroidingParameters.suffix).getValue();

  if (rawDataFiles == null || rawDataFiles.getMatchingRawDataFiles().isEmpty()) {
    logger.warn("Centroiding module started with no raw data files selected");
    return;
  }

  for (RawDataFile rawDataFile : rawDataFiles.getMatchingRawDataFiles()) {

    // Create the data structures
    DataPointStore dataStore = DataPointStoreFactory.getTmpFileDataStore();

    final String newName = rawDataFile.getName() + " " + suffix;
    WaveletCentroidingAlgorithm algorithm =
        new WaveletCentroidingAlgorithm(dataStore, scaleLevel, waveletWindow);

    MSDKCentroidingMethod method = new MSDKCentroidingMethod(rawDataFile, algorithm, dataStore);

    MSDKTask newTask = new MSDKTask("Wavelet centroiding method", rawDataFile.getName(), method);

    // Add the feature table to the project
    newTask.setOnSucceeded(e -> {
      RawDataFile newRawFile = method.getResult();
      newRawFile.setName(newName);
      project.addFile(newRawFile);
    });

    // Add the task to the queue
    tasks.add(newTask);

  }

}