#!/usr/bin/perl # Description: Calculate DNA properties # Author: Peter Fischer Hallin # Email: pfh@cbs.dtu.dk # Version: Genome Atlas 3.0.ws2 # Date: 2009-02-14 # include standard XML::Compile helper functions (used to initiate WSDL proxys) require "xml-compile.pl"; use strict; # read DNA from stdin my @fasta; my $entry=-1; my $method = $ARGV[0]; while () { if ( /^>(\S+)\s*(.*)/) { $entry++; $fasta[$entry]{id} = $1; $fasta[$entry]{comment} = $2; } elsif (/([A-Z]+)/) { $fasta[$entry]{seq} .= $1; } } # usage getseq.pl [genbank accession no.] # create proxy to genome atlas my $proxy_genomeatlas = WSDLclient ( 'http://www.cbs.dtu.dk/ws/GenomeAtlas/GenomeAtlas_3_0_ws2.wsdl'); use Data::Dumper; foreach my $entry (0 .. $#fasta) { my $response = $proxy_genomeatlas->{DNApropertyRun}->( parameters => { parameters => { method => $method , sequence => {id => $fasta[$entry]{id} ,comment => $fasta[$entry]{comment} , seq => $fasta[$entry]{seq} }}}); die "error obtaining jobid\n" unless defined ( $response->{queueentry}->{queueentry}); my $jobid = $response->{queueentry}->{queueentry}->{jobid}; wait_job($proxy_genomeatlas->{pollQueue},$jobid); print ">$fasta[$entry]{id} $fasta[$entry]{comment}\n"; $response = $proxy_genomeatlas->{DNApropertyFetchResult}->( job => { jobid => $jobid }); print $response->{parameters}->{output}->{values}."\n"; }