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;
}
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);
}
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);
}
}
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());
}
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;
}
Aggregations