getProfile
Description: Returns allelic profile defined for a ST. Clonal complex is also returned if it is defined.
Arguments
- database (string)
- ST (integer)
Sample Perl code
#!/usr/bin/perl #Written by Keith Jolley use SOAP::Lite; use strict; use warnings; #####Sample arguments######### my $database = 'neisseria'; my $ST = '11'; ############################## my $soap = SOAP::Lite -> uri('http://pubmlst.org/MLST') -> proxy('http://pubmlst.org/cgi-bin/mlstdbnet/mlstFetch.pl'); my $soapResponse = $soap->getProfile($database,$ST); unless ($soapResponse->fault){ for my $t ($soapResponse->valueof('//alleleNumber')) { print $t->{'locus'}. ': ' . $t->{'id'} . "\n"; } print "clonal complex: " .$soapResponse->valueof('//complex'). "\n" if ($soapResponse->valueof('//complex')); } else { print join ', ',$soapResponse->faultcode,$soapResponse->faultstring; }
Sample Java code
package org.pubmlst.mlstSOAP; import org.apache.axis.client.Call; import org.apache.axis.client.Service; import org.apache.axis.description.*; import org.apache.axis.encoding.ser.*; import javax.xml.namespace.QName; import java.util.Map; public class GetProfile { public static void main(String[] args) { //Sample arguments//////////////// String database = "neisseria"; int st = 11; ////////////////////////////////// try { String endpoint = "http://pubmlst.org/cgi-bin/mlstdbnet/mlstFetch.pl"; Service service = new Service(); Call call = (Call) service.createCall(); call.setTargetEndpointAddress(new java.net.URL(endpoint)); call.registerTypeMapping(AlleleNumber.class, new QName( "http://pubmlst.org/MLST", "alleleNumber"), BeanSerializerFactory.class, BeanDeserializerFactory.class, false); OperationDesc oper = new OperationDesc(); oper.addParameter(new ParameterDesc(new QName("", "database"), ParameterDesc.IN, new QName( "http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false)); oper.addParameter(new ParameterDesc(new QName("", "ST"), ParameterDesc.IN, new QName( "http://www.w3.org/2001/XMLSchema", "int"), int.class, false, false)); ParameterDesc param = new ParameterDesc(new QName("", "profile"), ParameterDesc.OUT, new QName("http://pubmlst.org/MLST", "profile"), AlleleNumber[].class, false, false); param.setItemQName(new QName("", "alleleNumber")); oper.addParameter(param); param = new ParameterDesc(new QName("", "complex"), ParameterDesc.OUT, new QName( "http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false); param.setOmittable(true); oper.addParameter(param); oper.setReturnType(org.apache.axis.encoding.XMLType.AXIS_VOID); call.setOperation(oper); call.setOperationName(new QName("http://pubmlst.org/MLST", "getProfile")); call.invoke(new Object[] { database, st }); Map output = call.getOutputParams(); AlleleNumber[] alleles = (AlleleNumber[]) output.get(new QName("", "profile")); for (int i = 0; i < alleles.length; i++) { System.out.println(alleles[i].getLocus() + ": " + alleles[i].getId()); } String complex = ((String) output.get(new QName("", "complex"))); if (complex != null) { System.out.println("clonal complex: " + complex); } } catch (Exception e) { System.err.println(e.toString()); } } protected static class AlleleNumber { private String locus; private int id; public AlleleNumber(String locus, int id) { this.locus = locus; this.id = id; } public java.lang.String getLocus() {return locus;} public void setLocus(String locus) {this.locus = locus;} public int getId() {return id;} public void setId(int id) {this.id = id;} } }
Output
abcZ: 2 adk_: 3 aroE: 4 fumC: 3 gdh_: 8 pdhC: 4 pgm_: 6 clonal complex: ST-11 complex/ET-37 complex