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
A. fumigatus
Achromobacter
B. cepacia
B. cereus
B. licheniformis
Bordetella
C. difficile
C. diphtheriae
C. fetus
C. jejuni
Chlamydiales
Cronobacter
E. cloacae
H. pylori
Leptospira#2
Neisseria
P. aeruginosa
S. agalactiae
S. gallolyticus
S. pseudintermedius
S. uberis
V. cholerae
V. parahaemolyticus
Wolbachia
- Mirrors+ Mirrors
About our mirrors Primary | DK1 | NO1 | UK2 | UK3 | UK4 | US1 | US2
- Developers+ Developers
SOAP API