#!/usr/bin/perl # Description: Calculate SIDD of input sequence (fasta) # Author: Peter Fischer Hallin # Email: pfh@cbs.dtu.dk # Version: 1.0a ws0 # Date: 2009-05-04 use strict; use Data::Dumper; require "xml-compile.pl"; require "fasta.inc.pl"; my $proxy = WSDLclient ( 'http://www.cbs.dtu.dk/ws/SIDDbase/SIDDbase_1_0a_ws0.wsdl' ); # read fasta from stdin my @fasta = read_fasta(); my $ENERGETICS = "c"; my $GEOMETRY = "c"; my $SIGMA = "-0.045"; my $WEIGHT = '10'; for ( my $i = 0 ; $i < scalar ( @fasta ) ; $i++ ) { runSIDD ( $proxy, $fasta[$i]->{id}, $fasta[$i]->{comment}, $fasta[$i]->{seq}, $ENERGETICS, $GEOMETRY, $SIGMA, $WEIGHT ); } sub runSIDD { my ($proxy,$id,$comment,$seq,$energetics,$geometry,$sigma,$weight,$format) = @_; my $response = $proxy->{runService}->( parameters => { parameters => { sequencedata => { sequence => [ { id => $id , comment => $comment , seq => $seq , } ] } , energetics => $energetics , geometry => $geometry , sigma => $sigma , weight => $weight , format => 'element' , } } ); my ($jobid,$status,$expires); die "error obtaining jobid\n" unless defined ( $response->{parameters}->{queueentry}); $jobid = $response->{parameters}->{queueentry}->{jobid}; wait_job($proxy->{pollQueue},$jobid); $response = $proxy->{fetchResult}->( job => { jobid => $jobid }) ; printf STDERR "version: %s\n" , $response->{parameters}->{output}->{version}; printf STDERR "organism_name: %s\n" , $response->{parameters}->{output}->{organism_name}; printf STDERR "segment: %s\n" , $response->{parameters}->{output}->{segment}; printf STDERR "entrez_pid: %s\n" , $response->{parameters}->{output}->{entrez_pid}; printf STDERR "method: %s\n" , $response->{parameters}->{output}->{method}; printf STDERR "digest: %s\n" , $response->{parameters}->{output}->{digest}; printf STDERR "geometry: %s\n" , $response->{parameters}->{output}->{geometry}; print STDERR "pos base probability energy\n"; print ">$id $comment\n"; foreach my $sidd (@{$response->{parameters}->{output}->{element}->{pos}}) { printf ("%s\t%s\t%0.2e\t%0.2f\n",$sidd->{x},$sidd->{nt},$sidd->{P},$sidd->{G}); } }