diff VCF_to_VariantDB.pl @ 7:04e3bba317f4 draft

Added selection to differentiate in VCF format
author geert-vandeweyer
date Thu, 05 Jun 2014 04:02:28 -0400
parents 6ddc1c6472ef
children db44ff975de8
line wrap: on
line diff
--- a/VCF_to_VariantDB.pl	Fri Feb 21 07:17:28 2014 -0500
+++ b/VCF_to_VariantDB.pl	Thu Jun 05 04:02:28 2014 -0400
@@ -20,7 +20,8 @@
 # S = (S)erver addrress to send data to.
 # R = (r)oot of galaxy web server (/home/galaxyuser/galaxy-dist)
 # 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
+# F = (F)ormat of input file 
+getopts('v:u:n:a:g:o:b:B:V:c:S:R:H:F:', \%opts);  # option are in %opts
 
 $|++;
 #################
@@ -41,6 +42,9 @@
 if (!exists($opts{'H'})) {
 	die('The Galaxy source-server is not specified');
 }
+if (!exists($opts{'F'})) {
+	die('VCF format not specified.');
+}
 
 ################
 # open outfile #
@@ -90,6 +94,8 @@
 my $vcfpath = $opts{'v'};
 my $bampath = $opts{'b'};
 my $baipath = $opts{'B'};
+# input VCF format
+$format = $opts{'F'};
 # make output directory in (galaxy/static/) working dir
 my $rand = int(rand(1000));
 our $wd = $opts{'R'}."/static/VCF_parser.".$rand; #int(rand(1000));
@@ -116,10 +122,10 @@
 $gender = $opts{'g'};
 # post form to the variantDB host. 
 if (exists($opts{'b'})) {
-	$response = $conn->post( $url, {'VCFurl1' => "$vcfurl", 'BAMurl1' => "$bamurl", 'BAIurl1' => "$bamidxurl",'storedata1' => 1, 'name1' => "$sample", 'gender1' => "$gender", 'User' => $email, 'GalaxyUpload' => 1} );
+	$response = $conn->post( $url, {'VCFurl1' => "$vcfurl", 'BAMurl1' => "$bamurl", 'BAIurl1' => "$bamidxurl",'storedata1' => 1, 'name1' => "$sample", 'gender1' => "$gender", 'User' => $email, 'GalaxyUpload' => 1,'Format1' => $format} );
 }
 else {
-	$response = $conn->post( $url, {'VCFurl1' => "$vcfurl",  'name1' => "$sample", 'gender1' => "$gender", 'User' => $email, 'GalaxyUpload' =>1 } );
+	$response = $conn->post( $url, {'VCFurl1' => "$vcfurl",  'name1' => "$sample", 'gender1' => "$gender", 'User' => $email, 'GalaxyUpload' =>1, 'Format1' => $format } );
 }
 my $content = $response->decoded_content();
 chomp($content);