On this blog you are able to follow my degree project(master thesis in Bioinformatics) which have the title Pharmaceutical knowledge retrieval through reasoning of ChEMBL RDF.
My supervisor is Egon Willighagen, http://chem-bla-ics.blogspot.com/.

Topics

fredag 19 februari 2010

moss + manager = true

My goal this week was to have integrated moss into a Bioclipse manager.
Well I'm almost there.=0)

So this is what I have done the later part of the week. I also managed to run some SPARQL queries and got some problems to figure out there, main focus next week.

Most parts of Moss now work, although there are some settings that involves combining masks that are not quite finished yet. I actually think that I've spend most my hours on this and still not done...grr

Since Moss have over 30 different parameters I found it important to have a method that shows them. But just now I realized that this is what man moss is for. Well its the same text so no worries there.
Taken from the method though it will look something like this:
> moss.parameterDescription()
Examplea moss.createParamteters("aromatic", "always"),
moss.createParamteters("minEmbed", 6)

aromatic: ("aromatic", "never"/"upgrade"/"downgrade") |"String"
canonic: ("canonicequiv", false/true) |boolean
canonicEquiv: ("canonic", true/false) |boolean
carbonChainLength: ("carbonChainLength", true/false) |boolean
class: not for use
closed: ("closed", true/false) |boolean
exNode: ("exNode", "Atom") |"String"
exSeed: ("exSeed", "Atom") |"String"
extPrune: ("extPrune", "none"/"full"/"partial"/) |"String"
ignoreAtomTypes: ("ignoreAtomTypes", "never"/"always"/"in rings") |"String"
ignoreBond: ("ignoreBond", "never"/"always"/"in rings") |"String"
kekule: ("kekule", true/false) |boolean
limits: not for use
matchAromaticityAtoms: ("matchChargeOfAtoms", "never"/"always"/"in rings")
|"String"
matchChargeOfAtoms: ("matchAromaticityAtoms", "match"/"no match") |"String"
matom: not for use
maxEmbMemory: ("maxEmbMemory", value) |integer
maxEmbed: ("maxEmbed",value) |integer
maxRing: ("maxRing", value) |integer
maximalSupport: ("maximalSupport", value) |double
mbond: not for use
minEmbed: ("minEmbed", value) |integer
minRing: ("maxRing", value) |integer
minimalSupport: ("minimalSupport", value) |double
mode: not for use
mrgat: not for use
mrgbd: not for use
ringExtension: ("ringExtension", "none"/"full"/"merge"/"filter") |"String"
seed: ("seed", "Atom") |"String"
split: ("split", true/false) |boolean
threshold: ("threshold", value) |double
unembedSibling: ("unembedSibling", false/true) |boolean


Will immediately start working on the manager.

I figure that it would be nice to have one method that sets the parameters, in this case createParameters(). The first input specifies what you want to set and the second argument provides the value. The arguments is handled by the following method,
public String createParameters(String propertyName, Object value) throws Exception{

if(value.getClass().equals(Double.class)){
value= ((Double) value).intValue();
int values = (Integer) value;
mossbean.setParameters(mossbean, propertyName, values);
}else{
mossbean.setParameters(mossbean, propertyName, value);
}
return value +" is set to " +propertyName;
}

When trying out moss myself I got irritated that I forgot the values of my parameters hence the method parameterValues() was created. It returns the current values of all parameters:
> moss.parameterValues()
aromatic:
canonic: true
canonicEquiv: false
carbonChainLength:
class: class net.bioclipse.moss.business.backbone.MossBean
closed: true
exNode: H
exSeed:
extPrune:
ignoreAtomTypes:
ignoreBond:
kekule:
limits: 0.0
matchAromaticityAtoms:
matchChargeOfAtoms:
maxEmbMemory: 0
maxEmbed: 0
maxRing: 0
maximalSupport: 0.02
minEmbed: 0
minRing: 0
minimalSupport: 0.1
ringExtension: none
seed:
split: false
threshold: 0.5
unembedSibling: false


I will also create a method that restores the values to default since it is valuable to the end-user.
I can't figure out though how to return an arraylist in a smooth way. I returned it as a String, this is how I've done it
public String parameterValues() throws Exception{
ArrayList name = mossbean.getPropertyNames(mossbean);
String info="";
String names;
for(int i=0; i names = name.get(i);
info= info + names +": " + mossbean.getProperty(mossbean, names) + " \n";
}
return info;


If you know something better, please tell!

Mostly polishing left when it comes to Moss but (perhaps) bigger mask combination parts to, it depends on the outcome of my Moss tests(which I will do when it's not Friday afternoon and I have a sharp mind).

Next week main focus is to develop SPARQL queries again!

6 kommentarer:

  1. Does createParameters() return a MoSSBean? From moss.parameterValues() it seems that while you seem to be using a bean now, you still have it as global field in the manager, or? That should not be the case, and we might have two parallel MoSS runs, which will use the same manager instance, as created with Activator.getJSManager()...

    SvaraRadera
  2. At least I managed to return List (or in fact List> )

    (... the signature looking like this):

    public List> queryProlog( String[] args ) {
    ...
    }

    SvaraRadera
  3. Oops, blogspot obviously doesn't like <> - characters :-o ... so, I was saying that I managed to return List<String> (or in fact even a multidimensional one: List<List<String>> in this case):

    public List<List<String>> queryProlog( String[] args ) {
    ...
    }

    SvaraRadera
  4. createParameters(arg1,arg2) adds values to a specified mossbean variable.

    Since mossmodel adds its parameters like following mossmodel.setFoo(10) it now collects its values by mossmodel.setFoo(mossbean.getFoo()). It gets a bit complicated since moss is not suited for this kind of use. And I don't know how much my project involves changing moss...
    And how can I make it work without having it global?

    You wrote:"That should not be the case, and we might have two parallel MoSS runs"

    Could you please elaborate this, I never worked with this kind of flow before.

    SvaraRadera
  5. Samuel, I will definitely look into returning lists instead...

    SvaraRadera
  6. Yea I came here to ask the question: "What's wrong with just returning a list?"

    SvaraRadera