I have fixed issue 1 and 3. Tomas, can you please help with #2. I don't know
how to move it to a separate thread.
Also, when I cancel the main mzTab import task, how do I also cancel all
associated raw data file import tasks?
/Thomas
From: Tomas Pluskal [mailto:plus...@oist.jp]
Sent: 29. januar 2015 04:14
To: Developer discussion
Subject: [Mzmine-devel] MzTabImportTask
Hi Thomas,
A few comments to the mzTab import module under development:
1) This part is asking for trouble in the future
switch (fileType) {
case MZDATA:
newTasks[0] = new MzDataReadTask(project, f, newMZmineFile);
break;
because you have to cover all types of supported raw data. If we add a new type
of raw data importer to the RawDataImportModule, you will have to update the
mzTab module as well.
A better solution would be to call the RawDataImportModule.runModule() method
with a parameter set that contains all the files (File[]) you want to import.
Then the RawDataImportModule will deal with everything.
2) This part should be moved to a separate Thread, and the task should finish
immediately:
// Wait until all raw data file imports have completed
TaskQueue taskQueue = MZmineCore.getTaskController().getTaskQueue();
while (taskQueue.getNumOfWaitingTasks() > 1) { Thread.sleep(1000); }
The reason is following: if the user sets in the preferences that only 1 Task
should be executed at a time, your code will hang, because the RawDataImport
tasks will never start until the MzTabImportTask is finished.
3) Here, you are creating a peak list with all data files in the project. But
remember that the project might contain other data files from previous
analysis, not only the files you imported in the current process:
// Create Peak list
RawDataFile[] RawDataFiles =
MZmineCore.getProjectManager().getCurrentProject().getDataFiles();
PeakList newPeakList = new SimplePeakList(file.getName().replace(".mzTab",
""), RawDataFiles);
(another small detail is that RawDataFiles should be rawDataFiles by Java
conventions).
Cheers,
Tomas
===============================================
Tomas Pluskal
G0 Cell Unit, Okinawa Institute of Science and Technology Graduate University
1919-1 Tancha, Onna-son, Okinawa 904-0495, Japan
WWW: https://groups.oist.jp/g0
TEL: +81-98-966-8684
Fax: +81-98-966-2890
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Mzmine-devel mailing list
Mzmine-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mzmine-devel