blast

Description: Performs a BLAST query against all loci for a particular database.

Arguments

Sample Perl code

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

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

#####Sample arguments#########
my $database = 'neisseria';
my $sequence = 'TTTGATACCGTTGCCGAAGGCTTGGGCGTAATCCG
CGATTTGTTGCGCCGTTATCATCATGTCAGCCAGGAGTTGGAAAACGGTTC
GGGTGAGATTTTGTTGAAAGAACTCAACGAATTGCAACTTGAAATCGAAGC
GAAGGACGGCTGGAAGCTAGATGCGGCAGTCAAGCAGACTTTGGGGGAACT
CGGTTTGCCGGAAAACGAAAAAATCGGCAACCTCTCCGGCGGCCAGAAAAA
GCGTGTCGCTTTGGCGCAGGCTTGGGTGCAGAAGCCCGACGTATTGCTGCT
GGACGAACCGACCAACCATTTGGATATCGACGCGATTATCTGGTTGGAAAA
CCTGCTCAAGGCGTTTGAAGGCAGCCTGGTTGTGATTACCCACGACCGCCG
TTTTTTGGACAATATCGCCACGCGCATTGTCGAACTCGATC';
my $numresults = 3;
##############################

my $soap = SOAP::Lite
    -> uri('http://pubmlst.org/MLST')
    -> proxy('http://pubmlst.org/cgi-bin/mlstdbnet/mlstFetch.pl');
my $soapResponse = $soap->blast($database,$sequence,$numresults);
unless ($soapResponse->fault){
    for my $t ($soapResponse->valueof('//blastMatch')) {
  	print $t->{'locus'} . "-" .
	      $t->{'id'} . ': Mismatches:' .
	      $t->{'mismatches'} . '; Gaps:' .
	      $t->{'gaps'} . '; Alignment '.
	      $t->{'alignment'} . '/' .
	      $t->{'length'} ."\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.Vector;

public class Blast {

    public static void main(String[] args) {
	//Sample arguments//////////////////////////////////////////////
	String database = "neisseria";
	String sequence = "TTTGATACCGTTGCCGAAGGCTTGGGCGTAATCCG"
	    + "CGATTTGTTGCGCCGTTATCATCATGTCAGCCAGGAGTTGGAAAACGGTTC"
	    + "GGGTGAGATTTTGTTGAAAGAACTCAACGAATTGCAACTTGAAATCGAAGC"
	    + "GAAGGACGGCTGGAAGCTAGATGCGGCAGTCAAGCAGACTTTGGGGGAACT"
	    + "CGGTTTGCCGGAAAACGAAAAAATCGGCAACCTCTCCGGCGGCCAGAAAAA"
	    + "GCGTGTCGCTTTGGCGCAGGCTTGGGTGCAGAAGCCCGACGTATTGCTGCT"
	    + "GGACGAACCGACCAACCATTTGGATATCGACGCGATTATCTGGTTGGAAAA"
	    + "CCTGCTCAAGGCGTTTGAAGGCAGCCTGGTTGTGATTACCCACGACCGCCG"
	    + "TTTTTTGGACAATATCGCCACGCGCATTGTCGAACTCGATC";
	int maxResults = 3;
	////////////////////////////////////////////////////////////////
	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/",
					    "blast"));
	    call.addParameter("database", org.apache.axis.Constants.XSD_STRING,
			      javax.xml.rpc.ParameterMode.IN);
	    call.addParameter("sequence", org.apache.axis.Constants.XSD_STRING,
			      javax.xml.rpc.ParameterMode.IN);
	    call.addParameter("maxResults", org.apache.axis.Constants.XSD_INT,
			      javax.xml.rpc.ParameterMode.IN);
	    call.setReturnType(org.apache.axis.Constants.SOAP_VECTOR);
	    Vector ret = (Vector) call.invoke(new Object[] { database,
							     sequence, maxResults });
	    for (int i = 0; i < ret.size(); i++) {
		Vector blastMatch = (Vector) ret.get(i);
		System.out.println(blastMatch.get(0) + "-" + blastMatch.get(1)
				   + ": Mismatches:" + blastMatch.get(2) + "; Gaps:"
				   + blastMatch.get(3) + "; Alignment "
				   + blastMatch.get(4) + "/" + blastMatch.get(5));
	    }
	} catch (Exception e) {
	    System.err.println(e.toString());
	}
    }
}

Output

abcZ-73: Mismatches:2; Gaps:0; Alignment 433/433
abcZ-83: Mismatches:3; Gaps:0; Alignment 433/433
abcZ-72: Mismatches:4; Gaps:0; Alignment 433/433

Navigation

- PubMLST+ PubMLST
MLST Home
Search / site map
Download data
Databases
News
- Software+ Software
Web tools
Software
- Recently updated+ Recently updated
A. baumannii (Oxford)
A. baumannii (Pasteur)
Achromobacter
B. cepacia
B. cereus
B. hampsonii
B. hyodysenteriae
B. intermedia
B. licheniformis
B. pilosicoli
B. subtilis
Bordetella
Brachyspira
C. concisus/curvus
C. difficile
C. fetus
C. helveticus
C. hyointestinalis
C. insulaenigrae
C. jejuni
C. lanienae
C. lari
C. sputorum
C. upsaliensis
Chlamydiales
Cronobacter
E. cloacae
E. faecalis
E. faecium
H. influenzae
H. parasuis
H. pylori
Leptospira#2
Leptospira#3
M. bovis
Neisseria
P. multocida (multi)
S. agalactiae
S. maltophilia
S. pneumoniae
Taylorella
V. cholerae
V. parahaemolyticus
V. vulnificus
Wolbachia
- Mirrors+ Mirrors
About our mirrors Primary | DK1 | NO1 | UK2 | UK3 | UK4 | US1 | US2
- Developers+ Developers
SOAP API