isolateQuery

Description: Returns a list of isolate ids that match all fields. Searching is not case-sensitive. Any number of fields can be passed as arguments. By passing an exactMatch boolean parameter, you can set whether exact or partial matches are used.

Arguments

Sample Perl code

#!/usr/bin/perl
#Written by Keith Jolley

use SOAP::Lite;
use strict;
use warnings;

#####Sample arguments#########
my $database = 'neisseria';
my %fields = ('country' => 'france',
	      'serogroup' => 'b',
	      'year' => '2004');
my $exactMatch = 'true';
##############################

my $soap = SOAP::Lite
    -> uri('http://pubmlst.org/MLST')
    -> proxy('http://pubmlst.org/cgi-bin/mlstdbnet/mlstFetch.pl');
my @elements;
foreach my $field (keys %fields){
    push @elements,SOAP::Data->name('field' => \SOAP::Data->value(
		SOAP::Data->name('name' => $field),
	SOAP::Data->name('value' => $fields{$field})));
}
my $soapResponse = $soap->isolateQuery($database,@elements,$exactMatch);
unless ($soapResponse->fault){
    for my $t ($soapResponse->valueof('//id')) {
	print "$t\n";
    }
} 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 javax.xml.namespace.QName;
import java.util.*;

public class IsolateQuery {

    public static void main(String[] args) {
	//Sample arguments////////////////
	String database = "neisseria";
	HashMap<String,Object> fields = new HashMap<String,Object>();
	fields.put("country", "france");
	fields.put("serogroup", "b");
	fields.put("year", 2004);
	boolean exactMatch = true;
	//////////////////////////////////
	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.setOperationName(new QName("http://pubmlst.org/MLST/",
					    "isolateQuery"));
	    Vector<Object> callArgs = new Vector<Object>();
	    callArgs.add(database);
	    Set keySet = fields.keySet();
	    Iterator it = keySet.iterator();
	    while (it.hasNext()){
		HashMap<String,Object> field = new HashMap<String,Object>();
		String fieldName = (String)it.next();
		field.put("name", fieldName);
		field.put("value",fields.get(fieldName));
		callArgs.addElement(field);
	    }
	    callArgs.add(exactMatch);
	    Object idList = call.invoke(callArgs.toArray());
	    if (idList instanceof ArrayList){
		for (int i=0; i<((ArrayList)idList).size(); i++){
		    System.out.println(((ArrayList)idList).get(i));
		}
	    } else if (idList instanceof Integer) {
		System.out.println(idList);
	    }
	} catch (Exception e) {
	    System.err.println(e.toString());
	}
    }
}

Output

5519
5524
5525
5527
5528
5530
5531
6621
6624
6627
6628
6629
6630
6632
6636
6638
6640
6641

Navigation

- PubMLST+ PubMLST
MLST Home
Search / site map
- Software+ Software
Bio-Linux
Web tools
Software
- Bacteria+ Bacteria
A. baumannii
Arcobacter
B. cereus
Bordetella
Brachyspira
B. cepacia
C. fetus
C. helveticus
C. insulaenigrae
C. jejuni & C. coli
C. lari
C. upsaliensis
Chlamydiales
H. pylori
L. monocytogenes
Neisseria
P. aeruginosa
P. gingivalis
S. agalactiae
S. uberis
S. zooepidemicus
Streptomyces
V. parahaemolyticus
V. vulnificus
Wolbachia
- Eukaryotes+ Eukaryotes
A. fumigatus
C. krusei
C. tropicalis
- Other dbases+ Other dbases
B. burgdorferi MLSA
Plasmid MLST
- Mirrors+ Mirrors
About our mirrors Primary |UK1 |UK2 |US1
- Developers+ Developers
SOAP API