BioTapestry / Production

Current BioTapestry production source code release
5 stars 3 forks source link

BioTapestry tutorial runtime error, experienced in BioTapestry Tutorial: Building Networks from Interaction Tables when “Region A – 3 hours” #7

Open RichardBruskiewich opened 4 years ago

RichardBruskiewich commented 4 years ago

BioTapestry tutorial runtime error, experienced in BioTapestry Tutorial: Building Networks from Interaction Tables when “Region A – 3 hours” submodule is being populated by the Tools->Build Network from Description.... operation, after selecting the 3 A region genes and clicking “OK”: Java version = 12.0.1 vendor = Oracle Corporation operating system = Windows 10 java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0 at java.base/jdk.internal.util.Preconditions.outOfBounds(Unknown Source) at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Unknown Source) at java.base/jdk.internal.util.Preconditions.checkIndex(Unknown Source) at java.base/java.util.Objects.checkIndex(Unknown Source) at java.base/java.util.ArrayList.set(Unknown Source) at org.systemsbiology.biotapestry.cmd.instruct.DialogBuiltSignalProtoMotif.matchingLinkSet(DialogBuiltSignalProtoMotif.java:411) at org.systemsbiology.biotapestry.cmd.instruct.DialogBuiltSignalProtoMotif.patternMatchMotif(DialogBuiltSignalProtoMotif.java:256) at org.systemsbiology.biotapestry.cmd.flow.netBuild.BuildSupport.extractDialogBuiltMotifs(BuildSupport.java:1701) at org.systemsbiology.biotapestry.cmd.flow.netBuild.BuildSupport.buildRootFromInstructionsNoRootInstall(BuildSupport.java:1258) at org.systemsbiology.biotapestry.cmd.instruct.BuildInstructionProcessor.propagateChanges(BuildInstructionProcessor.java:873) at org.systemsbiology.biotapestry.cmd.instruct.BuildInstructionProcessor.processInstructions(BuildInstructionProcessor.java:519) at org.systemsbiology.biotapestry.cmd.flow.netBuild.DialogBuild$BuildRunner.runCore(DialogBuild.java:498) at org.systemsbiology.biotapestry.util.BackgroundWorker.runBackground(BackgroundWorker.java:85) at org.systemsbiology.biotapestry.util.BackgroundWorker.run(BackgroundWorker.java:70) at java.base/java.lang.Thread.run(Unknown Source)

RichardBruskiewich commented 4 years ago

The offending piece of code is this:

    retval.set(POSITIVE_, retvalPos);
    retval.set(NEGATIVE_, retvalNeg);

in DialogBuiltSignalProtoMotif.matchingLinkSet, simply because one cannot set a value using an index which is outside the bounds of the array, which is in this case, empty!

Considering the values of the set indices:

  private final static int POSITIVE_ = 0; 
  private final static int NEGATIVE_ = 1;   

Would it simply be sensible here to use the List add method? I'll make the change online and (of consequence) issue the pull request, OK?

RichardBruskiewich commented 4 years ago

Pull request issued @wjrl and @wlongabaugh (are you one and the same, lol?)

I could (under duress) but would rather not, attempt a build of the system. Hopefully this bug fix can be issued and the patched code released quickly, since I'm actively playing with Biotapestry for some serious scientific purpose!

PS. I'm Canadian and live just north of you on Vancouver Island, BC, but have two contracts working with US projects at present (one, NCATS Translator, of which has ISB as a primary collaborator!)

wlongabaugh commented 4 years ago

Thanks for the bug report and the quick patch! Turns out the "Signal-Mediated Promotion" stuff is pretty old and unused, and you might be running into other gnarly issues pretty quickly with that stuff. My current recommendation is to avoid that approach entirely and just build the signaling motif from the component parts: the individual bubbles and the signal chevron, using the first tab. In fact, if I am going the route of building from an interaction list, I use the CSV input (the next tutorial) instead of the UI unless I am just tossing a small example together.

I will look your patch over and I expect I will accept it, but it is unlikely it will get turned around quickly enough. Sorry about that. And my apologies about the tutorial and code not being up to date. Grant funding for the project ended about three years ago.

(Yeah, I know people on the NCATS Translator. Small world!)

Feel free to email me with questions.

Bill

RichardBruskiewich commented 4 years ago

Hello @wlongabaugh, as it happens, this bug also creeps into the CSV loading tutorial when one attempts to load a revised version of the CSV file into Biotapestry. I guess after the first CSV is loaded, the Interaction Tables are now present with whatever curious issues which crash the interaction tutorial as well when table updates are attempted (manually, through dialogs).

I was simply applying the recommended versions to the CSV file (removing an interaction, moving an orphan node into an interaction, adding a box interaction), nothing touching the signal motif.

wlongabaugh commented 4 years ago

Yeah, the CSV stuff works ok with simple additional or removed nodes. I can believe it has problems when existing nodes are being modified, particularly if you choose to retain the existing layout. It is also true that the incremental layout technique it uses for added nodes is pretty awful. I have traditionally only used the CSV import as a one-shot final import, and not as part of an iterative refinement cycle....and it shows. Sorry.

RichardBruskiewich commented 4 years ago

So sorry @wlongabaugh, I'm really distracting you from your day job now, finding the chinks in the armour of BioTapestry! No matter: I love the software. It's super fun to use. I'm sure that, eventually, pending some future (funded?) work, the rough edges can be alleviated. I don't know how challenging it will be to stick with "one-shot" CSV import... since post-processing of automatically laid out networks is a little bit of work... it would be nice to eventually to be saved repeating the effort each time a CSV is loaded. Anyhow, as promised, I may see how I can help over time.