getLocusLength

Description: Returns standard length of locus and a boolean value indicating whether variable lengths are allowed.

Arguments

Sample Perl code

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

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

#####Sample arguments#########
my $database = 'neisseria';
my $locus = 'aroE';
##############################

my $soap = SOAP::Lite
    -> uri('http://pubmlst.org/MLST')
    -> proxy('http://pubmlst.org/cgi-bin/mlstdbnet/mlstFetch.pl');
my $soapResponse = $soap->getLocusLength($database,$locus);
unless ($soapResponse->fault){
    print "Length: " . ($soapResponse->valueof('//length'));
    my $variable = 'false';
    $variable = 'true' if $soapResponse->valueof('//variable');
    print " Variable: $variable\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.*;
import javax.xml.namespace.QName;
import java.util.Map;

public class GetLocusLength {

    public static void main(String[] args) {
	//Sample arguments////////////////
	String database = "neisseria";
	String locus = "aroE";
	//////////////////////////////////
	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/",
		"getLocusLength"));
	    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("", "locus"),
		ParameterDesc.IN, new QName(
			"http://www.w3.org/2001/XMLSchema", "string"),
		String.class, false, false));
	    oper.addParameter(new ParameterDesc(new QName("", "length"),
		ParameterDesc.OUT, new QName(
			"http://www.w3.org/2001/XMLSchema", "int"),
		int.class, false, false));
	    ParameterDesc param = new ParameterDesc(
			new QName("", "variable"),
		ParameterDesc.OUT, new QName(
			"http://www.w3.org/2001/XMLSchema", "boolean"),
		boolean.class, false, false);
	    oper.addParameter(param);
	    oper.setReturnType(org.apache.axis.encoding.XMLType.AXIS_VOID);
	    call.setOperation(oper);

	    call.invoke(new Object[] { database,locus });
	    Map output = call.getOutputParams();
	    int length = ((Integer) output.get(new QName("", "length")));
	    boolean variable = ((Boolean) output.get(new QName("", "variable")));
	    System.out.println("Length: " + length + " Variable: " + variable);
	} catch (Exception e) {
	    System.err.println(e.toString());
	}
    }
}

Output

Length: 490 Variable: false

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