Skip to content

Commit

Permalink
Closes #147 - modification of the alwaysShowInvestigation property to…
Browse files Browse the repository at this point in the history
… true will ensure that the investigation is always shown in the user interface.
  • Loading branch information
eamonnmag committed May 16, 2012
1 parent 8c56e2b commit e83c165
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Expand Up @@ -48,6 +48,7 @@ The ISA Team and the ISA software suite have been funded by the EU Carcinogenomi
import org.isatools.isacreator.model.Study;
import org.isatools.isacreator.ontologymanager.OntologyManager;
import org.isatools.isacreator.ontologymanager.OntologySourceRefObject;
import org.isatools.isacreator.settings.ISAcreatorProperties;
import org.isatools.isacreator.spreadsheet.Spreadsheet;
import org.isatools.isacreator.spreadsheet.model.TableReferenceObject;
import org.isatools.isacreator.utils.datastructures.CollectionUtils;
Expand Down Expand Up @@ -294,7 +295,9 @@ public void run() {
* @return - DefaultMutableTreeNode. The root node with all nodes contained within it.
*/
private DefaultMutableTreeNode buildTreeFromInvestigation(Investigation inv) {
if (inv.getStudies().size() > 1) {
boolean alwaysShowInvestigation = Boolean.valueOf(ISAcreatorProperties.getProperty("alwaysShowInvestigation"));
System.out.println("Should I always show the investigation? " + alwaysShowInvestigation);
if (inv.getStudies().size() > 1 || alwaysShowInvestigation) {
inv.getUserInterface().update();
overviewTreeRoot = new DefaultMutableTreeNode(inv);

Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/defaultConfigs/defaultsettings.properties
@@ -1 +1,2 @@
strictValidation.isOn=false
strictValidation.isOn=false
alwaysShowInvestigation=false

16 comments on commit e83c165

@vedina
Copy link
Contributor

@vedina vedina commented on e83c165 Jun 28, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ISACreator 1.7.0 doesn't seem to use this option (no investigation is displayed if set to true), and is overwriting the entry in the settings.properties with
alwaysShowInvestigation=${isacreator.alwaysShowInvestigation}

@eamonnmag
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because you have a profile in your pom which you need to supply for it to be set.

<profile>
     <id>toxbank</id>
     <properties>
         <isacreator.alwaysShowInvestigation>true</isacreator.alwaysShowInvestigation>
     </properties>
</profile>

Although, if you modified the settings file directly, it would work.

@eamonnmag
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming this is happening when you build from source?

@vedina
Copy link
Contributor

@vedina vedina commented on e83c165 Jun 28, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I am using ISACreator 1.7.0 downloaded from isa-tools site, and edited the Settings/settings.properties file.

It will probably work if building form source, but I tried to avoid it ;)

@eamonnmag
Copy link
Member Author

@eamonnmag eamonnmag commented on e83c165 Jun 28, 2013 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eamonnmag
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found the issue. When we initially added this functionality we made a properties file called defaultsettings.properties override anything in the user settings. In the current ISAcreator build, the property for alwaysShowInvestigation is ${isacreator.alwaysShowInvestigation}, therefore even if settings.properties contains alwaysShowInvestigation=true, this is overridden with alwaysShowInvestigation=${isacreator.alwaysShowInvestigation}. If however, you had built a fresh installation with the toxbank profile, alwaysShowInvestigation would have been populated with true in the defaultsettings.properties file - I've now removed this overriding functionality, and settings.properties overrides the system defaults.

@vedina
Copy link
Contributor

@vedina vedina commented on e83c165 Jul 1, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! Would you recommend using ISACreator 1.7.0 or 1.7.1 source ?

@eamonnmag
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll be doing a push today of some new code. If you build from source, you'll remove a few small issues.

@vedina
Copy link
Contributor

@vedina vedina commented on e83c165 Jul 1, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compiling 1.7.2 development branch gives the following errors

mvn clean test

Tests in error:
importFileTest(org.isatools.isacreator.io.importisa.ISAtabFilesImporterFromGUITest)
saveISAFilesTest(org.isatools.isacreator.io.exportisa.OutputISAFilesTest)
createISATabProgrammatically(org.isatools.isacreator.io.ProgrammaticISATabCreationTest)
importFileTest(org.isatools.isacreator.io.importisa.ISAtabFilesImporterTest)

@eamonnmag
Copy link
Member Author

@eamonnmag eamonnmag commented on e83c165 Jul 1, 2013 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eamonnmag
Copy link
Member Author

@eamonnmag eamonnmag commented on e83c165 Jul 2, 2013 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vedina
Copy link
Contributor

@vedina vedina commented on e83c165 Jul 2, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'm using the development branch

~/dev/ISAcreator$ git branch

  • development

Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.45 sec
Running org.isatools.isacreator.io.importisa.ISAtabFilesImporterTest
java.io.IOException: The specified directory /home/nina/dev/ISAcreator/Configurations/isaconfig-default_v2013-02-13/ is wrong!
at org.isatools.isacreator.configuration.io.ConfigXMLParser.getTableDefinitions(ConfigXMLParser.java:175)
at org.isatools.isacreator.configuration.io.ConfigXMLParser.loadConfiguration(ConfigXMLParser.java:91)
...
Growth control of the eukaryote cell: a systems biology study in yeast
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.505 sec <<< FAILURE!
Running org.isatools.isacreator.model.ProtocolTest
Post Extraction
Derivatization
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 sec
Running org.isatools.isacreator.model.PublicationTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.01 sec
Running org.isatools.isacreator.io.importisa.InvestigationImportTest
__TESTING loadInvestigationFile() on i_investigation.txt
Growth control of the eukaryote cell: a systems biology study in yeast
Investigation title: Growth control of the eukaryote cell: a systems biology study in yeast
Number of studies: 2
Getting investigation publications:
Publication identifier: 17439666
Publication title: Growth control of the eukaryote cell: a systems biology study in yeast.
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.351 sec

Results :

Tests in error:
importFileTest(org.isatools.isacreator.io.importisa.ISAtabFilesImporterFromGUITest)
saveISAFilesTest(org.isatools.isacreator.io.exportisa.OutputISAFilesTest)
createISATabProgrammatically(org.isatools.isacreator.io.ProgrammaticISATabCreationTest)
importFileTest(org.isatools.isacreator.io.importisa.ISAtabFilesImporterTest)

Tests run: 40, Failures: 0, Errors: 4, Skipped: 0

It seems the Configuration directory is not in the git repository.

@eamonnmag
Copy link
Member Author

@eamonnmag eamonnmag commented on e83c165 Jul 2, 2013 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@agbeltran
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can run ./package.sh to get it.

@vedina
Copy link
Contributor

@vedina vedina commented on e83c165 Jul 2, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@agbeltran thanks!
OK, it pulls the Configuration directory, but throws an error at the end (there is a hard coded path for maven). The error doesn't seem to be critical.

./package.sh: line 49: /Users/eamonnmaguire/dev/maven/bin/mvn: No such file or directory

zip error: Invalid command arguments (no such option: -)
mv: cannot stat ISAcreator-1.7.2-jar-with-dependencies.jar': No such file or directory zip warning: name not matched: ISAcreator.jar zip warning: ISAcreator-1.7.2-all.zip not found or empty Packaging up jars to run within a native MacOS container cp: cannot statISAcreator.jar': No such file or directory
Packaging completed successfully!

zip error: Invalid command arguments (no such option: -)

Running now mvn clean tests gives only two failures.
Tests in error:
importFileTest(org.isatools.isacreator.io.importisa.ISAtabFilesImporterFromGUITest) Time elapsed: 1.091 sec <<< ERROR!
java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)

createISATabProgrammatically(org.isatools.isacreator.io.ProgrammaticISATabCreationTest) Time elapsed: 0.002 sec <<< ERROR!
java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)

(yes, this is a headless machine, I guess I'll just skip tests on this build)

Finally, a minor issue - the use of "apt" in the pom.xml (and ./package.sh) prevents from running ISAcreator build on Windows, which is normally supported by maven builds.

@agbeltran
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that - it seems that that version of the script got pushed by mistake. It should be fixed now.

Please sign in to comment.