# HG changeset patch # User geert-vandeweyer # Date 1392810332 18000 # Node ID d03a63a57e822ab562a390a6993059b0a5b2fcda # Parent 355e491dbd0f59f9beb3ba12bfdeb73ba16f689b New version, better following configuration guidelines diff -r 355e491dbd0f -r d03a63a57e82 VCF_to_VariantDB.pl --- a/VCF_to_VariantDB.pl Wed May 08 04:34:30 2013 -0400 +++ b/VCF_to_VariantDB.pl Wed Feb 19 06:45:32 2014 -0500 @@ -22,7 +22,7 @@ # H = (H)ost of the galaxy web server (http://my.galaxy.server/galaxy/) getopts('v:u:n:a:g:o:b:B:V:c:S:R:H:', \%opts); # option are in %opts - +$|++; ################# ## CHECK INPUT ## ################# @@ -55,6 +55,7 @@ $url =~ s/\/\/$/\//; $url .= "cgi-bin/galaxy_communication.cgi"; my $conn = LWP::UserAgent->new(); +$conn->timeout(1800); my $response = $conn->post( $url, {'HelloWorld' => 1} ); my $content = $response->decoded_content(); @@ -113,20 +114,42 @@ $gender = $opts{'g'}; # post form to the variantDB host. if (exists($opts{'b'})) { - $response = $conn->post( $url, {'VCFurl1' => "$vcfurl", 'BAMurl1' => "$bamurl", 'BAIurl1' => "$bamidxurl",'storedata' => 1, 'name1' => "$sample", 'gender1' => "$gender", 'User' => $email} ); + $response = $conn->post( $url, {'VCFurl1' => "$vcfurl", 'BAMurl1' => "$bamurl", 'BAIurl1' => "$bamidxurl",'storedata1' => 1, 'name1' => "$sample", 'gender1' => "$gender", 'User' => $email, 'GalaxyUpload' => 1} ); } else { - $response = $conn->post( $url, {'VCFurl1' => "$vcfurl", 'sample1' => "$sample", 'gender1' => "$gender", 'User' => $email} ); + $response = $conn->post( $url, {'VCFurl1' => "$vcfurl", 'name1' => "$sample", 'gender1' => "$gender", 'User' => $email, 'GalaxyUpload' =>1 } ); } my $content = $response->decoded_content(); chomp($content); -if ($content =~ m/OK$/) { - print OUT "Processing Datafiles : OK.\n"; - print OUT "\n$content\n"; -} -else { +## check if upload went ok. +if (substr($content,0,2) ne 'OK') { die("ERROR: $content"); } +## extract wd from content. +print OUT "Uploading datafiles to VariantDB : OK.\n"; +$content =~ m/OK-(.+)$/; +$rwd = $1; +if ($rwd eq '') { + die("ERROR : No remote working directory provided to check status."); +} +## now wait for the import to finish. +$status = 0; +while ($status == 0) { + my $response = $conn->post( $url, {'CheckStatus' => 1,'rwd' => $rwd}) ; + $content = $response->decoded_content(); + chomp($content); + if (substr($content,0,2) ne 'OK') { + die("ERROR: $content"); + } + $status = substr($content,3,1); + sleep 10; +} + +## Loading OK +# latest respons : OK-1-Content +$content = substr($content,5); +print OUT "Processing Datafiles : OK.\n"; +print OUT "\n$content\n"; close OUT; # clean up diff -r 355e491dbd0f -r d03a63a57e82 VCF_to_VariantDB.xml --- a/VCF_to_VariantDB.xml Wed May 08 04:34:30 2013 -0400 +++ b/VCF_to_VariantDB.xml Wed Feb 19 06:45:32 2014 -0500 @@ -1,14 +1,17 @@ - - Reverse processing (on VariantDB server) + + + + + VCF_to_VariantDB_macros.xml + - VCF_to_VariantDB.pl - ## THE GALAXY HOST - -H 'http://143.169.238.104/galaxy' + VCF_to_DB_reverse.pl + -H '@URL@' -R $__root_dir__ ## input file -v $input1 -V $__app__.security.encode_id( '%s' % $input1.id ) - ## user email, for identification in VariantDB, accounts must match + ## user email, for identification in DataBase -u $__user_email__ ## OUTPUT FILE @@ -64,7 +67,7 @@ - + @@ -77,7 +80,6 @@ - @@ -87,16 +89,14 @@ **What it does** -This tools sends the results from the GATK unified genotyper to a VariantDB server. From there, variants can be compared between samples, filtered on various annotations etc. To add servers, specify them in the tool configuration XML file. Accounts must match between the chosen VariantDB and Galaxy user. - -VariantDB is an flexible portal for filtering and annotating variants. +This tools sends the results from the GATK unified genotyper to a VariantDB server. From there, variants can be compared between samples, filtered on various annotations etc. To add servers, specify them in the tool configuration XML file. ------ **Input file** -VCF file from the GATK Unified Genotyper. Optional : BAM file for storage in VariantDB and subsequent visualisation in IGV. +VCF file from the GATK Unified Genotyper. ------ diff -r 355e491dbd0f -r d03a63a57e82 VCF_to_VariantDB_macros.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/VCF_to_VariantDB_macros.xml Wed Feb 19 06:45:32 2014 -0500 @@ -0,0 +1,11 @@ + + + + perl_module_www + GALAXY_URL + + + + "\$GALAXY_URL/" + + diff -r 355e491dbd0f -r d03a63a57e82 readme.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/readme.rst Wed Feb 19 06:45:32 2014 -0500 @@ -0,0 +1,17 @@ +Galaxy wrapper for VariantDB Import +=================================== + +This wrapper and VariantDB is written by Geert Vandeweyer. + +The recommended installation is by means of the toolshed_. + +.. _toolshed: http://toolshed.g2.bx.psu.edu/view/geert-vandeweyer/vcf_to_variantdb + +Galaxy should be able to install the needed perl module dependencies automatically +for you. To allow your server to communicate with VariantDB, you must edit the GALAXY_URL environment variable in the file: + +/environment_settings/GALAXY_URL/geert-vandeweyer/vcf_to_variantdb//env.sh + +to point to the full URL of the server (e.g: http://biominavm-galaxy.biomina.be/galaxy ) where you have installed the wrapper. + +Finally, if you also have a private VariantDB instance, you need to add it to the wrapper configuration file, as an extra option. diff -r 355e491dbd0f -r d03a63a57e82 tool_dependencies.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool_dependencies.xml Wed Feb 19 06:45:32 2014 -0500 @@ -0,0 +1,6 @@ + + + + + +