getRelatedIsolateIdsByProfile

Description: Returns list of STs that match at at least the specified number of loci. Query is by allelic profile.

Arguments

Sample Perl code

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

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

#####Sample arguments#########
my $database = 'neisseria';
my $match = 6;
my @profile = (2,3,4,3,8,4,6);
##############################

my $soap = SOAP::Lite
    -> uri('http://pubmlst.org/MLST')
    -> proxy('http://pubmlst.org/cgi-bin/mlstdbnet/mlstFetch.pl');

#Get list of loci
my $soapResponse = $soap->getLocusList($database);
my @loci;
for my $locus ($soapResponse->valueof('//locus')) {
    push @loci,$locus;
}

my @profileElements;
my $i=0;
foreach my $locus (@loci){
    push @profileElements,SOAP::Data->name('alleleNumber' => \SOAP::Data->value(
	SOAP::Data->name('locus' => $locus),
	SOAP::Data->name('id' => $profile[$i])));
    $i++;
}
$soapResponse = $soap->getRelatedIsolateIdsByProfile($database,$match,@profileElements);
unless ($soapResponse->fault){
    print "Matching ids:\n";
    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.ArrayList;
import java.util.Vector;
import java.util.HashMap;

public class GetRelatedIsolateIdsByProfile {

    public static void main(String[] args) {
	//Sample arguments////////////////
	String database = "neisseria";
	int match = 6;
	Integer[] profile = {2,3,4,3,8,4,6};
	//////////////////////////////////
	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));
	    // Get list of loci
	    call.setOperationName(new QName("http://pubmlst.org/MLST/",
					    "getLocusList"));
	    @SuppressWarnings("unchecked")
		ArrayList<String> loci = (ArrayList) call.invoke(new Object[] { database });

	    call.setOperationName(new QName("http://pubmlst.org/MLST/",
					    "getRelatedIsolateIdsByProfile"));
	    Vector<Object> callArgs = new Vector<Object>();
	    callArgs.add(database);
	    callArgs.add(match);
	    for (int i=0; i<loci.size(); i++){
		HashMap<String,Object> alleleNumber = new HashMap<String,Object>();
		alleleNumber.put("locus", loci.get(i));
		alleleNumber.put("id",profile[i]);
		callArgs.addElement(alleleNumber);
	    }
	    Object idList = call.invoke(callArgs.toArray());
	    System.out.println("Matching ids:");
	    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

Matching ids:
79
80
83
85
86
87
88
etc ...

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