View Single Post
Old 05-01-2014, 08:09 AM   #3
slcrick
Junior Member
 
Location: Washington, DC

Join Date: May 2014
Posts: 1
Default

Hi, this is Rick from In Silico Solutions, which maintains CRAVAT. Please see the following examples in Perl:

use LWP;
use URI;

my $browser = LWP::UserAgent->new();

#
# Job submission example, when the mutations are in a string
#
print "\n###### Submitting through GET #####\n";
my $urlSubmitGet = URI->new("http://www.cravat.us/rest/service/submit");
$urlSubmitGet->query_form(
'analyses' => 'CHASM',
'analysistype' => 'driver',
'chasmclassifier' => 'Ovary',
'email' => 'testUser@testemailservice.com',
'functionalannotation' => 'off',
'hg18' => 'off',
'mutations' => 'TR1 chr22 30421786 + A T',
'mupitinput' => 'off',
'tsvreport' => 'off');
my $responseSubmitGet = $browser->get($urlSubmitGet);
print $responseSubmitGet->content, "\n";

#
# Job submission example, when the mutations are in a file
#
print "\n###### Submitting through POST #####\n";
my $urlSubmitPost = "http://www.cravat.us/rest/service/submit";
my $responseSubmitPost = $browser->post($urlSubmitPost,
Content_Type => 'form-data',
Content => [
'analyses' => 'CHASM',
'analysistype' => 'driver',
'chasmclassifier' => 'Ovary',
'email' => 'testUser@testemailservice.com',
'functionalannotation' => 'off',
'hg18' => 'off',
'mupitinput' => 'off',
'tsvreport' => 'off',
'inputfile' => ['/home/testUser/mutations.txt']]);
print $responseSubmitPost->content, "\n";

#
# Job status checking example
#
print "##### Job Status Checking #####\n";
my $urlStatus = URI->new('http://www.cravat.us/rest/service/status');
$urlStatus->query_form('jobid' => 'testUser_20140430_110005');
my $responseStatus = $browser->get($urlStatus);
print $responseStatus->content, "\n";


Hope this helps and if you have any question, please let me know.
slcrick is offline   Reply With Quote