comparison snpEff/scripts/queryBiomart.pl @ 0:481a95ca5339

Migrated tool version 0.9 from old tool shed archive to new tool shed repository
author pcingola
date Tue, 07 Jun 2011 17:08:59 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:481a95ca5339
1 #!/usr/bin/perl
2
3 #------------------------------------------------------------------------------
4 # An example script demonstrating the use of BioMart webservice
5 #------------------------------------------------------------------------------
6
7 use strict;
8 use LWP::UserAgent;
9
10 open (FH,$ARGV[0]) || die ("\nUsage: queryBiomart.pl Query.xml\n\n");
11 my $xml;
12 while (<FH>){ $xml .= $_; }
13 close(FH);
14
15 my $path="http://www.biomart.org/biomart/martservice?";
16 my $request = HTTP::Request->new("POST",$path,HTTP::Headers->new(),'query='.$xml."\n");
17 my $ua = LWP::UserAgent->new;
18
19 my $response;
20 $ua->request($request,
21 sub {
22 my($data, $response) = @_;
23 if ($response->is_success) { print "$data"; }
24 else { warn ("Problems with the web server: ".$response->status_line); }
25 } ,1000);