getRelatedProfilesByST

Description: Returns profiles (and clonal complexes if defined) that match at at least the specified number of loci. Query is by ST.

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 $ST = 11;
##############################

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;
}

$soapResponse = $soap->getRelatedProfilesByST($database,$match,$ST);
unless ($soapResponse->fault){
    my $i=0;
    my @alleleNumbers = $soapResponse->dataof('//STDef/profile/alleleNumber');
    for my $soapData ($soapResponse->dataof('//STDef')) {
	print "ST-".$soapData->value->{'ST'}."\n";
	for (my $j=0; $j<scalar @loci; $j++){
	    print $alleleNumbers[$i]->value->{'locus'} . '-';
	    print $alleleNumbers[$i]->value->{'id'} . "\n";
	    $i++;
	}
	print $soapData->value->{'complex'}."\n" if $soapData->value->{'complex'} ;
	print "\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 org.apache.axis.description.OperationDesc;
import org.apache.axis.description.ParameterDesc;
import org.apache.axis.encoding.ser.*;
import javax.xml.namespace.QName;

public class GetRelatedProfilesByST {

    public static void main(String[] args) {
	//Sample arguments////////////////
	String database = "neisseria";
	int match = 6;
	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);
	    call.registerTypeMapping(StDefinition.class, new QName(
			"http://pubmlst.org/MLST", "stDefinition"),
		BeanSerializerFactory.class, BeanDeserializerFactory.class,
		false);
	    call.setOperationName(new QName("http://pubmlst.org/MLST",
		"getRelatedProfilesByST"));
	    OperationDesc oper = new OperationDesc();

	    oper.setName("getRelatedProfilesByST");
	    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("", "match"),
		ParameterDesc.IN, new QName(
			"http://www.w3.org/2001/XMLSchema", "int"),
		int.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));
	    oper.setReturnType(new QName("http://pubmlst.org/MLST",
		 "stDefinition"));
	    oper.setReturnClass(StDefinition[].class);
	    oper.setReturnQName(new QName("", "STDef"));
	    call.setOperation(oper);

	    StDefinition[] defs = ((StDefinition[]) call.invoke(new Object[] {
		database, match, st }));
	    for (int i=0; i<defs.length; i++){
		System.out.println("ST-" + defs[i].getST());
		AlleleNumber[] profile = defs[i].getProfile();
		for (int j=0; j<profile.length; j++){
		    System.out.println(profile[j].getLocus() + "-"
				       + profile[j].getId());
		}
		if (defs[i].getComplex() != null){
		    System.out.println(defs[i].getComplex());
		}
		System.out.println();
	    }
	} 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;}
    }

    protected static class StDefinition {
	private int ST;
	private AlleleNumber[] profile;
	private String complex;

	public StDefinition() {
	}

	public StDefinition(int ST,AlleleNumber[] profile,String complex) {
	    this.ST = ST;
	    this.profile = profile;
	    this.complex = complex;
	}

	public int getST() {return ST;}
	public void setST(int ST) {this.ST = ST;}
	public AlleleNumber[] getProfile() {return profile;}
	public void setProfile(AlleleNumber[] profile) {this.profile = profile;}
	public String getComplex() {return complex;}
	public void setComplex(String complex) {this.complex = complex;}
    }
}

Output

ST-11
abcZ-2
adk_-3
aroE-4
fumC-3
gdh_-8
pdhC-4
pgm_-6
ST-11 complex/ET-37 complex

ST-50
abcZ-2
adk_-3
aroE-19
fumC-3
gdh_-8
pdhC-4
pgm_-6
ST-11 complex/ET-37 complex
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