Search in sources :

Example 86 with RawDataFile

use of net.sf.mzmine.datamodel.RawDataFile in project mzmine2 by mzmine.

the class MetaboAnalystExportTask method checkPeakList.

private boolean checkPeakList(PeakList peakList) {
    // Check if each sample group has at least 3 samples
    final RawDataFile[] rawDataFiles = peakList.getRawDataFiles();
    for (RawDataFile file : rawDataFiles) {
        final String fileValue = String.valueOf(project.getParameterValue(groupParameter, file));
        int count = 0;
        for (RawDataFile countFile : rawDataFiles) {
            final String countValue = String.valueOf(project.getParameterValue(groupParameter, countFile));
            if (countValue.equals(fileValue))
                count++;
        }
        if (count < 3)
            return false;
    }
    return true;
}
Also used : RawDataFile(net.sf.mzmine.datamodel.RawDataFile)

Example 87 with RawDataFile

use of net.sf.mzmine.datamodel.RawDataFile in project mzmine2 by mzmine.

the class GnpsGcSubmitParameters method openKovatsDialog.

/**
 * OPen Kovats creation dialog, save file and retrieve file
 *
 * @param pn
 */
private void openKovatsDialog(FileNameComponent pn) {
    // at least one raw data file in project
    RawDataFile[] raw = MZmineCore.getProjectManager().getCurrentProject().getDataFiles();
    if (raw == null || raw.length <= 0) {
        DialogLoggerUtil.showMessageDialogForTime(MZmineCore.getDesktop().getMainWindow(), "No RAW data files", "Cannot use Kovats extraction without raw data files in this project", 3500);
        return;
    }
    // todo open dialog
    ParameterSet param = MZmineCore.getConfiguration().getModuleParameters(KovatsIndexExtractionModule.class);
    KovatsIndexExtractionDialog kd = new KovatsIndexExtractionDialog(null, param, savedFile -> pn.setValue(savedFile));
    kd.setVisible(true);
}
Also used : ParameterSet(net.sf.mzmine.parameters.ParameterSet) SimpleParameterSet(net.sf.mzmine.parameters.impl.SimpleParameterSet) KovatsIndexExtractionDialog(net.sf.mzmine.modules.tools.kovats.KovatsIndexExtractionDialog) RawDataFile(net.sf.mzmine.datamodel.RawDataFile)

Example 88 with RawDataFile

use of net.sf.mzmine.datamodel.RawDataFile in project mzmine2 by mzmine.

the class RemoveFilePopupMenu method menuSelected.

/**
 * @see javax.swing.event.MenuListener#menuSelected(javax.swing.event.MenuEvent)
 */
public void menuSelected(MenuEvent event) {
    // Clear the menu
    removeAll();
    // get all project files
    RawDataFile[] openFiles = MZmineCore.getProjectManager().getCurrentProject().getDataFiles();
    List<RawDataFile> visualizedFiles = Arrays.asList(visualizer.getRawDataFiles());
    menuItemFiles = new Hashtable<JMenuItem, RawDataFile>();
    for (RawDataFile file : openFiles) {
        // if file is not part of plot, skip it
        if (!visualizedFiles.contains(file))
            continue;
        // add a menu item for file
        JMenuItem newItem = new JMenuItem(file.getName());
        newItem.addActionListener(this);
        menuItemFiles.put(newItem, file);
        add(newItem);
    }
}
Also used : RawDataFile(net.sf.mzmine.datamodel.RawDataFile) JMenuItem(javax.swing.JMenuItem)

Example 89 with RawDataFile

use of net.sf.mzmine.datamodel.RawDataFile in project mzmine2 by mzmine.

the class TICVisualizerWindow method updateTitle.

void updateTitle() {
    NumberFormat rtFormat = MZmineCore.getConfiguration().getRTFormat();
    NumberFormat mzFormat = MZmineCore.getConfiguration().getMZFormat();
    NumberFormat intensityFormat = MZmineCore.getConfiguration().getIntensityFormat();
    StringBuffer mainTitle = new StringBuffer();
    StringBuffer subTitle = new StringBuffer();
    // If all data files have m/z range less than or equal to range of
    // the plot (mzMin, mzMax), then call this TIC, otherwise XIC
    Set<RawDataFile> fileSet = ticDataSets.keySet();
    String ticOrXIC = "TIC";
    // Enlarge range a bit to avoid rounding errors
    Range<Double> mzRange2 = Range.range(mzRange.lowerEndpoint() - 1, BoundType.CLOSED, mzRange.upperEndpoint() + 1, BoundType.CLOSED);
    for (RawDataFile df : fileSet) {
        if (!mzRange2.encloses(df.getDataMZRange())) {
            ticOrXIC = "XIC";
            break;
        }
    }
    if (plotType == TICPlotType.BASEPEAK) {
        if (ticOrXIC.equals("TIC")) {
            mainTitle.append("Base peak chromatogram");
        } else {
            mainTitle.append("XIC (base peak)");
        }
    } else {
        if (ticOrXIC.equals("TIC")) {
            mainTitle.append("TIC");
        } else {
            mainTitle.append("XIC");
        }
    }
    mainTitle.append(", m/z: " + mzFormat.format(mzRange.lowerEndpoint()) + " - " + mzFormat.format(mzRange.upperEndpoint()));
    CursorPosition pos = getCursorPosition();
    if (pos != null) {
        subTitle.append("Selected scan #");
        subTitle.append(pos.getScanNumber());
        if (ticDataSets.size() > 1) {
            subTitle.append(" (" + pos.getDataFile() + ")");
        }
        subTitle.append(", RT: " + rtFormat.format(pos.getRetentionTime()));
        if (plotType == TICPlotType.BASEPEAK) {
            subTitle.append(", base peak: " + mzFormat.format(pos.getMzValue()) + " m/z");
        }
        subTitle.append(", IC: " + intensityFormat.format(pos.getIntensityValue()));
    }
    // update window title
    RawDataFile[] files = ticDataSets.keySet().toArray(new RawDataFile[0]);
    Arrays.sort(files, new SimpleSorter());
    String dataFileNames = Joiner.on(",").join(files);
    setTitle("Chromatogram: [" + dataFileNames + "; " + mzFormat.format(mzRange.lowerEndpoint()) + " - " + mzFormat.format(mzRange.upperEndpoint()) + " m/z" + "]");
    // update plot title
    ticPlot.setTitle(mainTitle.toString(), subTitle.toString());
}
Also used : RawDataFile(net.sf.mzmine.datamodel.RawDataFile) SimpleSorter(net.sf.mzmine.util.SimpleSorter) NumberFormat(java.text.NumberFormat)

Example 90 with RawDataFile

use of net.sf.mzmine.datamodel.RawDataFile in project mzmine2 by mzmine.

the class TwoDVisualizerModule method runModule.

@Override
@Nonnull
public ExitCode runModule(@Nonnull MZmineProject project, @Nonnull ParameterSet parameters, @Nonnull Collection<Task> tasks) {
    RawDataFile[] dataFiles = parameters.getParameter(TwoDVisualizerParameters.dataFiles).getValue().getMatchingRawDataFiles();
    ScanSelection scanSel = parameters.getParameter(TwoDVisualizerParameters.scanSelection).getValue();
    Scan[] scans = scanSel.getMatchingScans(dataFiles[0]);
    Range<Double> rtRange = ScanUtils.findRtRange(scans);
    Range<Double> mzRange = parameters.getParameter(TwoDVisualizerParameters.mzRange).getValue();
    TwoDVisualizerWindow newWindow = new TwoDVisualizerWindow(dataFiles[0], scans, rtRange, mzRange, parameters);
    newWindow.setVisible(true);
    return ExitCode.OK;
}
Also used : ScanSelection(net.sf.mzmine.parameters.parametertypes.selectors.ScanSelection) RawDataFile(net.sf.mzmine.datamodel.RawDataFile) Scan(net.sf.mzmine.datamodel.Scan) Nonnull(javax.annotation.Nonnull)

Aggregations

RawDataFile (net.sf.mzmine.datamodel.RawDataFile)185 Feature (net.sf.mzmine.datamodel.Feature)59 PeakListRow (net.sf.mzmine.datamodel.PeakListRow)52 DataPoint (net.sf.mzmine.datamodel.DataPoint)51 Scan (net.sf.mzmine.datamodel.Scan)40 ArrayList (java.util.ArrayList)33 PeakList (net.sf.mzmine.datamodel.PeakList)33 Nonnull (javax.annotation.Nonnull)24 SimpleDataPoint (net.sf.mzmine.datamodel.impl.SimpleDataPoint)24 SimplePeakList (net.sf.mzmine.datamodel.impl.SimplePeakList)24 SimplePeakListRow (net.sf.mzmine.datamodel.impl.SimplePeakListRow)22 Task (net.sf.mzmine.taskcontrol.Task)20 SimplePeakListAppliedMethod (net.sf.mzmine.datamodel.impl.SimplePeakListAppliedMethod)19 SimpleFeature (net.sf.mzmine.datamodel.impl.SimpleFeature)17 IOException (java.io.IOException)14 ParameterSet (net.sf.mzmine.parameters.ParameterSet)14 File (java.io.File)13 MassList (net.sf.mzmine.datamodel.MassList)13 PeakListAppliedMethod (net.sf.mzmine.datamodel.PeakList.PeakListAppliedMethod)13 TreeMap (java.util.TreeMap)10