Skip to content

Commit f006c4b

Browse files
committed
Checking if the input file list is empty when deciding if running a module.
Partially due to the bug reported by #1263 (comment)
1 parent 185647c commit f006c4b

File tree

1 file changed

+32
-11
lines changed

1 file changed

+32
-11
lines changed

MSFragger-GUI/src/com/dmtavt/fragpipe/FragpipeRun.java

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,6 +1130,7 @@ private static boolean configureTaskGraph(JComponent parent, Path wd, Path jarPa
11301130

11311131
CmdCheckCentroid cmdCheckCentroid = new CmdCheckCentroid(true, wd);
11321132
addConfig.accept(cmdCheckCentroid, () -> {
1133+
cmdCheckCentroid.setRun(cmdCheckCentroid.isRun() && !sharedLcmsFiles.isEmpty());;
11331134
if (cmdCheckCentroid.isRun()) {
11341135
return cmdCheckCentroid.configure(jarPath, ramGb, threads, sharedLcmsFiles);
11351136
}
@@ -1155,6 +1156,7 @@ private static boolean configureTaskGraph(JComponent parent, Path wd, Path jarPa
11551156
final UmpirePanel umpirePanel = Fragpipe.getStickyStrict(UmpirePanel.class);
11561157
final CmdUmpireSe cmdUmpire = new CmdUmpireSe(umpirePanel.isRun(), wd);
11571158
addConfig.accept(cmdUmpire, () -> {
1159+
cmdUmpire.setRun(cmdUmpire.isRun() && !sharedLcmsFiles.isEmpty());
11581160
if (cmdUmpire.isRun()) {
11591161
if (!cmdUmpire.configure(parent, isDryRun, jarPath, ramGb, Paths.get(binMsfragger.getBin()), umpirePanel, sharedLcmsFiles)) {
11601162
return false;
@@ -1188,6 +1190,7 @@ private static boolean configureTaskGraph(JComponent parent, Path wd, Path jarPa
11881190
final TreeMap<InputLcmsFile, List<Path>> sharedPepxmlFiles = new TreeMap<>();
11891191

11901192
addConfig.accept(cmdMsfragger, () -> {
1193+
cmdMsfragger.setRun(cmdMsfragger.isRun() && !sharedLcmsFiles.isEmpty());
11911194
if (cmdMsfragger.isRun()) {
11921195
if (!cmdMsfragger.configure(parent, isDryRun, jarPath, binMsfragger, fastaFile, tabMsf.getParams(), tabMsf.getNumDbSlices(), ramGb, sharedLcmsFiles, decoyTag, tabWorkflow.hasDataType("DDA"), tabWorkflow.hasDataType("DIA"), tabWorkflow.hasDataType("GPF-DIA"), tabWorkflow.hasDataType("DIA-Lib"), tabWorkflow.hasDataType("WWA"), cmdUmpire.isRun(), tabRun.isWriteSubMzml())) {
11931196
return false;
@@ -1225,6 +1228,7 @@ private static boolean configureTaskGraph(JComponent parent, Path wd, Path jarPa
12251228
final CmdCrystalc cmdCrystalc = new CmdCrystalc(crystalcPanel.isRun(), wd);
12261229

12271230
addConfig.accept(cmdCrystalc, () -> {
1231+
cmdCrystalc.setRun(cmdCrystalc.isRun() && !sharedPepxmlFiles.isEmpty());
12281232
if (cmdCrystalc.isRun()) {
12291233
CrystalcParams ccParams = crystalcPanel.toParams();
12301234
if (threads > 0) {
@@ -1245,6 +1249,7 @@ private static boolean configureTaskGraph(JComponent parent, Path wd, Path jarPa
12451249
final MSBoosterPanel MSBoosterPanel = Fragpipe.getStickyStrict(MSBoosterPanel.class);
12461250
final CmdMSBooster cmdMSBooster = new CmdMSBooster(MSBoosterPanel.isRun(), wd);
12471251
addConfig.accept(cmdMSBooster, () -> {
1252+
cmdMSBooster.setRun(cmdMSBooster.isRun() && !sharedPepxmlFilesFromMsfragger.isEmpty());
12481253
if (cmdMSBooster.isRun()) {
12491254
return cmdMSBooster.configure(parent, ramGb, threads, sharedPepxmlFilesFromMsfragger, MSBoosterPanel.predictRt(), MSBoosterPanel.predictSpectra(), MSBoosterPanel.useCorrelatedFeatures(), tabWorkflow.hasDataType("DDA"), tabWorkflow.hasDataType("DIA"), tabWorkflow.hasDataType("GPF-DIA"), tabWorkflow.hasDataType("DIA-Lib"), tabWorkflow.hasDataType("WWA"), cmdUmpire.isRun(), tabMsf.isOpenSearch());
12501255
}
@@ -1269,6 +1274,7 @@ private static boolean configureTaskGraph(JComponent parent, Path wd, Path jarPa
12691274

12701275
final Map<InputLcmsFile, List<Path>> sharedPepxmlFilesBeforePeptideValidation = new HashMap<>();
12711276
addConfig.accept(cmdPeptideProphet, () -> {
1277+
cmdPeptideProphet.setRun(cmdPeptideProphet.isRun() && !sharedPepxmlFiles.isEmpty());
12721278
sharedPepxmlFilesBeforePeptideValidation.putAll(sharedPepxmlFiles);
12731279
if (cmdPeptideProphet.isRun()) {
12741280
final String pepProphCmd = pepProphPanel.getCmdOpts();
@@ -1301,6 +1307,7 @@ private static boolean configureTaskGraph(JComponent parent, Path wd, Path jarPa
13011307
});
13021308

13031309
addConfig.accept(cmdPercolator, () -> {
1310+
cmdPercolator.setRun(cmdPercolator.isRun() && !sharedPepxmlFilesBeforePeptideValidation.isEmpty());
13041311
if (cmdPercolator.isRun()) {
13051312
final String percolatorCmd = percolatorPanel.getCmdOpts();
13061313
if (!cmdPercolator.configure(parent, jarPath, percolatorCmd, isCombinedPepxml_percolator, sharedPepxmlFilesBeforePeptideValidation, crystalcPanel.isRun(), percolatorPanel.getMinProb(), decoyTag, tabMsf.isWriteCalMzml() && tabMsf.getMassCalibration() > 0, tabRun.isWriteSubMzml())) {
@@ -1320,13 +1327,13 @@ private static boolean configureTaskGraph(JComponent parent, Path wd, Path jarPa
13201327
final PtmProphetPanel panelPtmProphet = Fragpipe.getStickyStrict(PtmProphetPanel.class);
13211328
final CmdPtmProphet cmdPtmProphet = new CmdPtmProphet(panelPtmProphet.isRun(), wd);
13221329
addConfig.accept(cmdPtmProphet, () -> {
1323-
13241330
// PeptideProphet is run, so we run adjustments of the pepxml files.
13251331
List<Tuple2<InputLcmsFile, Path>> lcmsToPepxml = Seq.seq(sharedPepxmlFiles)
13261332
.flatMap(tuple -> tuple.v2.stream().map(o -> new Tuple2<>(tuple.v1, o)))
13271333
.toList();
13281334

1329-
if (panelPtmProphet.isRun()) {
1335+
cmdPtmProphet.setRun(cmdPtmProphet.isRun() && !lcmsToPepxml.isEmpty());
1336+
if (cmdPtmProphet.isRun()) {
13301337
return cmdPtmProphet.configure(parent, panelPtmProphet.getCmdLineOpts(), lcmsToPepxml, threads);
13311338
}
13321339
return true;
@@ -1339,6 +1346,7 @@ private static boolean configureTaskGraph(JComponent parent, Path wd, Path jarPa
13391346
final CmdProteinProphet cmdProteinProphet = new CmdProteinProphet(isRunProteinProphet, wd);
13401347

13411348
addConfig.accept(cmdProteinProphet, () -> {
1349+
cmdProteinProphet.setRun(cmdProteinProphet.isRun() && !sharedPepxmlFiles.isEmpty());
13421350
final boolean isMuiltiExperimentReport = sharedLcmsFileGroups.size() > 1;
13431351
if (cmdProteinProphet.isRun()) {
13441352
final String protProphCmdStr = protProphPanel.getCmdOpts();
@@ -1351,17 +1359,15 @@ private static boolean configureTaskGraph(JComponent parent, Path wd, Path jarPa
13511359
return true;
13521360
});
13531361

1354-
final boolean isReport = reportPanel.isRun();
13551362
final QuantPanelLabelfree quantPanelLabelfree = Fragpipe
13561363
.getStickyStrict(QuantPanelLabelfree.class);
13571364
final boolean isFreequant = quantPanelLabelfree.isRunFreeQuant();
13581365

13591366
// run Report - DbAnnotate
1360-
final boolean isDbAnnotate = isReport;
1361-
final CmdPhilosopherDbAnnotate cmdPhilosopherDbAnnotate = new CmdPhilosopherDbAnnotate(
1362-
isDbAnnotate, wd);
1367+
final CmdPhilosopherDbAnnotate cmdPhilosopherDbAnnotate = new CmdPhilosopherDbAnnotate(reportPanel.isRun(), wd);
13631368

13641369
addConfig.accept(cmdPhilosopherDbAnnotate, () -> {
1370+
cmdPhilosopherDbAnnotate.setRun(cmdPhilosopherDbAnnotate.isRun() && !sharedPepxmlFiles.isEmpty());
13651371
if (cmdPhilosopherDbAnnotate.isRun()) {
13661372
return cmdPhilosopherDbAnnotate
13671373
.configure(parent, ramGb, threads, usePhi, fastaFile, decoyTag, sharedPepxmlFiles.firstKey());
@@ -1370,7 +1376,7 @@ private static boolean configureTaskGraph(JComponent parent, Path wd, Path jarPa
13701376
});
13711377

13721378
// run Report - Filter
1373-
final CmdPhilosopherFilter cmdPhilosopherFilter = new CmdPhilosopherFilter(isReport, wd);
1379+
final CmdPhilosopherFilter cmdPhilosopherFilter = new CmdPhilosopherFilter(reportPanel.isRun(), wd);
13741380

13751381
addCheck.accept(() -> {
13761382
if (cmdPhilosopherFilter.isRun()) {
@@ -1380,6 +1386,7 @@ private static boolean configureTaskGraph(JComponent parent, Path wd, Path jarPa
13801386
});
13811387

13821388
addConfig.accept(cmdPhilosopherFilter, () -> {
1389+
cmdPhilosopherFilter.setRun(cmdPhilosopherFilter.isRun() && !sharedPepxmlFiles.isEmpty());
13831390
if (cmdPhilosopherFilter.isRun()) {
13841391
final boolean isCheckFilterNoProtxml = reportPanel.isNoProtXml();
13851392

@@ -1435,11 +1442,12 @@ private static boolean configureTaskGraph(JComponent parent, Path wd, Path jarPa
14351442
final TmtiPanel tmtiPanel = Fragpipe.getStickyStrict(TmtiPanel.class);
14361443

14371444
// run Report - Report command itself
1438-
final CmdPhilosopherReport cmdPhilosopherReport = new CmdPhilosopherReport(isReport, wd);
1445+
final CmdPhilosopherReport cmdPhilosopherReport = new CmdPhilosopherReport(reportPanel.isRun(), wd);
14391446
final boolean doPrintDecoys = reportPanel.isPrintDecoys();
14401447
final boolean doMSstats = reportPanel.isMsstats() && !quantPanelLabelfree.isRunIonQuant(); // Don't let Philosopher generate MSstats files if IonQuant is going to run because IonQuant will generate them.
14411448

14421449
addConfig.accept(cmdPhilosopherReport, () -> {
1450+
cmdPhilosopherReport.setRun(cmdPhilosopherReport.isRun() && !sharedMapGroupsToProtxml.isEmpty());
14431451
if (cmdPhilosopherReport.isRun()) {
14441452
final boolean isMultiExpReport = sharedLcmsFileGroups.size() > 1;
14451453
return cmdPhilosopherReport.configure(parent, ramGb, threads, usePhi, doPrintDecoys, doMSstats, isMultiExpReport, reportPanel.isRemoveContaminants(), sharedMapGroupsToProtxml);
@@ -1475,8 +1483,9 @@ private static boolean configureTaskGraph(JComponent parent, Path wd, Path jarPa
14751483
});
14761484

14771485
// run Report - Freequant (Labelfree)
1478-
final CmdFreequant cmdFreequant = new CmdFreequant(isReport && isFreequant, wd);
1486+
final CmdFreequant cmdFreequant = new CmdFreequant(reportPanel.isRun() && isFreequant, wd);
14791487
addConfig.accept(cmdFreequant, () -> {
1488+
cmdFreequant.setRun(cmdFreequant.isRun() && !sharedMapGroupsToProtxml.isEmpty());
14801489
if (cmdFreequant.isRun()) {
14811490
return cmdFreequant.configure(parent, usePhi, quantPanelLabelfree.getFreequantOptsAsText(), sharedMapGroupsToProtxml, tmtiPanel.isRun(), tabMsf.isOpenSearch());
14821491
}
@@ -1487,6 +1496,7 @@ private static boolean configureTaskGraph(JComponent parent, Path wd, Path jarPa
14871496
PTMSGlycanAssignPanel ptmsGlycanPanel = Fragpipe.getStickyStrict(PTMSGlycanAssignPanel.class);
14881497
final CmdAppendFile cmdAppendFile = new CmdAppendFile(ptmsGlycanPanel.isRun() && quantPanelLabelfree.isRunIonQuant(), wd);
14891498
addConfig.accept(cmdAppendFile, () -> {
1499+
cmdAppendFile.setRun(cmdAppendFile.isRun() && !sharedPepxmlFilesFromMsfragger.isEmpty());
14901500
if (cmdAppendFile.isRun()) {
14911501
return cmdAppendFile.configure(parent, jarPath,"modmasses_ionquant.txt", "ptm-shepherd-output/glyco_masses_list.txt");
14921502
}
@@ -1521,6 +1531,7 @@ private static boolean configureTaskGraph(JComponent parent, Path wd, Path jarPa
15211531
modMassSet.addAll(tabMsf.getMassOffsetSet());
15221532

15231533
addConfig.accept(cmdIonquant, () -> {
1534+
cmdIonquant.setRun(cmdIonquant.isRun() && !sharedPepxmlFilesFromMsfragger.isEmpty());
15241535
if (cmdIonquant.isRun()) {
15251536
OPairPanel oPairPanel = Bus.getStickyEvent(OPairPanel.class);
15261537
if (oPairPanel == null) {
@@ -1535,11 +1546,11 @@ private static boolean configureTaskGraph(JComponent parent, Path wd, Path jarPa
15351546

15361547
// run TMT-Integrator
15371548
final boolean isTmt = tmtiPanel.isRun();
1538-
final boolean isTmtLqFq = tmtiPanel.isRunFqLq();
1549+
final boolean isTmtLqFq = isTmt && tmtiPanel.isRunFqLq();
15391550
final CmdTmtIntegrator cmdTmt = new CmdTmtIntegrator(isTmt, wd);
15401551

15411552
addConfig.accept(cmdTmt, () -> {
1542-
if (isTmt) {
1553+
if (isTmt && !sharedMapGroupsToProtxml.isEmpty()) {
15431554
if (sharedLcmsFiles.stream().anyMatch(f -> !f.getPath().getFileName().toString().toLowerCase().endsWith(".mzml") && !f.getPath().getFileName().toString().toLowerCase().endsWith(".raw"))) {
15441555
SwingUtils.showWarningDialog(parent, CmdTmtIntegrator.NAME + " only supports mzML and raw files.\nPlease remove other files from the input list.", CmdTmtIntegrator.NAME + " error");
15451556
return false;
@@ -1569,6 +1580,7 @@ private static boolean configureTaskGraph(JComponent parent, Path wd, Path jarPa
15691580
return true;
15701581
});
15711582
addConfig.accept(cmdTmtFreequant, () -> {
1583+
cmdTmtFreequant.setRun(cmdTmtFreequant.isRun() && !sharedMapGroupsToProtxml.isEmpty());
15721584
if (cmdTmtFreequant.isRun()) {
15731585
return cmdTmtFreequant.configure(parent, usePhi, quantPanelLabelfree.getFreequantOptsAsText(), sharedMapGroupsToProtxml, tmtiPanel.isRun(), tabMsf.isOpenSearch());
15741586
}
@@ -1604,6 +1616,7 @@ private static boolean configureTaskGraph(JComponent parent, Path wd, Path jarPa
16041616
});
16051617

16061618
addConfig.accept(cmdTmtLabelQuant, () -> {
1619+
cmdTmtLabelQuant.setRun(cmdTmtLabelQuant.isRun() && !sharedMapGroupsToProtxml.isEmpty());
16071620
if (cmdTmtLabelQuant.isRun()) {
16081621
QuantLabel label = tmtiPanel.getSelectedLabel();
16091622
String quantLevel = tmtiPanel.getQuantLevel();
@@ -1621,6 +1634,7 @@ private static boolean configureTaskGraph(JComponent parent, Path wd, Path jarPa
16211634
final OPairPanel oPairPanel = Fragpipe.getStickyStrict(OPairPanel.class);
16221635
CmdPairScans cmdPairScans = new CmdPairScans(oPairPanel.isRun(), wd);
16231636
addConfig.accept(cmdPairScans, () -> {
1637+
cmdPairScans.setRun(cmdPairScans.isRun() && !sharedLcmsFiles.isEmpty());
16241638
if (cmdPairScans.isRun()) {
16251639
return cmdPairScans.configure(parent, Paths.get(binMsfragger.getBin()), jarPath, ramGb, threads, sharedLcmsFiles, oPairPanel.getOPairParams());
16261640
}
@@ -1631,6 +1645,7 @@ private static boolean configureTaskGraph(JComponent parent, Path wd, Path jarPa
16311645
CmdOPair cmdOPair = new CmdOPair(oPairPanel.isRun(), wd);
16321646
OPairParams oPairParams = oPairPanel.getOPairParams();
16331647
addConfig.accept(cmdOPair, () -> {
1648+
cmdOPair.setRun(cmdOPair.isRun() && !sharedMapGroupsToProtxml.isEmpty());
16341649
if (cmdOPair.isRun()) {
16351650
return cmdOPair.configure(parent, wd, sharedMapGroupsToProtxml, oPairParams, isDryRun, tabMsf.isWriteCalMzml() && tabMsf.getMassCalibration() > 0, threads);
16361651
}
@@ -1654,6 +1669,7 @@ private static boolean configureTaskGraph(JComponent parent, Path wd, Path jarPa
16541669
return true;
16551670
});
16561671
addConfig.accept(cmdPtmshepherd, () -> {
1672+
cmdPtmshepherd.setRun(cmdPtmshepherd.isRun() && !sharedMapGroupsToProtxml.isEmpty());
16571673
if (cmdPtmshepherd.isRun()) {
16581674
Path fastaPath = Paths.get(fastaFile);
16591675
Map<String, String> additionalShepherdParams = ptmsPanel.toPtmsParamsMap();
@@ -1696,14 +1712,17 @@ private static boolean configureTaskGraph(JComponent parent, Path wd, Path jarPa
16961712

16971713
// run TMT-Integrator a second time to provide unmodified peptide data as well as modified (does NOT rerun freequant/labelquant)
16981714
addConfig.accept(cmdTmtFpop, () -> {
1715+
cmdTmtFpop.setRun(cmdTmtFpop.isRun() && !sharedMapGroupsToProtxml.isEmpty());
16991716
if (sharedLcmsFiles.stream().anyMatch(f -> !f.getPath().getFileName().toString().toLowerCase().endsWith(".mzml") && !f.getPath().getFileName().toString().toLowerCase().endsWith(".raw"))) {
17001717
SwingUtils.showWarningDialog(parent, CmdTmtIntegrator.NAME + " only supports mzML and raw files.\nPlease remove other files from the input list.", CmdTmtIntegrator.NAME + " error");
17011718
return false;
17021719
}
17031720
return cmdTmtFpop.configure(tmtiPanel, isDryRun, ramGb, decoyTag, sharedMapGroupsToProtxml, doMSstats, tmtiPanel.getAnnotations(), true);
17041721
});
17051722
}
1723+
17061724
addConfig.accept(cmdFpopQuant, () -> {
1725+
cmdFpopQuant.setRun(cmdFpopQuant.isRun() && !sharedMapGroupsToProtxml.isEmpty());
17071726
if (cmdFpopQuant.isRun()) {
17081727
return cmdFpopQuant.configure(parent);
17091728
}
@@ -1725,6 +1744,7 @@ private static boolean configureTaskGraph(JComponent parent, Path wd, Path jarPa
17251744
return false;
17261745
}
17271746

1747+
cmdSpecLibGen.setRun(cmdSpecLibGen.isRun() && !sharedMapGroupsToProtxml.isEmpty());
17281748
if (cmdSpecLibGen.isRun()) {
17291749
NoteConfigSpeclibgen speclibConf = Fragpipe.getStickyStrict(NoteConfigSpeclibgen.class);
17301750
if (!speclibConf.isValid()) {
@@ -1757,6 +1777,7 @@ private static boolean configureTaskGraph(JComponent parent, Path wd, Path jarPa
17571777
// write sub mzML files
17581778
final CmdWriteSubMzml cmdWriteSubMzml = new CmdWriteSubMzml(tabRun.isWriteSubMzml(), wd);
17591779
addConfig.accept(cmdWriteSubMzml, () -> {
1780+
cmdWriteSubMzml.setRun(cmdWriteSubMzml.isRun() && !sharedLcmsFileGroups.isEmpty());
17601781
if (cmdWriteSubMzml.isRun()) {
17611782
return cmdWriteSubMzml.configure(parent, jarPath, ramGb, threads, sharedLcmsFileGroups, tabRun.getSubMzmlProbThreshold(), tabMsf.isRun());
17621783
}

0 commit comments

Comments
 (0)