Need Suggestion of Better Way of Plugin Configuration

54 views
Skip to first unread message

Yigang Zhou

unread,
Jun 22, 2012, 9:18:21 AM6/22/12
to cytoscap...@googlegroups.com, Carina Haupt, helen...@deri.org, Andra Waagmeester, andrea.s...@bbsrc.ac.uk
Hi,

I'm developing a bundle plugin for Cytoscape 3.x which requires user defined configuration. There will be a configuration panel where the user can select his/her preferences for some behavior of the system, e.g. turning on/off some features. My question is: where to store the configuration? And how? I'm using java.util.Properties to parsed configuration from xxx.properties. But it seems quite ugly. Any more elegant way?

More explicitly, in this plugin, we use different sparql endpoints to query and transform the RDF query result into Cytocape network. There're some predefined query strings for each sparql endpoint as part of the configuration, with some metadata of the sparql endpoint. The desirable way is to create a directory for each sparql endpoint containing its query string files and metadata files, maybe with sub-directories for specific contexts, that reflects to the user in the ability to add or select bundle of queries. The question is: where to put these directories? In the "deploy" directory of Cytocape? How to access these directories through code? The plugin is a bundle of a single package jar file. How to deploy a unpackaged plugin (i.e. with xxx.class files and package directories)?

By the way, how to deploy/install a plugin without using maven/eclipse? Just drop the jar into the "deploy" directory?

Best regards,
Yigang Zhou

On Thu, May 17, 2012 at 11:42 PM, Jason Montojo <jrr...@gmail.com> wrote:
Hi Yigang,

Based on the log output, it seems like you've combined the contents of app-developer and the M4 release.  Is that the case?

If so, extract M4 into a clean directory and try running it.  Let me know if it starts up.

As for app-developer, it's currently broken.  It doesn't automatically package a runtime environment for you.  We're working on fixing it.  In the meantime, you can still create simple apps by creating a new project and adding cytoscape-swing-app-{version}.jar to your classpath.  Just make a JAR of all your classes.  To test it out, run your clean M4 and use App Manager to load the JAR you produced.

Hope this helps,
Jason


On Thu, May 17, 2012 at 11:17 AM, Yigang Zhou <egang...@gmail.com> wrote:
Dear Jason,

Thanks a lot!

I've tried to setup Eclipse IDE for a simple app following this wikipage [2]. For the step "Build App Developer's Template Project", I ran Maven Build (clean install). But in the target directory, I could find neither the script files (e.g. cytoscape.bat, cytoscape.sh) in the root directory nor the jars in "lib". There's only one jar in "lib": cytoscape-swing-app-api-3.0.0-beta1.jar. But it's not the case with Cytoscape 3.0 alpha8, which generates the whole Cytoscape software ready for use, just like what's mentioned in the wikipage [2]. How to make beta1 the same target?

Therefore, I'm using cytoscape-windows-3.0.0-M4.zip (beta1 of Cytoscape 3.0) [1] for testing a simple app development. However, it throws exceptions when it starts to run, before I install a plugin. Please check the attachment. It seems to be related to "C:\Documents and Settings\egang.zhou\.cytoscape\images3\". I've check the directory, and there're the png images (from 1.png to 24.png, no problem). How to resolve this problem? 


Best regards,
Yigang Zhou

On Wed, May 16, 2012 at 10:37 PM, Jason Montojo <jrr...@gmail.com> wrote:
Hi Yigang,

It's possible to use third party libraries in simple apps.  You need to unpack those JARs (and their dependencies) and JAR them together with your app into a single JAR.  You can use Maven to do this.  You'll need to mark all your Cytoscape  and OSGi dependencies as "provided" so they don't get included in the JAR:

<dependency>
    <groupId>org.osgi</groupId>
    <artifactId>org.osgi.core</artifactId>
    <version>4.2.0</version>
    <scope>provided</scope>
</dependency>

Then you can use the Maven assembly plugin to package everything together:

<plugin>
    <artifactId>maven-assembly-plugin</artifactId>
    <configuration>
        <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
        </descriptorRefs>        
        <archive>
            <manifestEntries>
                <Cytoscape-App>fully.qualified.class.name.of.your.app</Cytoscape-App>
            </manifestEntries>
        </archive>
    </configuration>
</plugin>

To generate your JAR, run:

mvn clean compile assembly:single

That'll produce a JAR with "jar-with-dependencies" somewhere in the name.  That's the one you'd want to load using the App Manager.  It's kludgey but it's possible.

However, if you're already using Maven, it's not much harder to go the OSGi bundle app route.  You can use one of the sample projects as a starting point.  For example:


App Manager currently doesn't support loading bundle apps through the UI.  You'll just need to drop them into your framework/deploy directory and Cytoscape will load it automatically.

We provide the Simple App development route predominantly for people with non-Mavenized builds (e.g. make, Ant, javac/jar).  If you feel comfortable using Maven, we strongly recommend making a bundle app.

Hope this helps,
Jason


On Wed, May 16, 2012 at 12:03 AM, Yigang Zhou <egang...@gmail.com> wrote:
Hi, 

I've summarized the pros and cons of the two types of plugin here: http://vsdlc3.blogspot.com/2012/05/pros-and-cons-summary-of-two-plugin.html

According to the investigation, the dependency to the third-party libraries may be a potential issue for simple app. Is it possible to use maven in simple app without OSGi? The mentors and I are not sure about which type is the best choice. It's a critical question at the beginning of this GSoC project. We need the precise feedbacks from Cytoscape community. Your suggestion is greatly appreciated. 

Best regards,
Yigang Zhou

On Sun, May 13, 2012 at 11:56 AM, Yigang Zhou <egang...@gmail.com> wrote:
Hello,

Thanks a lot for accepting me as a GSoC 2012 student for Cytoscape. This summer, I'll work on the project of "Visualizing Semantic Data Landscapes with Cytoscape 3.0". It will mainly be mentored by Andra Waagmeester, with 3 other secondary mentors: Andrea Splendiani,  Helena Deus and Carina Haupt. They are in the cc list. We have discussed about the project plan and set up a blog (http://vsdlc3.blogspot.com/) for monitoring the project progress.

I'll turn to the Cytoscape mailing list (mainly in this thread) for help about plugin development related questions, because neither the mentors nor I am expert in Cytoscape 3.0 (Andrea has experience with the 2.0 series.).  Here's the first question:

1. There're two types of plugin of Cytoscape 3: simple app and bundle app plugin. Which one shall I work on? Is a simple app enough for our project? I think it's a simple app is OK, according to the pros and cons described in the wiki [1]. I'm not sure what are "special needs". How about the other GSoC 2012 projects of  Cytoscape 3 plugin development? Which one do they choose? And why? Any suggestion is welcome! 

---
Simple CyApp version App  (probably for the vast majority of app writers)
Pro: Hide new layers in Cytoscape 3 - developers do not have to understand details of the new technologies
Con: Can not take full advantage of

Native Cytoscape 3 App (OSGi Bundle)  (for app authors with special needs)
Pro: Developers have full access to the new technologies
Pro: Can develop cleaner and modular app - reusable
Con: Need to understand new technology
---


Best regards,
Yigang Zhou

On Tue, Apr 3, 2012 at 8:16 PM, Jason Montojo <jrr...@gmail.com> wrote:
Hi Yigang,

That's a known error in Cytoscape 3 that shouldn't prevent you from running the rest of the system so it's safe to ignore.  We fixed that error yesterday so if you do an "svn update" on your checkout, the issue should go away.

Hope this helps,
Jason

On Tue, Apr 3, 2012 at 2:49 AM, Yigang Zhou <egang...@gmail.com> wrote:
Hi,

I've successfully set up the development environment in Eclipse [1]. I
could build and run Cytoscape 3. But it threw
FactoryConfigurationError when it just started, as is shown in the
attachment. Something wrong with "biopax-impl test". Maybe it lacks of
"stax-1.2.0.jar". I've tried other snapshots from [2], but the problem
remains. Could you tell me why and how to resolve it?

Best regards,
Yigang Zhou

[1] http://wiki.cytoscape.org/Cytoscape_3/AppDeveloper/SettingUpAnIDE/Eclipse
[2] http://code.cytoscape.org/nexus/content/repositories/snapshots/org/cytoscape/distribution/cytoscape/3.0.0-M4-SNAPSHOT/

On Sat, Mar 31, 2012 at 12:06 AM, Yigang Zhou <egang...@gmail.com> wrote:
> Dear Andrea, Andra and Alexander,
>
> It's really nice to discuss with you. I've got many valuable feedbacks
> here. Now I'm clear about the details of the project. I believe I can
> make it this summer. My project proposal has just been submitted to
> NRNB in GSoC website:
> http://www.google-melange.com/gsoc/proposal/review/google/gsoc2012/egangzhou/23002
> Any suggestions and comments are welcome!
>
> Best regards,
> Yigang Zhou
>
> On Tue, Mar 27, 2012 at 1:46 AM, Andrea Splendiani
> <sergen...@gmail.com> wrote:
>> Hi,
>> I think is good to have a set of references data sets. I would add uniprot and linked life data.
>>
>> Ciao,
>> Andrea
>>
>> Sent from my iPad
>>
>> On 26 Mar 2012, at 17:55, Andra <andra.wa...@gmail.com> wrote:
>>
>>> I really like how this thread is developing.
>>>
>>> Is there a any preference among us to build the plugin around a
>>> selected set of SPARQL-endpoints and RDF datasets?
>>> I know I would propose WikiPathways, ChEMBL and Scaiview.
>>>
>>> Andra
>>>
>>>
>>> On Mar 25, 7:04 pm, Andrea Splendiani <and...@sgtp.net> wrote:
>>>> Hi,
>>>> My replies inline, and from an iPad, sorry for typos and being brief!
>>>>
>>>> On 25 Mar 2012, at 13:18, Yigang Zhou <egang.z...@gmail.com> wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> Dear Andra,
>>>>
>>>>> Thanks a lot for your inspiring ideas! Please check my reply inline.
>>>>
>>>>> On Sun, Mar 25, 2012 at 6:33 AM, Andrea Splendiani <and...@sgtp.net> wrote:
>>>>>> Hi Yigang, Alexander, Andra,
>>>>
>>>>>> I have dealt a bit both with cytoscape and RDF, also Ondex.org and RDF, so I'm very happy you are interested in this project, as I think there are a lot of cool things that can be done.
>>>>
>>>>>> A few comments on what below:
>>>>>> -) you can easily decide what to use as a label in cytoscape. The main problem in mapping attributes between RDF and cytoscape nodes is that you can have multiple values for the same attributes in RDF. Not in cytoscape (at least that I know). There is not an easy solution for that. But one can go around the problem in a few (dirty) ways.
>>>>>> One notable problematic way may be the type of a node!
>>>>
>>>>> I totally agree with you. Here's an example. Imaging that we have the
>>>>> following two RDF triples:
>>>>> subject -> predicate -> value_1
>>>>> subject -> predicate -> value_2
>>>>> The subject should be mapped to a Cytoscape node with the predicate as
>>>>> an attribute. We can not insert two values into the attribute, can we?
>>>>> Inspired by the "Alias column", can we insert both of them into the
>>>>> attribute with "|" or "," as delimiters (i.e. "value_1|value_2" as the
>>>>> attribute value)? I'm sorry that I don't understand the approach of
>>>>> "type of a node", could you please provide some more details? Thank
>>>>> you!
>>>>
>>>> As Alexander said... There are list. So we won't need hacks!
>>>>
>>>>> Another potential issue could be the visualization of "multiple
>>>>> predicates for the same two nodes". Suppose there're two RDF triples:
>>>>> subject -> predicate_1 -> object
>>>>> subject -> predicate_2 -> object
>>>>> The subject and object should be two different Cytoscape nodes. But
>>>>> there're two edges (i.e. predicate_1 and predicate_2) linking them. Is
>>>>> this data model applicable for Cytoscape network? Also not sure
>>>>> whether the two edges and their labels will overlap with each other in
>>>>> visualization view.
>>>>
>>>> Same as above: no problems here.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>> -) it would be useful to support some form of reification, as to extract values for edges in Cytoscape. Not RDF:reification. That's another thing ;) but basically you may want to consider some nodes as edges, under some conditions.
>>>>> I agree. If I understand correctly, such reification could be RDF
>>>>> Containers [1] and Collections [2]. Let me take the following four RDF
>>>>> triples of rdf:Bag [1] as an example:
>>>>> subject -> predicate -> _:z
>>>>> _:z -> rdf:type -> rdf:Bag
>>>>> _:z -> rdf:_1 -> object_1
>>>>> _:z -> rdf:_2 -> object_2
>>>>> In this case, we can make the Cytoscape network like this (that is,
>>>>> consider rdf:Bag and _:z nodes as edges):
>>>>> subject (node)  - predicate(edge) - object_1(node)
>>>>> subject (node)  - predicate(edge) - object_2(node)
>>>>> Do you mean such reification? Or could you please show me some other
>>>>> examples in Biological Ontologies?
>>>>
>>>> That's one example, but you may have some 'custom' reification. Like for example a node representing an interaction having left and white property.
>>>> These tends to be ontology specific, but what is reasonably easy to do is to have a list of conditions/patterns. So for instance, if you look at a Biomax 'interaction' X
>>>> With:
>>>> X left A
>>>> X left B
>>>> X type interaction
>>>> X attribute z
>>>>
>>>> , you propose a query in a contextual menu that transforms X in an edge between A and b, and collect attributes.
>>>> Basically you just want a parametric query linked to types. You can go a long way with this simple thing.
>>>>
>>>>
>>>>
>>>>>> -) related to that, there was a plugin for cytoscape from some company time ago (Bbn?) that was taking sparql constructs query as input of cytoscape. Something like that could be useful to transform edges rapresented as nodes in RDF to edges in cytoscape. And also to get rid of blank nodes.
>>>>> What's the plug-in? Where is the link address of this plug-in? I'm
>>>>> very interested. Can I have a look at it?
>>>>
>>>> Not sure but I'm afraid not. It was proposed at some conference and I saw some demo, they always said it was supposed to be open source, but never saw it. If you Google for Eric Neumann and Bbn you may find something.
>>>> If you are willing to wrestle with old versions/libraries and arcane setup instructions, I can also show you another plugin with a few interesting (albeit complex) ideas in it. But I think that may be premature now.
>>>>
>>>>>> -) it would be very helpful to have a contextual menu that maps to queries, perhaps a selection on the basis of the node type. This is something easy with lot of power!
>>>>> As to " the node type", do you mean rdf:type [3] in RDF or the
>>>>> NODE_TYPE attribute for Cytoscape node?
>>>> RDF:type!
>>>>
>>>>>> -) if you are familiar with Jena, it's alo very easy and useful to get in information from urls, in addition to endpoint.
>>>>> Yes, I know that Jena can load RDF data from the local RDF files, as
>>>>> well as the remote RDF uris. Specially, if the loaded data are OWL
>>>>> ontologies with owl:imports [4] information, Jena can automatically
>>>>> read the imported ontologies [5]. As long as the input of the plug-in
>>>>> is RDF data, it should be able to visualize them as a Cytoscape
>>>>> network, not matter from the local or the remote resources.
>>>>
>>>> Yes, and if you node has an uri (say, a uniprot ones), you can just model.read(uri) and pass it to the code that handle normal sparql result.
>>>>
>>>>> SPARQL has four query forms [6]. I think our plug-in should focus on
>>>>> CONSTRUCT [7] and DESCRIBE [8]. Because they return RDF graph data as
>>>>> the query results, which could the input of the plug-in. However, the
>>>>> other two forms do not, which should be out of the scopes of this GSoC
>>>>> project. More explicitly, SELECT [9] returns all, or a subset of, the
>>>>> variables bound in a query pattern match, which are table like data
>>>>> with rows and columns. ASK [10] returns a boolean indicating whether a
>>>>> query pattern matches or not. Am I in the right direction?
>>>>
>>>> Yes, you may easily support select with some restrictions, but you gain nothing. So construct is ok. Describe as well may be redundant. Importing RDF from Uris helps for a few sources without endpoints (but with RDF).
>>>>
>>>> If there is time and you want to dig into something more complex, one could explore void/spin to customise the visualisation to the dataset.
>>>> You can also play with colors... And which namespaces you want to show in cytoscape (hawkish but very useful, as you don't want to see too much meta information at times).
>>>>
>>>>>> -) not sure where sub graphs are in cytoscape, but it would be interesting to see if they can be mapped (if they exist) to named graphs.
>>>>> I think named graphs [11] can be implemented as edge attributes. An
>>>>> edge attribute carries the graph uri as the value. We can filter the
>>>>> nodes and the edges according this value for different graphs. This is
>>>>> the simplest way, inspired from AllegroGraph's fourth slot [12] for
>>>>> the named graph uri, that I worked on before.
>>>>> Not sure sub graphs are available in Cytoscape 3.x.
>>>>> Are RDF data with named graphs very popular in Biology domain?
>>>>
>>>> Not quite sure. I think if we have sub graph good, otherwise we don't need to care much about named graphs. We may be concerned about provenance, but we can either add the uri, as you say, to edges (and nodes, for clarity ;) ) or take other ways. Or even forget it!
>>>>
>>>> Good!
>>>>
>>>> Ciao,
>>>> Andrea
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>> -) if 3.0 is doable... That's an easy choice ;)
>>>>
>>>>>> I think it's going to be a best-selling plugin!
>>>>
>>>>> Best regards,
>>>>> Yigang Zhou
>>>>
>>>>> [1]http://www.w3.org/TR/rdf-primer/#containers
>>>>> [2]http://www.w3.org/TR/rdf-primer/#collections
>>>>> [3]http://www.w3.org/TR/rdf-schema/#ch_type
>>>>> [4]http://www.w3.org/TR/owl-ref/#imports-def
>>>>> [5]http://incubator.apache.org/jena/documentation/ontology/#compound_ont...
>>>>> [6]http://www.w3.org/TR/rdf-sparql-query/#QueryForms
>>>>> [7]http://www.w3.org/TR/rdf-sparql-query/#construct
>>>>> [8]http://www.w3.org/TR/rdf-sparql-query/#describe
>>>>> [9]http://www.w3.org/TR/rdf-sparql-query/#select
>>>>> [10]http://www.w3.org/TR/rdf-sparql-query/#ask
>>>>> [11]http://www.w3.org/TR/rdf-sparql-query/#rdfDataset
>>>>> [12]http://www.franz.com/agraph/support/documentation/current/agraph-intr...
>>>>
>>>>>> Ciao,
>>>>>> Andrea
>>>>
>>>>>> Sent from my iPad
>>>>
>>>>>> On 24 Mar 2012, at 21:34, Alexander Pico <ap...@gladstone.ucsf.edu> wrote:
>>>>
>>>>>>> Some response below...
>>>>
>>>>>>> On 3/22/12 8:12 AM, "Yigang Zhou" <egang.z...@gmail.com> wrote:
>>>>
>>>>>>>> Dear Andra,
>>>>
>>>>>>>> Thanks for your instruction! I can totally understand the project goal
>>>>>>>> and scopes you pointed out. Here's the description of the sub tasks
>>>>>>>> and the corresponding approaches of the project:
>>>>
>>>>>>>> 1. RDF data query through SPARQL endpoints.
>>>>>>>> We can use Apache Jena ARQ [1] to query RDF data from remote SPARQL
>>>>>>>> endpoints. Jena can also be used as the RDF processing engine for
>>>>>>>> other sub tasks. I'm quite familiar with the Jena API with much
>>>>>>>> related coding experience.
>>>>
>>>>>>>> 2. Mapping from RDF data model to Cytoscape network data model
>>>>>>>> RDF resources and their relations/properties should to be mapped to
>>>>>>>> Cytoscape nodes and edges with their attributes. There're some
>>>>>>>> different cases for the data model mapping:
>>>>>>>> (1) If the object of a RDF triple is URIref [2], the subject and
>>>>>>>> object can be Cytoscape network nodes, while the predicate is supposed
>>>>>>>> to be an edge. As to the node/edge name, it can be the full URIref,
>>>>>>>> the compact CURIE [3], or the value of rdfs:label [4] (What's your
>>>>>>>> opinion?).
>>>>
>>>>>>> We can capture all of these as node attributes and then easily switch
>>>>>>> between which is used as the label. Deciding on the default can be done much
>>>>>>> later in the project, after we have some experience viewing these networks.
>>>>
>>>>>>>> (2) If the object is a Literal [5], the predicate becomes an attribute...
>>>>
>>>> read more »
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups "cytoscape-discuss" group.
>>> To post to this group, send email to cytoscap...@googlegroups.com.
>>> To unsubscribe from this group, send email to cytoscape-disc...@googlegroups.com.
>>> For more options, visit this group at http://groups.google.com/group/cytoscape-discuss?hl=en.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups "cytoscape-discuss" group.
>> To post to this group, send email to cytoscap...@googlegroups.com.
>> To unsubscribe from this group, send email to cytoscape-disc...@googlegroups.com.
>> For more options, visit this group at http://groups.google.com/group/cytoscape-discuss?hl=en.
>>

--
You received this message because you are subscribed to the Google Groups "cytoscape-discuss" group.
To post to this group, send email to cytoscap...@googlegroups.com.
To unsubscribe from this group, send email to cytoscape-disc...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cytoscape-discuss?hl=en.


--
You received this message because you are subscribed to the Google Groups "cytoscape-discuss" group.
To post to this group, send email to cytoscap...@googlegroups.com.
To unsubscribe from this group, send email to cytoscape-disc...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cytoscape-discuss?hl=en.


--
You received this message because you are subscribed to the Google Groups "cytoscape-discuss" group.
To post to this group, send email to cytoscap...@googlegroups.com.
To unsubscribe from this group, send email to cytoscape-disc...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cytoscape-discuss?hl=en.

--
You received this message because you are subscribed to the Google Groups "cytoscape-discuss" group.
To post to this group, send email to cytoscap...@googlegroups.com.
To unsubscribe from this group, send email to cytoscape-disc...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cytoscape-discuss?hl=en.

--
You received this message because you are subscribed to the Google Groups "cytoscape-discuss" group.
To post to this group, send email to cytoscap...@googlegroups.com.
To unsubscribe from this group, send email to cytoscape-disc...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cytoscape-discuss?hl=en.

--
You received this message because you are subscribed to the Google Groups "cytoscape-discuss" group.
To post to this group, send email to cytoscap...@googlegroups.com.
To unsubscribe from this group, send email to cytoscape-disc...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cytoscape-discuss?hl=en.

Peng-Liang Wang

unread,
Jun 22, 2012, 12:25:32 PM6/22/12
to cytoscap...@googlegroups.com
I think you can put the setting in the resources directory of your
bundle. During initialization of your bundle, load the setting into
CyProperty and register the property as a service. Then your property
should appear in the Edit-->Preference->Properties. You may take a
look at the Linkout bundle
http://chianti.ucsd.edu/svn/core3/impl/trunk/linkout-impl/ .

If you do not use maven, drop the jar into the "deploy" directory is
the way to install.

Peng
Reply all
Reply to author
Forward
0 new messages