24 de octubre de 2017

SOAP interface of footprintDB

Hi,
this entry shows how to query footprintDB from a Perl script.
First, make sure you have module SOAP::lite, which you can install with: $ sudo cpan -i SOAP::Lite. The following Perl5 code shows how to make all dna, protein and text queries, obtaining XML output in all cases.
Note that if you register you can query also your private databases (see details in documentation). Also note that protein searches are time consuming, and if you wish to annotate a large number of proteins it is advised that BLASTP searches are done in your own hardware, with the appropriate FASTA files., as explained in a previous post. Cheers, Bruno.



#!/usr/bin/perl -w
use strict;
use SOAP::Lite;

my $footprintDBusername = ''; # type your username if registered
my ($result,$sequence,$sequence_name,$datatype,$keyword) = ('','','','','');
my $server = SOAP::Lite
-> uri('footprintdb')
-> proxy('http://floresta.eead.csic.es/footprintdb/ws.cgi');

## sample protein sequence
$sequence_name = 'test';
$sequence = 'IYNLSRRFAQRGFSPREFRLTMTRGDIGNYLGLTVETISRLLGRFQKSGMLAVKGKYITIEN';

$result = $server->protein_query($sequence_name,$sequence,$footprintDBusername);
unless($result->fault()){
 print $result->result(); 
}else{
 print 'error: ' . join(', ',$result->faultcode(),$result->faultstring());
}

## sample regulatory motif sequence
#$sequence = 'TGTGANNN'; # possible format
#$sequence = "TGTGA\nTGTGG\nTGTAG"; # another format
#transfac format for position weight matrices can be used as heredoc
$sequence= <<EOM;
DE 1a0a_AB
01 1 93 0 2
02 0 96 0 0
03 58 33 3 2
04 8 78 6 4
05 8 5 75 8
06 1 2 47 46
07 1 2 84 9
XX
EOM

$result = $server->DNA_motif_query($sequence_name,$sequence,$footprintDBusername);
unless($result->fault()){
 print $result->result();
}else{
 print 'error: ' . join(', ',$result->faultcode(),$result->faultstring());
}

$keyword = "myb";
$datatype = "site";
$result = $server->text_query($keyword,$datatype,$footprintDBusername);
unless($result->fault()){
 print $result->result();
}else{
 print 'error: ' . join(', ',$result->faultcode(),$result->faultstring());
}

2 comentarios: