h3abionet / genesis2

Implementation of the Genesis 2 tool
MIT License
0 stars 0 forks source link

biotools:genesis2 fair-software.eu

Genesis 2

Execution instructions

There are two builds: the one including dependences will only run on the platform for which it is built and the other can be run from the command line by adding the dependences at launch.

The latest release (2.4b, the first beta release candidate for final release) includes builds for:

and should be possible to run by double-clicking on the build in the file browser (Finder in the Mac). On Ubuntu you may need to add execute permissions. Either look at Properties in the file manager where you can set execute permission -- easy in GNOME -- or on the command line:

chmod +x Genesis2-2.4b-ubuntuX64.jar

If you wish to run from the command line, the following should work (adjusted to the JAR file for your environment):

java  -jar Genesis2-2.4b-ubuntuX64.jar

You will find more information in the docs directory; the PDF file Genesis_2_documentation_V1_1_1.pdf documents design choices and how far along the project is towards a robust, sustainable build.

Other builds

A build on another platform should work, subject to checking that the right dependences for JavaFX libraries are used. The way the project is set up, Maven should automatically find them.

To run the version that does not include dependences on the command line, you need to download a version of the JavaFX SDK.

Assuming the JavaFX library is in directory named in shell variable $JAVAFX and your JAR file is in $JARF, you can invoke it as follows:

java --module-path $JAVAFX --add-modules javafx.controls,javafx.fxml,javafx.swing -jar $JARF

Note: the library path should go to the actual contents so if e.g. the path is /usr/local/lib/JavaFX/lib then include the trailing part of the path after /lib. In my examples, the libraries are not in another layer of lib directory as this is implied by the rest of the path.

There is a Bash script genesis.sh in this repository (in scripts) that can run the above. To invoke, create environment variables that the script will use (it has defaults if you don’t do this). To the the above effect (modifying the paths to suit your install):

export JAVAFX=/usr/local/lib/JavaFX-21
export JARF=$HOME/Applications/Genesis2-2.4b-Generic.jar

Note: in Unix shell scripting, you can create a shell variable wuthout using the word EXPORT but the value will not be visible to a child process, i.e., the script will not see it. The JavaFX path should contain the actual library files -- if they are in a directory called lib append that to the path.

Building on different environemts

Test data

Data to test functionality is available in the repository in directory agm-demo/agm-genesis/sample-data/ (Windows users can rotate the slashes to suit).

Data file types available to open are:

Known issues

Latest fixes:

Tested on a Mac: if you hold SHIFT while resizingf a window, it rescales uniformly (i.e. maintains the aspect ratio).

When you save as a different name, the project now remembers the new name so when you save again, it offers the new name not its original file name.

Earlier commits shows a lot of other fixes in the README; deleted from here for brevity.

New issues now at the top.

  1. On Ubuntu, saving an image file does not set the suffix (extension) to the file type yo select; you must type it yourself. If it is a valid file type, it will be saved as that type (otherwise nothing happens).
    I would like to fix this so I did not for now put in a warning if the file does not save.
  2. On Ubuntu, the code for opening a PDF after saving it breaks so I took it out for now.
  3. If a .fam or phenotype file (.phe) has any lines not the correct length, a warning is issued and setting up the new project ends; the first line that is the wrong length is given. The number of fields (columns) is set by the first line (row).
  4. Sometimes a dialog (e.g. save file) opens behind the main window; the fix for now is to move the main window to see the dialog.
  5. If a new project is started (using New), you cannot change to another project in the same session: both New and Import are no longer available.
  6. If you open a project (Load), you can no longer create a new project, though you can load another project (or another instance of the same one -- why you would want this is not clear).
  7. There is no way to close a project once it is opened. You can close all the individual panes but when the last closes, it asks you to save, without the load to open or create another project. This is not consistently done with all close modes nor is track kept of whether to save. Saving should be different from saving as a new name.
  8. Saving saves everything that is currently visible; this possibly is what you want, including highlighting if the mouse was over an object (minus the problems of saving a hidden group, see below).
  9. Annotations are mostly completely correct. But note that if you resize the window, that is a zoomed in or out view; that does not change how the graphics content is internally represented saved.
    The aspect ratio is not necessarily maintained when you resize a window (e.g. circle becomes oval) but is correct as saved and with exporting the image.
  10. The Show Hidden feature mostly works except that changing the legend format does not save.
  11. A few exceptions get thrown, but not consistently.
    Some arose from user interface features not completely or not correctly implemented: much less an issue now.
  12. If you see a message like this when launching from the command line, it could mean you need a version of the JavaFX library (there is a compatibility issue with macOS 14.x; as tested it does not cause any other error):
    May 02, 2024 8:48:49 AM
    com.sun.glass.ui.mac.MacApplication
    lambda$waitForReactivation$6
    Fixed by installing JFX libraries v 21.0.3 to replace 21. If you change the library version, you also need to update it in pom.xml

The main difficulty in correcting annotations issues is that the way annotations are implemented is clumsy. There is a single Annotations class that represents every variation and the different annotation classes each embed this class; the proposed fix: a top-level Annotation class that only contains the common properties of all annotations and derived classes that implement functions specific to that annotation type. This will make it easier to record the state of the annotation before edits and restore it if the edit is cancelled. It is also weird that the Annotation class is in package Model while the uses of it are in Controller. You could argue that the contents of an annotation are part of the data but why are methods to manipulate it split between the model and controller?

Rather than do this, I now focus on transferring state between JavaFX view and model classes in Xoptions.java files where X is a particular annotation type.

Another issue is the confusing way a project is implemented; some thought needs to go into re-architecting this.

Funded by the NIH, Grant U24HG006941