Code Monkey home page Code Monkey logo

Comments (8)

egonw avatar egonw commented on September 24, 2024 1

I got some time to look into the notebook more... there was at least a step missing... the bdbClass should not be used in a static way, but be instantiated around an "Eclipse workspace":

workspaceRoot = "."
bdbClass = jimport("net.bioclipse.managers.BridgedbManager")
bdb = bdbClass(workspaceRoot)

Then, put the BridgeDb database in a project (which will go into that workspace):

!mkdir -p BridgeDb; cd BridgeDb; wget https://ndownloader.figshare.com/files/26001794
!cp 26001794 metabolites_20210109.bridge

Then, the loading would be like this:

test = bdb.loadRelationalDatabase("/BridgeDb/metabolites_20210109.bridge")

But then I still run into a problem, a missing class. I will look into that next.

from bacting.

egonw avatar egonw commented on September 24, 2024 1

Okay, the method actually doesn't use the workspace approach :/

So, this is the code that works for me now:

from scyjava import config, jimport

config.add_endpoints('io.github.egonw.bacting:managers-bridgedb:0.0.23-SNAPSHOT')

workspaceRoot = "."
bdbClass = jimport("net.bioclipse.managers.BridgedbManager")
bdb = bdbClass(workspaceRoot)

test = bdb.loadRelationalDatabase("./Test/complexes_20200510.bridge")

I will try to release 0.0.23 today.

from bacting.

egonw avatar egonw commented on September 24, 2024 1

Bacting 0.0.23 is released which includes this fix.

from bacting.

kozo2 avatar kozo2 commented on September 24, 2024 1

@egonw Thanks. I updated https://colab.research.google.com/drive/1hs-yuKl_pOCIkUl5DM4h_Ecyp6rI2cOx?usp=sharing .
It works well.

from bacting.

egonw avatar egonw commented on September 24, 2024

@kozo2, sorry for the delay... could I ask you to try the following?

test = bdbClass.loadRelationalDatabase(to_java("./metabolites_20210109.bridge"))

Looking at the error message, I think it's trying to pass a Python str to the method, see also https://github.com/scijava/scyjava#available-functions

from bacting.

kozo2 avatar kozo2 commented on September 24, 2024

@egonw I updated https://colab.research.google.com/drive/1hs-yuKl_pOCIkUl5DM4h_Ecyp6rI2cOx?usp=sharing
It tries

import scyjava
test = bdbClass.loadRelationalDatabase(scyjava.to_java("./metabolites_20210109.bridge"))

but, there is still the following TypeError

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-12-3d6a271882bf> in <module>()
----> 1 test = bdbClass.loadRelationalDatabase(scyjava.to_java("./metabolites_20210109.bridge"))
      2 #test = bdbClass.loadRelationalDatabase("./metabolites_20210109.bridge")

TypeError: No matching overloads found for *static* net.bioclipse.managers.BridgedbManager.loadRelationalDatabase(java.lang.String), options are:
	public org.bridgedb.IDMapper net.bioclipse.managers.BridgedbManager.loadRelationalDatabase(java.lang.String) throws net.bioclipse.core.business.BioclipseException

image

from bacting.

egonw avatar egonw commented on September 24, 2024

I can confirm this dependency is indeed not given. Fixing this now.

from bacting.

egonw avatar egonw commented on September 24, 2024

Fixed in 08a23fb

from bacting.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.