Skip to content

Bugfixes for Intermine (TargetMine) connectivity - #6

Merged
jtnystrom merged 6 commits into
masterfrom
johan/intermine
Jan 3, 2023
Merged

Bugfixes for Intermine (TargetMine) connectivity#6
jtnystrom merged 6 commits into
masterfrom
johan/intermine

Conversation

@jtnystrom

Copy link
Copy Markdown
Contributor

We rely on the intermine-ws-java library to connect to InterMine instances such as TargetMine.
For some time, this library has had a bug where list creation on the server will fail if the list contains unresolved identifiers that are not strings (e.g. integers like Entrez genes). I believe that I have now fixed that bug. For more details on that problem, please see the PR that I opened in the upstream project: intermine/intermine-ws-java#7

It's not clear how long it'll take until that PR gets merged (if it gets merged), so for the time being I am adding a custom compiled jar that contains the bugfix to our Toxygates/mlib. If upstream accepts and publishes the bugfix, I will remove our custom jar again.

The antlr-2.7.6 dependency had been removed prematurely and I am restoring it here since intermine-ws-java still needs it.

Other minor bugfixes:

  • Sometimes gene lists were deleted twice by us on the server, resulting in a server exception
  • Retired an obsolete scheme where the named lists "XYZ" and "Set:XYZ" would be assumed to refer to the same object, and we had special logic to check for this
  • Style cleanups

I tested that all Intermine related functions work by importing/exporting gene sets (gene lists) using the GWT application. The next step will be to implement a Scalatra API for the same functionality, as discussed.

…mes of lists to be exported.

Lists were sometimes deleted twice, which resulted in a bug on the server side.
Also, remove the obsolete scheme where lists are sometimes named with the 'Set:' prefix, sometimes not, and we checked for both names.
…am fixes a bug related to unresolved identifiers
Comment thread Toxygates/build.xml
<!-- Set up WEB-INF/lib with jars -->
<delete dir="${wardir}/WEB-INF/lib" failonerror="false" />
<mkdir dir="${wardir}/WEB-INF/lib" />
<ivy:retrieve pattern="${wardir}/WEB-INF/lib/[artifact]-[revision].[ext]" conf="runtime" type="bundle,jar"/>

@jtnystrom jtnystrom Jan 2, 2023

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Moving this "ivy:retrieve" to be sequentially prior to the "copy" command just below allows the latter to copy the mlib/ jars (on manual.classpath) over the ivy retrieved jars.
Thus, we retrieve intermine-ws-java and its dependencies into the classpath, and then overwrite its main jar with our custom one, while still keeping its dependencies.

@yujiberra yujiberra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@jtnystrom
Thanks for making this PR!

If it's okay with you I'd like to approve this without testing it since I don't have a servlet container set up and I don't want to deal with that right now, and I'll be able to do testing once you set up an endpoint in the Scalatra app.
I can get a servlet container set up though if you'd be more comfortable that way.

For now I've just looked over the code, and I'd say it looks reasonable based on what you wrote in the PR body; I made one comment but it's not that important.

Comment on lines +95 to +98
* Delete pre-existing lists with the same name as the one about to be exported, if replacement was requested.
* Returns a list name that may be used if the export can proceed, or None if it cannot.
*/
private def validNameForExport(ls: ListService, name: Option[String],
replace: Boolean): Option[String] = {

var serverList = name.map(n => Option(ls.getList(n))).flatten
if (serverList != None && replace) {
ls.deleteList(serverList.get)
}
private def checkListNameForExport(service: ListService, name: String, replace: Boolean): Option[String] = {

@yujiberra yujiberra Jan 3, 2023

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I understand things are this way as an artifact of the old implementation, but my personal inclination would be to either split this into two methods, or to just move the logic into addEntrezList, because I feel it does two conceptually separate things:

  • delete existing lists with the same name (if replace is true)
  • check if name is usable
    • (if this were going to be separated out into a function it would probably make more sense with a boolean return value)

Definitely not a high priority though, so I wouldn't object to this being merged as-is.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your comments, see what you think of the latest changes.

…c to addEntrezList.

Add comments.
Change the tag for newly created lists from "toxygates" to "panomicon".

@yujiberra yujiberra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@jtnystrom
Thanks for the change, I think the logic is easier to understand now.

Since you didn't respond to my other comment I'm going to assume you're okay with my not actually running/testing the code, so LGTM!

@jtnystrom

Copy link
Copy Markdown
Contributor Author

@jtnystrom Thanks for the change, I think the logic is easier to understand now.

Since you didn't respond to my other comment I'm going to assume you're okay with my not actually running/testing the code, so LGTM!

Yes I'm fine with that, thanks for reviewing!

@jtnystrom
jtnystrom merged commit 28160c9 into master Jan 3, 2023
@jtnystrom
jtnystrom deleted the johan/intermine branch January 3, 2023 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants