From Carol.Lushbough at usd.edu Fri May 5 09:21:58 2006 From: Carol.Lushbough at usd.edu (Carol Lushbough) Date: Fri, 05 May 2006 08:21:58 -0500 Subject: [MOBY-l] Moby Client Example Message-ID: <445B5176.2060204@usd.edu> All, I was wondering if someone could send me an example demonstrating how a java client app retrieves output after invoking a BioMoby service. I'm trying to test a service that returns a collection of BasicGFFSequenceFeature. The following code segments are my attempts at retrieving the collection: // First try mr.invokeService(); MobyContentInstance output = mr.getOutput(); BasicGFFSequenceFeature[] values = (BasicGFFSequenceFeature[]) output.get("locations"); // second try MobyContentInstance responses = mr.invokeService(); Iterator i = responses.keySet().iterator(); while(i.hasNext()){ HashMap responseObjects = (HashMap) responses.get(i.next()); Iterator it = responseObjects.keySet().iterator(); while(it.hasNext()){ Object responseObject = it.next(); // The response objects may either be simple data, or data sets if(responseObject instanceof MobyDataObject){ System.out.println("Plain simple instance is "+((MobyDataInstance)responseObject).toXML()); } else if(responseObject instanceof MobyDataObjectSet){ System.out.println("Found a collection:"); MobyDataObject[] simples = ((MobyDataObjectSet) responseObject).getElementInstances(); for(int j = 0; j < simples.length; j++){ System.out.println(" Member instance is \n"+simples[j].toXML()); } } else{ System.out.println("Found funky data!" + responseObject.toString()); } } } Thank you for you help! Carol -- Carol Lushbough Assistant Professor of Computer Science University of South Dakota Vermillion, SD 57069 (605) 677-6138 From edward.kawas at gmail.com Fri May 5 12:36:02 2006 From: edward.kawas at gmail.com (Edward Kawas) Date: Fri, 5 May 2006 09:36:02 -0700 Subject: [MOBY-l] Moby Client Example In-Reply-To: <445B5176.2060204@usd.edu> Message-ID: <000701c67061$ff92d7b0$6700a8c0@notebook> Hi Carol, I augmented one of our example clients available in moby-live/Java/src/Clients/ The following should be of some use: /** * This is the simplest Java MOBY client you can have. A fully documented version * is available in the TestRequest class, with all the proper error checking. */ import org.biomoby.client.*; import org.biomoby.shared.*; import org.biomoby.shared.data.*; public class HelloMOBY { public static void main(String[] args) throws Exception{ Central worker = new CentralImpl(); // replace with service name of your choice MobyService templateService = new MobyService("MOBYSHoundGetGenBankff"); MobyService[] validServices = worker.findService(templateService); MobyRequest mr = new MobyRequest(worker); mr.setService(validServices[0]); mr.setInput(new MobyDataObject("NCBI_gi", "111076")); MobyContentInstance mobyContent = mr.invokeService(); String response = mobyContent.toString(); System.out.println("Response from service is:\n" + response); java.util.Iterator it = mobyContent.keySet().iterator(); while (it.hasNext()) { Object o = mobyContent.get(it.next()); System.out.println("result from calling get(key):\n" + o); System.out.println("classname: " + o.getClass()); java.util.HashMap map = (java.util.HashMap)o; java.util.Iterator mobyContentIterator = map.keySet().iterator(); while (mobyContentIterator.hasNext()) { String key = (String)mobyContentIterator.next(); System.out.println("key: " + key); // should be the articlename, in this case is empty, but it shouldnt be in theory Object composite = map.get(key); System.out.println("value:\n" + composite); System.out.println("class: " + map.get(key).getClass()); // map contains MobyDataComposite objects. // now get the members: java.util.Iterator compositeIterator = ((MobyDataComposite)composite).keySet().iterator(); while (compositeIterator.hasNext()) { String compositeKey = (String)compositeIterator.next(); System.out.println("key: " + compositeKey); // should be the articlename, in this case is empty, but it shouldnt be System.out.println("value:\n" + ((MobyDataComposite)composite).get(compositeKey)); System.out.println("class: " + ((MobyDataComposite)composite).get(compositeKey).getClass()); } } } } } Eddie > -----Original Message----- > From: moby-l-bounces at lists.open-bio.org > [mailto:moby-l-bounces at lists.open-bio.org] On Behalf Of Carol > Lushbough > Sent: Friday, May 05, 2006 6:22 AM > To: moby-l at biomoby.org > Subject: [MOBY-l] Moby Client Example > > All, > > I was wondering if someone could send me an example > demonstrating how a java client app retrieves output after > invoking a BioMoby service. I'm trying to test a service > that returns a collection of BasicGFFSequenceFeature. The > following code segments are my attempts at retrieving the collection: > > // First try > mr.invokeService(); > MobyContentInstance output = mr.getOutput(); > BasicGFFSequenceFeature[] values = > (BasicGFFSequenceFeature[]) output.get("locations"); > > // second try > MobyContentInstance responses = mr.invokeService(); > > Iterator i = responses.keySet().iterator(); > while(i.hasNext()){ > HashMap responseObjects = (HashMap) > responses.get(i.next()); > Iterator it = responseObjects.keySet().iterator(); > while(it.hasNext()){ > Object responseObject = it.next(); > // The response objects may either be > simple data, or data sets > if(responseObject instanceof MobyDataObject){ > System.out.println("Plain simple instance is > "+((MobyDataInstance)responseObject).toXML()); > } > else if(responseObject instanceof MobyDataObjectSet){ > System.out.println("Found a collection:"); > MobyDataObject[] simples = ((MobyDataObjectSet) > responseObject).getElementInstances(); > for(int j = 0; j < simples.length; j++){ > System.out.println(" Member instance is > \n"+simples[j].toXML()); > } > } > else{ > System.out.println("Found funky data!" + > responseObject.toString()); > } > } > } > > Thank you for you help! > > Carol > > -- > Carol Lushbough > Assistant Professor of Computer Science > University of South Dakota > Vermillion, SD 57069 > (605) 677-6138 > > _______________________________________________ > moby-l mailing list > moby-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/moby-l From senger at ebi.ac.uk Fri May 5 17:23:47 2006 From: senger at ebi.ac.uk (Martin Senger) Date: Fri, 5 May 2006 22:23:47 +0100 (BST) Subject: [MOBY-l] Moby Client Example In-Reply-To: <445B5176.2060204@usd.edu> Message-ID: Hi, You can write moby client in two ways. The general one - when you do not need generated Java objects - was demonstrated by Eddie in his reply. This is the second way: In order to use it, you need to generate moby data types (more about it in Moses: http://biomoby.open-bio.org/CVS_CONTENT/moby-live/Java/docs/Moses.html). Or ask me for details. Once you have them, you can process a response with a method like this (this is a real example that I have just put together - the whole code for this command-line client is attached, and it is also part of jMoby samples): public boolean useResponse (MobyJob response, MobyPackage responseContext) throws MobyException { MobyObject[] gff = response.getDataSet ("gff"); for (int i = 0; i < gff.length; i++) { BasicGFFSequenceFeature feature = (BasicGFFSequenceFeature)gff[i]; System.out.println ("\n" + feature.getId() + "\t" +feature.getNamespace()); System.out.println ("Frame: " + feature.get_frame()); System.out.println ("Source: " + feature.get_source()); System.out.println ("Method: " + feature.get_method()); System.out.println ("Reference: " + feature.get_reference()); System.out.println ("Strand: " + feature.get_strand()); System.out.println ("Score: " + feature.getMoby_score().getValue()); System.out.println ("Start: " + feature.getMoby_start().getValue()); System.out.println ("Stop: " + feature.getMoby_stop().getValue()); multi_key_value_pair[] pairs = feature.getMoby_column9_tag_value(); for (int j = 0; j < pairs.length; j++) { System.out.print (pairs[j].get_key()); String[] values = pairs[j].get_the_value(); for (int k = 0; k < values.length; k++) System.out.print ("\t" + values[k]); System.out.println(); } } return true; } The attached sample code calles service "getInsertionsAsGFFByAGICode". For an AGI_LocusCode "At1g44446", the method above prints something like this: T-DNA_LB.T-DNA.SAIL_326_H02.v1 ATH_Insert_number Frame: '.' Source: 'AtiDB' Method: 'variation' Reference: 1 Strand: '.' Score: 5 Start: 16853268 Stop: 16853269 'Insertion' T-DNA_LB.T-DNA.SAIL_326_H02.v1 T-DNA_LB.T-DNA.SAIL_1238_D01.v1 ATH_Insert_number Frame: '.' Source: 'AtiDB' Method: 'variation' Reference: 1 Strand: '.' Score: 5 Start: 16852562 Stop: 16852563 'Insertion' T-DNA_LB.T-DNA.SAIL_1238_D01.v1 ... and more With regards, Martin -- Martin Senger email: martin.senger at gmail.com skype: martinsenger -------------- next part -------------- // TestExtractGFF.java // // Created: May 2006 // // This file is a component of the BioMoby project. // Copyright Martin Senger (martin.senger at gmail.com). // package org.jmoby.tutorial.client; import org.biomoby.client.BaseClient; import org.biomoby.shared.MobyException; import org.biomoby.shared.MobyService; import org.biomoby.shared.parser.MobyPackage; import org.biomoby.shared.parser.MobyJob; import org.biomoby.shared.datatypes.MobyObject; import org.biomoby.client.MobyServiceLocator; import org.biomoby.shared.datatypes.*; /** * This is an example of a client. It calls a Biomoby service * "getInsertionsAsGFFByAGICode" it uses generated data types and it * benefits from various features provided by the BaseClient * class.

* * @author Martin Senger * @version $Id: TestExtractGFF.java,v 1.1 2006/05/05 21:11:46 senger Exp $ */ public class TestExtractGFF extends BaseClient { // from the command-line String serviceEndpoint; MobyObject input; /************************************************************************** * Constructor. It expects arguments: AGI_Locus_code [service-endpoint]. *************************************************************************/ public TestExtractGFF (String[] args) { input = new MobyObject(); String agiLocusCode = "At1g44446"; if (args.length > 0) agiLocusCode = args[0]; input.setId (agiLocusCode); input.setNamespace ("AGI_LocusCode"); if (args.length > 1) serviceEndpoint = args[1]; } /************************************************************************** * *************************************************************************/ public MobyServiceLocator getServiceLocator() throws MobyException { MobyService service = new MobyService ("getInsertionsAsGFFByAGICode"); if (serviceEndpoint != null) service.setURL (serviceEndpoint); return new MobyServiceLocator (service); } /************************************************************************** * *************************************************************************/ public boolean fillRequest (MobyJob request, MobyPackage inputContext) throws MobyException { request.setData (input); return true; } /************************************************************************** * *************************************************************************/ public boolean useResponse (MobyJob response, MobyPackage responseContext) throws MobyException { MobyObject[] gff = response.getDataSet ("gff"); for (int i = 0; i < gff.length; i++) { BasicGFFSequenceFeature feature = (BasicGFFSequenceFeature)gff[i]; System.out.println ("\n" + feature.getId() + "\t" + feature.getNamespace()); System.out.println ("Frame: " + feature.get_frame()); System.out.println ("Source: " + feature.get_source()); System.out.println ("Method: " + feature.get_method()); System.out.println ("Reference: " + feature.get_reference()); System.out.println ("Strand: " + feature.get_strand()); System.out.println ("Score: " + feature.getMoby_score().getValue()); System.out.println ("Start: " + feature.getMoby_start().getValue()); System.out.println ("Stop: " + feature.getMoby_stop().getValue()); multi_key_value_pair[] pairs = feature.getMoby_column9_tag_value(); for (int j = 0; j < pairs.length; j++) { System.out.print (pairs[j].get_key()); String[] values = pairs[j].get_the_value(); for (int k = 0; k < values.length; k++) System.out.print ("\t" + values[k]); System.out.println(); } } return true; } /************************************************************************** * *************************************************************************/ public static void main (String [] args) { if (args.length > 2) { System.err.println ("Usage: java TestExtractGFF [ []]\n"); System.exit (1); } TestExtractGFF client = new TestExtractGFF (args); try { client.process(); } catch (MobyException e) { System.err.println (e.getMessage()); System.exit (1); } } } From gordonp at ucalgary.ca Mon May 8 10:23:49 2006 From: gordonp at ucalgary.ca (Paul Gordon) Date: Mon, 08 May 2006 08:23:49 -0600 Subject: [MOBY-l] Moby Client Example In-Reply-To: References: Message-ID: <445F5475.9010003@ucalgary.ca> By the way, I have created several new help documents for my classes, but haven't committed them since they rely on the (uncommited) Java 1.5-requiring changes I've made in jMOBY. Did we get a final word on if it's okay to switch now? Cheers, Paul > Hi, > You can write moby client in two ways. The general one - when you do > not need generated Java objects - was demonstrated by Eddie in his reply. > This is the second way: > > In order to use it, you need to generate moby data types (more about it > in > Moses: http://biomoby.open-bio.org/CVS_CONTENT/moby-live/Java/docs/Moses.html). Or > ask me for details. > > Once you have them, you can process a response with a method like this > (this is a real example that I have just put together - the whole code for > this command-line client is attached, and it is also part of jMoby > samples): > > public boolean useResponse (MobyJob response, > MobyPackage responseContext) > throws MobyException { > > MobyObject[] gff = response.getDataSet ("gff"); > for (int i = 0; i < gff.length; i++) { > BasicGFFSequenceFeature feature = (BasicGFFSequenceFeature)gff[i]; > System.out.println ("\n" + feature.getId() + "\t" +feature.getNamespace()); > System.out.println ("Frame: " + feature.get_frame()); > System.out.println ("Source: " + feature.get_source()); > System.out.println ("Method: " + feature.get_method()); > System.out.println ("Reference: " + feature.get_reference()); > System.out.println ("Strand: " + feature.get_strand()); > System.out.println ("Score: " + feature.getMoby_score().getValue()); > System.out.println ("Start: " + feature.getMoby_start().getValue()); > System.out.println ("Stop: " + feature.getMoby_stop().getValue()); > multi_key_value_pair[] pairs = feature.getMoby_column9_tag_value(); > for (int j = 0; j < pairs.length; j++) { > System.out.print (pairs[j].get_key()); > String[] values = pairs[j].get_the_value(); > for (int k = 0; k < values.length; k++) > System.out.print ("\t" + values[k]); > System.out.println(); > } > } > return true; > } > > The attached sample code calles service > "getInsertionsAsGFFByAGICode". For an AGI_LocusCode "At1g44446", the > method above prints something like this: > > T-DNA_LB.T-DNA.SAIL_326_H02.v1 ATH_Insert_number > Frame: '.' > Source: 'AtiDB' > Method: 'variation' > Reference: 1 > Strand: '.' > Score: 5 > Start: 16853268 > Stop: 16853269 > 'Insertion' T-DNA_LB.T-DNA.SAIL_326_H02.v1 > > T-DNA_LB.T-DNA.SAIL_1238_D01.v1 ATH_Insert_number > Frame: '.' > Source: 'AtiDB' > Method: 'variation' > Reference: 1 > Strand: '.' > Score: 5 > Start: 16852562 > Stop: 16852563 > 'Insertion' T-DNA_LB.T-DNA.SAIL_1238_D01.v1 > > ... and more > > With regards, > Martin > > > ------------------------------------------------------------------------ > > // TestExtractGFF.java > // > // Created: May 2006 > // > // This file is a component of the BioMoby project. > // Copyright Martin Senger (martin.senger at gmail.com). > // > > package org.jmoby.tutorial.client; > > import org.biomoby.client.BaseClient; > import org.biomoby.shared.MobyException; > import org.biomoby.shared.MobyService; > import org.biomoby.shared.parser.MobyPackage; > import org.biomoby.shared.parser.MobyJob; > import org.biomoby.shared.datatypes.MobyObject; > import org.biomoby.client.MobyServiceLocator; > import org.biomoby.shared.datatypes.*; > > /** > * This is an example of a client. It calls a Biomoby service > * "getInsertionsAsGFFByAGICode" it uses generated data types and it > * benefits from various features provided by the BaseClient > * class.

> * > * @author Martin Senger > * @version $Id: TestExtractGFF.java,v 1.1 2006/05/05 21:11:46 senger Exp $ > */ > > public class TestExtractGFF > extends BaseClient { > > // from the command-line > String serviceEndpoint; > MobyObject input; > > /************************************************************************** > * Constructor. It expects arguments: AGI_Locus_code [service-endpoint]. > *************************************************************************/ > public TestExtractGFF (String[] args) { > input = new MobyObject(); > String agiLocusCode = "At1g44446"; > if (args.length > 0) > agiLocusCode = args[0]; > input.setId (agiLocusCode); > input.setNamespace ("AGI_LocusCode"); > > if (args.length > 1) > serviceEndpoint = args[1]; > } > > /************************************************************************** > * > *************************************************************************/ > public MobyServiceLocator getServiceLocator() > throws MobyException { > MobyService service = new MobyService ("getInsertionsAsGFFByAGICode"); > if (serviceEndpoint != null) > service.setURL (serviceEndpoint); > return new MobyServiceLocator (service); > } > > /************************************************************************** > * > *************************************************************************/ > public boolean fillRequest (MobyJob request, MobyPackage inputContext) > throws MobyException { > request.setData (input); > return true; > } > > /************************************************************************** > * > *************************************************************************/ > public boolean useResponse (MobyJob response, > MobyPackage responseContext) > throws MobyException { > > MobyObject[] gff = response.getDataSet ("gff"); > for (int i = 0; i < gff.length; i++) { > BasicGFFSequenceFeature feature = (BasicGFFSequenceFeature)gff[i]; > System.out.println ("\n" + feature.getId() + "\t" + feature.getNamespace()); > System.out.println ("Frame: " + feature.get_frame()); > System.out.println ("Source: " + feature.get_source()); > System.out.println ("Method: " + feature.get_method()); > System.out.println ("Reference: " + feature.get_reference()); > System.out.println ("Strand: " + feature.get_strand()); > System.out.println ("Score: " + feature.getMoby_score().getValue()); > System.out.println ("Start: " + feature.getMoby_start().getValue()); > System.out.println ("Stop: " + feature.getMoby_stop().getValue()); > multi_key_value_pair[] pairs = feature.getMoby_column9_tag_value(); > for (int j = 0; j < pairs.length; j++) { > System.out.print (pairs[j].get_key()); > String[] values = pairs[j].get_the_value(); > for (int k = 0; k < values.length; k++) > System.out.print ("\t" + values[k]); > System.out.println(); > } > } > return true; > } > > /************************************************************************** > * > *************************************************************************/ > public static void main (String [] args) { > if (args.length > 2) { > System.err.println ("Usage: java TestExtractGFF [ []]\n"); > System.exit (1); > } > TestExtractGFF client = new TestExtractGFF (args); > try { > client.process(); > } catch (MobyException e) { > System.err.println (e.getMessage()); > System.exit (1); > } > } > > } > > ------------------------------------------------------------------------ > > _______________________________________________ > moby-l mailing list > moby-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/moby-l > From usadel at mpimp-golm.mpg.de Tue May 9 10:45:18 2006 From: usadel at mpimp-golm.mpg.de (=?ISO-8859-1?Q?Bj=F6rn_Usadel?=) Date: Tue, 09 May 2006 16:45:18 +0200 Subject: [MOBY-l] Can't post to the list anymore Message-ID: <4460AAFE.9080200@mpimp-golm.mpg.de> Dear List, I always seem to get Your mail to 'moby-l' with the subject foo Is being held until the list moderator can review it for approval. The reason it is being held: Message has a suspicious header Is there a particular reason for it or anything I can do (if this message gets through that is...) Cheers, Bj?rn From dag at sonsorol.org Tue May 9 11:00:18 2006 From: dag at sonsorol.org (Chris Dagdigian) Date: Tue, 9 May 2006 11:00:18 -0400 Subject: [MOBY-l] Can't post to the list anymore In-Reply-To: <4460AAFE.9080200@mpimp-golm.mpg.de> References: <4460AAFE.9080200@mpimp-golm.mpg.de> Message-ID: <06CA0EA8-0D4F-480C-8E1A-9A842556A53C@sonsorol.org> The "suspicious header" could mean that flags were raised by our anti- spam and MIMEDefang tests that happen before mail gets to the mailing list. Another common cause happens at the mailing list software level -- we generally block any message that is not plaintext as spam messages are the ones that usually are HTML encoded or done up in some other funky MIME encoding method. Generally, odd MIME encodings and any HTML email will trip this alert and cause the "must be moderated" flag to turn on. When this happens again, the best thing to do is forward the message you got (with all headers) to me or mailteam at open-bio.org. It also helps to forward us the message you were trying to send so that we can figure out what exactly is tripping the moderate flag. Regards, Chris On May 9, 2006, at 10:45 AM, Bj?rn Usadel wrote: > Dear List, > > I always seem to get > > Your mail to 'moby-l' with the subject > foo > > Is being held until the list moderator can review it for approval. > > The reason it is being held: > > Message has a suspicious header > > > Is there a particular reason for it or anything I can do (if this > message gets through that is...) > > Cheers, > Bj?rn From Marc.Logghe at DEVGEN.com Tue May 9 10:53:47 2006 From: Marc.Logghe at DEVGEN.com (Marc Logghe) Date: Tue, 9 May 2006 16:53:47 +0200 Subject: [MOBY-l] Can't post to the list anymore Message-ID: <0C528E3670D8CE4B8E013F6749231AA6746D8A@ANTARESIA.be.devgen.com> > Is being held until the list moderator can review it for approval. > > The reason it is being held: > > Message has a suspicious header > > > Is there a particular reason for it or anything I can do (if > this message gets through that is...) I experienced the same with posts that contained attachments. All messages without attachment seem te pass. Regards, Marc From usadel at mpimp-golm.mpg.de Tue May 9 11:19:23 2006 From: usadel at mpimp-golm.mpg.de (=?ISO-8859-1?Q?Bj=F6rn_Usadel?=) Date: Tue, 09 May 2006 17:19:23 +0200 Subject: [MOBY-l] Potential fix for RFC1863 Commonsubs/was: missing RFC1863 support in perl CommonSubs Message-ID: <4460B2FB.8040904@mpimp-golm.mpg.de> Dear List, sorry it took me a bit longer to implement the change in responseHeader. I basically changed the code in responseHeader by adding the following lines: (some formatting included) ##################### ... if ($exception) { $xml .= " \n$exception"; if ( $notes ) { my $encodednotes = HTML::Entities::encode( $notes ); $xml .= " $encodednotes\n"; } $xml .=" "; } elsif... ########################## and adding an additional sub "encodeException", which xmlencodes an exception. I just figured out, that this is also available via Java/src/perl/parser/service exception.pm. Is this supposed to be used in general? In which case one better uses this approach, since it is far more OO structured than mine. (and I will make a new diff) Maybe somebody more insightful than me can comment on this and have a look/test my code. It generates well-formed xml and seems to be backward compatible, but that is as much as I can test it. If encodeException is to be kept, is there any recommendation what the default behavior for missing errorcode severity etc. should be, currently it returns ""? I included a diff against the Common Subs 1.9 (i hope to have brought mine to the same level by hand from 1.87) In case these changes are ok, I think I would add an additional example in the perldoc using errors. Cheers, Bj?rn PS Thanks to Marc for how to post :-) > Bj?rn, > > To my knowledge, nobody has yet checked in any work on integrating the > new Exception mechanism into the Perl codebase. It appears that the > Java codebase already has this feature, so we need it in the Perl > version too, urgently. You should feel free to go ahead - anyone out > there working on this? perhaps you should get together on it. > > -Frank > > At 04:50 AM 3/24/2006, you wrote: >> Dear list, >> >> I just learned how to use Biomoby and stumbled over the problem that it >> is not possible to integrate >> moby Exceptions (as specified in RFC1863) into the header using the perl >> method "responseHeader" from CommonSubs (latest cvs). Since everything >> there which is passed in the parameter notes gets HTMLified and wrapped >> into notes as well as service notes. >> >> Is anybody working on fixing that? >> Otherwise I could try developing a version here with the additional >> paramter exception (and post it on this list?) >> >> >> Cheers, >> Bj?rn >> >> >> _______________________________________________ >> moby-l mailing list >> moby-l at lists.open-bio.org >> http://lists.open-bio.org/mailman/listinfo/moby-l > > PhD, Computational Biologist, > Harvard Medical School BCMP/SGM-322, 250 Longwood Ave, Boston MA > 02115, USA. > Tel: 617-432-3555 Fax: 617-432-3557 > http://llama.med.harvard.edu/~fgibbons ##############################diff 1c1 < #$Id: CommonSubs.pm,v 1.90 2006/05/04 20:30:47 mwilkinson Exp $ --- > #$Id: CommonSubs.pm,v 1.87 2006/04/28 13:10:38 mwilkinson Exp $ 230a231 > encodeException 622c623 < B print the XML string of a MOBY response header +/- serviceNotes --- > B print the XML string of a MOBY response header +/- serviceNotes +/- Exceptions 630c631,633 < -note => 'here is some data from the service provider') --- > -note => 'here is some data from the service provider' > -exception=>'an xml encoded exception string') > 634c637 < notes. --- > notes which can include already xml encoded exceptions 648c651 < my ( $auth, $notes ) = _rearrange( [qw[AUTHORITY NOTE]], @_ ); --- > my ( $auth, $notes, $exception ) = _rearrange( [qw[AUTHORITY NOTE EXCEPTION]], @_ ); 650a654 > $exception ||=""; 652,655c656,668 < "" < . "" < . ""; < if ( $notes ) { --- > "\n" > . " \n" > . " \n"; > if ($exception) { > $xml .= " \n$exception"; > if ( $notes ) { > my $encodednotes = HTML::Entities::encode( $notes ); > $xml .= " $encodednotes\n"; > } > $xml .=" "; > } > > elsif ( $notes ) { 661a675,716 > > =head2 encodeException > > B wraps a Biomoby Exception with all its parameters into the appropiate MobyData structure > > B > > encodeException( > -element => 'refers to the queryID of the offending input mobyData', > -query => 'refers to the articleName of the offending input Simple or Collection' > -severity=>'error' > -code=>'An error code ' > -message=>'a human readable description for the error code') > > Bthe different arguments required by the mobyException API > severity can be either error, warning or information > valid error codes are decribed on the biomoby website > > > B returns everything required to use for the responseHeader: > > > 600 > Unable to execute the service > > > =cut > > sub encodeException{ > use HTML::Entities (); > my ( $refElement, $refQueryID, $severity, $code, $message ) = _rearrange( [qw[ELEMENT QUERYID SEVERITY CODE MESSAGE]], @_ ); > $refElement ||= ""; > defined($refQueryID) || ($refQueryID= ""); > $severity ||= ""; > defined($code) || ($code = ""); > $message ||= "not provided"; > my $xml=" \n". > " $code\n". > " ".HTML::Entities::encode($message)."\n". > " \n"; > } > From senger at ebi.ac.uk Tue May 9 11:31:05 2006 From: senger at ebi.ac.uk (Martin Senger) Date: Tue, 9 May 2006 16:31:05 +0100 (BST) Subject: [MOBY-l] Potential fix for RFC1863 Commonsubs/was: missing RFC1863 support in perl CommonSubs In-Reply-To: <4460B2FB.8040904@mpimp-golm.mpg.de> Message-ID: > I just figured out, that this is also available via > Java/src/perl/parser/service exception.pm. Is this supposed to be used > in general? > This is a "work-in-progress" heading to do the same as Moses does for Java (generated Perl classes and service skeletons). If it will be used generally, I do not know. As usual, "there-is-more-ways" in Perl. Martin -- Martin Senger email: martin.senger at gmail.com skype: martinsenger From markw at illuminae.com Tue May 9 11:17:00 2006 From: markw at illuminae.com (Mark Wilkinson) Date: Tue, 09 May 2006 08:17:00 -0700 Subject: [MOBY-l] [moby] Can't post to the list anymore In-Reply-To: <4460AAFE.9080200@mpimp-golm.mpg.de> References: <4460AAFE.9080200@mpimp-golm.mpg.de> Message-ID: <1147187820.16114.22.camel@bioinfo.icapture.ubc.ca> The best thing to do is just be patient. I can't be online 24 hours a day :-) As soon as I see a message is being held-back, I login and release it. The SPAM filter is a blessing to us, so those few times where it catches a real post is worth the few hours (at most) of delay until I get to it. Mark On Tue, 2006-05-09 at 16:45 +0200, Bj?rn Usadel wrote: > Dear List, > > I always seem to get > > Your mail to 'moby-l' with the subject > foo > > Is being held until the list moderator can review it for approval. > > The reason it is being held: > > Message has a suspicious header > > > Is there a particular reason for it or anything I can do (if this message gets through that is...) > > Cheers, > Bj?rn > > > _______________________________________________ > moby-l mailing list > moby-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/moby-l -- -- Mark Wilkinson Asst. Professor, Dept. of Medical Genetics University of British Columbia PI in Bioinformatics, iCAPTURE Centre St. Paul's Hospital, Rm. 166, 1081 Burrard St. Vancouver, BC, V6Z 1Y6 tel: 604 682 2344 x62129 fax: 604 806 9274 "For most of this century we have viewed communications as a conduit, a pipe between physical locations on the planet. What's happened now is that the conduit has become so big and interesting that communication has become more than a conduit, it has become a destination in its own right..." Paul Saffo - Director, Institute for the Future From usadel at mpimp-golm.mpg.de Fri May 12 08:21:32 2006 From: usadel at mpimp-golm.mpg.de (=?ISO-8859-1?Q?Bj=F6rn_Usadel?=) Date: Fri, 12 May 2006 14:21:32 +0200 Subject: [MOBY-l] RFC1863 error handling Perl implementation updates Message-ID: <44647DCC.7020001@mpimp-golm.mpg.de> Hi all, I just updated and improved the RFC1863 error handling in Perl a bit more. I added a function for deparsing the serviceNotes on the receiving side and implemented some minor checks in Commonsubs.t . For testing: I included the error handling into the following service on MOBY test central (it is a real service though) (authority: mapman.mpimp-golm.mpg.de servicename: getPMCIDsByAGI input Object ns: AGI_LocusCode output Object ns:PMCID http://bioinfo.icapture.ubc.ca/cgi-bin/mobycentral/MOBY-Central.pl http://bioinfo.icapture.ubc.ca/MOBY/Central) Should I send the latest diffs to the list or should I apply for a cvs write access? Sorry for all these questions... Cheers, Bj?rn From darin.london at duke.edu Mon May 22 11:29:45 2006 From: darin.london at duke.edu (Darin London) Date: Mon, 22 May 2006 11:29:45 -0400 Subject: [MOBY-l] BOSC 2006 2nd Call for Papers In-Reply-To: <4471CE49.80109@duke.edu> References: <44294B65.4050207@duke.edu> <4471CE49.80109@duke.edu> Message-ID: <4471D8E9.8090109@duke.edu> 2nd CALL FOR SPEAKERS This is the second and last official call for speakers to submit their abstracts to speak at BOSC 2006 in Fortaleza, Brasil. In order to be considered as a potential speaker, an abstract must be recieved by Monday, June 5th, 2006. We look forward to a great conference this year. Please consult The Official BOSC 2006 Website at: http://www.open-bio.org/wiki/BOSC_2006 for more details and information. In addition, a BOSC weblog has been setup to make it easier to desiminate all BOSC related announcements: http://wiki.open-bio.org/boscblog/ And if you have an ICAL compatible Calendar, there is an EventDB calendar set up with all BOSC related deadlines. http://eventful.com/groups/G0-001-000014747-0 More information about ISMB can be found at the Official ISMB 2006 Website: http://ismb2006.cbi.cnptia.embrapa.br/ Thank You, and we look forward to seeing you all, The BOSC Organizing Committee. From tmo at ebi.ac.uk Thu May 25 07:35:25 2006 From: tmo at ebi.ac.uk (Tom Oinn) Date: Thu, 25 May 2006 12:35:25 +0100 Subject: [MOBY-l] Taverna and plant sciences, any examples? Message-ID: <4475967D.90805@ebi.ac.uk> Hi guys, I'm posting this to the moby list as I've noticed a preponderance of plant science services and tools (at least in the early days of the project). I'm giving a talk at Rothamsted Research on Taverna in september and would like to show some examples of higher level bioinformatics (organism, ecology etc), so I thought I'd ask if anyone had such a thing? Cheers, Tom From Usadel at mpimp-golm.mpg.de Thu May 25 13:02:07 2006 From: Usadel at mpimp-golm.mpg.de (Bjoern Usadel) Date: Thu, 25 May 2006 19:02:07 +0200 Subject: [MOBY-l] Can s/o correct the Perl examples online Message-ID: <8233DF2244998040848283889E22DBA0040F0D@MAIL.mpimp-golm.mpg.de> Dear List, can someone please correct the Document: http://biomoby.open-bio.org/CVS_CONTENT/moby-live/Docs/MOBY-S_API/Perl/ConstructingYourService.html in the section sub _generic_service_name in the block ####### return SOAP::Data->type('base64' => responseHeader("illuminae.com") . responseFooter()) unless (keys %$inputs); # if you are only able to understand data in a particular namespace, then you # are required to validate that namespace before continuing. To validate it (or several) # pass them to the validateNamespaces subroutine, and it will return to you a list of # the assicoated namespace LSID's # my @validNS = validateNamespaces("NCBI_Acc"); # ONLY do this if you are intending to be namespace aware! # $queryID is the enumerated identification of this query. # This is client-side defined, so do not validate this! $this_invocation = $inputs->{$queryID}; # this is the block with this queryID ######## somewhere queryID should be defined probably the line "foreach my $queryID(keys %$inputs){" got lost? Moreover in the section "A service that echoes" in the line "if (my $input = $this_invocation->{GO_id}){" it might be nice to replace "GO_id" by something more generic. Cheers, Bj?rn From d.haase at gsf.de Tue May 30 11:13:24 2006 From: d.haase at gsf.de (Dirk Haase) Date: Tue, 30 May 2006 17:13:24 +0200 Subject: [MOBY-l] Can s/o correct the Perl examples online In-Reply-To: <8233DF2244998040848283889E22DBA0040F0D@MAIL.mpimp-golm.mpg.de> References: <8233DF2244998040848283889E22DBA0040F0D@MAIL.mpimp-golm.mpg.de> Message-ID: <200605301713.24522.d.haase@gsf.de> On Thursday 25 May 2006 19:02, Bjoern Usadel wrote: > Dear List, > > can someone please correct the Document: > http://biomoby.open-bio.org/CVS_CONTENT/moby-live/Docs/MOBY-S_API/Perl/Cons >tructingYourService.html In addition to the errors reported by Bjoern (see his posting), I noticed two further bugs in the echo service: 1. One of the closing curly braces before the return statement is wrong 2. That code would return totally illegal response because it puts the complete block from the request into the output (not only the object). That is, the response has nested simple tags. As far as I can see, there is no easy way to get the XML content of what is inside the simpleArticle (like the old 'extractRawContent' method), right? Another problem with the new 'server side paradigm' is that gbrowse_moby can currently not handle these services because it does not set inputArticleNames. So I wonder if it is really appropriate to declare the old parser methods 'deprecated'? Regards, dirk From markw at illuminae.com Tue May 30 15:03:51 2006 From: markw at illuminae.com (Mark Wilkinson) Date: Tue, 30 May 2006 12:03:51 -0700 Subject: [MOBY-l] [moby] Re: Can s/o correct the Perl examples online In-Reply-To: <200605301713.24522.d.haase@gsf.de> References: <8233DF2244998040848283889E22DBA0040F0D@MAIL.mpimp-golm.mpg.de> <200605301713.24522.d.haase@gsf.de> Message-ID: <1149015831.11394.6.camel@bioinfo.icapture.ubc.ca> On Tue, 2006-05-30 at 17:13 +0200, Dirk Haase wrote: > > can someone please correct the Document: > > http://biomoby.open-bio.org/CVS_CONTENT/moby-live/Docs/MOBY-S_API/Perl/Cons > >tructingYourService.html Done. > In addition to the errors reported by Bjoern (see his posting), I noticed two > further bugs in the echo service: > 1. One of the closing curly braces before the return statement is wrong fixed > 2. That code would return totally illegal response because it puts the > complete block from the request into the output (not only the > object). That is, the response has nested simple tags. fixed. also added a new method "->content" to the MOBY::Client::SimpleArticle object to make this easier to do. > As far as I can see, there is no easy way to get the XML content of what is > inside the simpleArticle (like the old 'extractRawContent' method), right? There is now :-) (->content) > Another problem with the new 'server side paradigm' is that gbrowse_moby can > currently not handle these services because it does not set > inputArticleNames. So I wonder if it is really appropriate to declare the old > parser methods 'deprecated'? Good point... I need to fix gbrowse_moby to be API-compliant! The old methods are deprecated in that they would only need to be used on non-API-compliant messages, but as you know they have not been removed from the codebase. My feeling is that actively supporting non- compliant messages is a bad thing to do, so it's probably not a good idea to advertise the fact that the code to do so still exists... M > Regards, > dirk > _______________________________________________ > moby-l mailing list > moby-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/moby-l -- -- Mark Wilkinson Asst. Professor, Dept. of Medical Genetics University of British Columbia PI in Bioinformatics, iCAPTURE Centre St. Paul's Hospital, Rm. 166, 1081 Burrard St. Vancouver, BC, V6Z 1Y6 tel: 604 682 2344 x62129 fax: 604 806 9274 "For most of this century we have viewed communications as a conduit, a pipe between physical locations on the planet. What's happened now is that the conduit has become so big and interesting that communication has become more than a conduit, it has become a destination in its own right..." Paul Saffo - Director, Institute for the Future From markw at illuminae.com Wed May 31 16:35:49 2006 From: markw at illuminae.com (Mark Wilkinson) Date: Wed, 31 May 2006 13:35:49 -0700 Subject: [MOBY-l] [moby] Re: Can s/o correct the Perl examples online In-Reply-To: <200605301713.24522.d.haase@gsf.de> References: <8233DF2244998040848283889E22DBA0040F0D@MAIL.mpimp-golm.mpg.de> <200605301713.24522.d.haase@gsf.de> Message-ID: <1149107749.13164.1.camel@bioinfo.icapture.ubc.ca> On Tue, 2006-05-30 at 17:13 +0200, Dirk Haase wrote: > Another problem with the new 'server side paradigm' is that gbrowse_moby can > currently not handle these services because it does not set > inputArticleNames. So I wonder if it is really appropriate to declare the old > parser methods 'deprecated'? Actually, I just realized that the copy of gbrowse_moby running on mobycentral does follow the API and put articleNames into the request; however I have not committed this code back to the GMOD sourceforge site yet. I'll try to get that done by the end of the day. M -- -- Mark Wilkinson Asst. Professor, Dept. of Medical Genetics University of British Columbia PI in Bioinformatics, iCAPTURE Centre St. Paul's Hospital, Rm. 166, 1081 Burrard St. Vancouver, BC, V6Z 1Y6 tel: 604 682 2344 x62129 fax: 604 806 9274 "For most of this century we have viewed communications as a conduit, a pipe between physical locations on the planet. What's happened now is that the conduit has become so big and interesting that communication has become more than a conduit, it has become a destination in its own right..." Paul Saffo - Director, Institute for the Future From darin.london at duke.edu Mon May 22 10:44:25 2006 From: darin.london at duke.edu (Darin London) Date: Mon, 22 May 2006 10:44:25 -0400 Subject: [MOBY-l] Announcing BOSC 2006 In-Reply-To: <44294B65.4050207@duke.edu> References: <44294B65.4050207@duke.edu> Message-ID: <4471CE49.80109@duke.edu> 2nd CALL FOR SPEAKERS This is the second and last official call for speakers to submit their abstracts to speak at BOSC 2006 in Fortaleza, Brasil. In order to be considered as a potential speaker, an abstract must be recieved by Monday, June 5th, 2006. We look forward to a great conference this year. Please consult The Official BOSC 2006 Website at: http://www.open-bio.org/wiki/BOSC_2006 for more details and information. In addition, a BOSC weblog has been setup to make it easier to desiminate all BOSC related announcements: http://wiki.open-bio.org/boscblog/ And if you have an ICAL compatible Calendar, there is an EventDB calendar set up with all BOSC related deadlines. http://eventful.com/groups/G0-001-000014747-0 More information about ISMB can be found at the Official ISMB 2006 Website: http://ismb2006.cbi.cnptia.embrapa.br/ Thank You, and we look forward to seeing you all, The BOSC Organizing Committee. From darin.london at duke.edu Mon May 22 12:00:55 2006 From: darin.london at duke.edu (Darin London) Date: Mon, 22 May 2006 09:00:55 -0700 Subject: [MOBY-l] [Bioperl-announce-l] BOSC 2006 2nd Call for Papers In-Reply-To: <4471CE49.80109@duke.edu> References: <44294B65.4050207@duke.edu> <4471CE49.80109@duke.edu> Message-ID: <000301c67db8$e8391f70$6400a8c0@CodonSolutions.local> 2nd CALL FOR SPEAKERS This is the second and last official call for speakers to submit their abstracts to speak at BOSC 2006 in Fortaleza, Brasil. In order to be considered as a potential speaker, an abstract must be recieved by Monday, June 5th, 2006. We look forward to a great conference this year. Please consult The Official BOSC 2006 Website at: http://www.open-bio.org/wiki/BOSC_2006 for more details and information. In addition, a BOSC weblog has been setup to make it easier to desiminate all BOSC related announcements: http://wiki.open-bio.org/boscblog/ And if you have an ICAL compatible Calendar, there is an EventDB calendar set up with all BOSC related deadlines. http://eventful.com/groups/G0-001-000014747-0 More information about ISMB can be found at the Official ISMB 2006 Website: http://ismb2006.cbi.cnptia.embrapa.br/ Thank You, and we look forward to seeing you all, The BOSC Organizing Committee. _______________________________________________ Bioperl-announce-l mailing list Bioperl-announce-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/bioperl-announce-l