changeset 7:04e3bba317f4 draft

Added selection to differentiate in VCF format
author geert-vandeweyer
date Thu, 05 Jun 2014 04:02:28 -0400
parents 775372e00f55
children db44ff975de8
files VCF_to_VariantDB.pl VCF_to_VariantDB.xml
diffstat 2 files changed, 21 insertions(+), 6 deletions(-) [+]
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);
--- a/VCF_to_VariantDB.xml	Fri Feb 21 07:17:28 2014 -0500
+++ b/VCF_to_VariantDB.xml	Thu Jun 05 04:02:28 2014 -0400
@@ -42,14 +42,21 @@
 
       ## The server to send results to
 	-S $server
-  
+      ## The input file format
+	-F $format 
       
   </command>
   <requirements>
 	<requirement type="package">tabix</requirement>
   </requirements>
   <inputs>
-        <param name="input1" type="data" format="vcf" label="VCF file" help="Unified Genotyper VCF File" />
+        <param name="input1" type="data" format="vcf" label="VCF file" help="Select variant file to import" />
+	<param name="format" type="select" label="VCF Source Application" help="Supported formats are VCF from UnifiedGenotyper, HaplotypeCaller, Mutect and VarScan">
+		<option value="UG">GATK Unified Genotyper</option>
+		<option value="HC">GATK Haplotype Caller</option>
+		<option value="MT">GATK MuTect</option>
+		<option value="VS">Samtools VarScan</option>
+	</param>
 	<conditional name="sendData">
 	  <param name="store" type="select" label="Store VCF and BAM Files:" help="This option allows you to send the BAM and VCF files to our storage server for dynamic loading into IGV. If you store them there, please delete them here." >
 		<option value="false">No</option>
@@ -58,6 +65,7 @@
  	  <when value="true">
 		<param name="bamfile" type="data" format="bam" label="BAM File." />
 	  </when>
+	  <when value="false" />
         </conditional>
 
 	<conditional name="namefromselect">
@@ -72,6 +80,7 @@
 	  <when value="other">
 		<param name="namefile" type="data" format="sam,bam,fastq,fasta,bed,fastqsanger,fastqillumina,txt,vcf" label="Select a file from the history to base the sample name upon" />
 	  </when>
+	  <when value="vcf"/>
         </conditional>
 	<param name="samplegender" type="select" label="Sample Gender: " help="This can be set from the database frontend as well.">
 		<option value="undef">Unspecified</option>
@@ -89,7 +98,7 @@
 
 **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. 
+This tools sends VCF files with results from the GATK unified genotyper, HaploType Caller, Mutect or samtools VarScan 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. 
 
 ------