changeset 0:abde5b0387c8 draft

Uploaded
author dereeper
date Mon, 23 Mar 2015 05:17:19 -0400
parents
children 633d264f8888
files SnpEff.pl snpEff-pipe.sh snpEff.xml tool-data/tool_dependencies.xml
diffstat 4 files changed, 165 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SnpEff.pl	Mon Mar 23 05:17:19 2015 -0400
@@ -0,0 +1,82 @@
+#!/usr/bin/perl
+
+use strict;
+use Getopt::Long;
+
+my $usage = qq~Usage:$0 <args> [<opts>]
+where <args> are:
+    -i, --input         <input VCF>
+    -o, --output        <output>
+    -g, --gff           <GFF annotation>
+    -f, --fasta         <Fasta of chromosomes>
+    -h, --html          <HTML output>
+~;
+$usage .= "\n";
+
+my ($input,$output,$gff,$fasta,$html);
+
+
+GetOptions(
+	"input=s"      => \$input,
+	"output=s"     => \$output,
+	"gff=s"        => \$gff,
+	"fasta=s"      => \$fasta,
+	"html=s"       => \$html
+);
+
+
+die $usage
+  if ( !$input || !$output || !$fasta || !$gff || !$html);
+
+
+if (!-e $gff){
+        die "Error: GFF input does not exist\n"
+}
+if (!-e $fasta){
+        die "Error: Fasta input does not exist\n"
+}
+
+#my $SNPEFF_PATH = "/usr/local/bioinfo/galaxy/galaxy_dist/tools/SNiPlay/SnpEff/snpEff";
+my $SNPEFF_PATH = $ENV{SNPEFF_JAR_PATH};
+
+
+my $session = $$;
+mkdir($session);
+mkdir("$session/data");
+mkdir("$session/data/genomes");
+mkdir("$session/data/myspecies");
+
+system("cp -rf $fasta $session/data/genomes/myspecies.fa");
+system("cp -rf $gff $session/data/myspecies/genes.gff");
+
+open(my $C,"$SNPEFF_PATH/snpEff.config");
+open(my $C2,">$session/snpEff.config");
+while(<$C>)
+{
+	if (/data_dir/)
+	{
+		print $C2 "data_dir = ./data\n";
+	}
+	elsif (/^genomes/)
+	{
+		print $C2 "genomes : \\n";
+        	print $C2 "myspecies, myspecies \\n";
+	}
+	else
+	{
+		print $C2 $_;
+	}
+}
+print $C2 "myspecies.genome : myspecies\n";
+close($C);
+close($C2);
+
+
+my $build_cmd = "java -jar $SNPEFF_PATH/snpEff.jar build -c $session/snpEff.config -gff3 myspecies";
+system($build_cmd);
+
+my $eff_cmd = "java -jar $SNPEFF_PATH/snpEff.jar eff -c $session/snpEff.config -o vcf -no-downstream -no-upstream myspecies -s $html $input >$output";
+system($eff_cmd);
+
+
+system("rm -rf $session");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/snpEff-pipe.sh	Mon Mar 23 05:17:19 2015 -0400
@@ -0,0 +1,14 @@
+#!/bin/bash
+vcf=$1
+genome=$2
+gff=$3
+output=$4
+html=$5
+log=$6
+
+directory=`dirname $0`
+ 
+/usr/bin/perl $directory/SnpEff.pl -i $vcf -f $genome -g $gff -o $output -h $html >>$log 2>&1
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/snpEff.xml	Mon Mar 23 05:17:19 2015 -0400
@@ -0,0 +1,63 @@
+<tool id="snpEff" name="SnpEff" version="4.0">
+	<description>predicts SNP effect from a genomic VCF file</description>
+	<requirements>
+		<requirement type="package" version="4.0">snpEff</requirement>
+	</requirements> 	
+
+	<!-- 
+	    You will need to change the path to wherever your installation is.
+		You can change the amount of memory used by snpEff, just change the -Xmx parameter (e.g. use -Xmx2G for 2Gb of memory)
+	-->
+	<command interpreter="bash">./snpEff-pipe.sh $vcf $genome $gff $output $statsFile $log</command>
+	<inputs>
+		<param format="vcf" name="vcf" type="data" label="VCF input file" help="Positions must be genomic positions"/>
+		<param format="fasta" name="genome" type="data" label="Reference genome in Fasta" help=""/>
+		<param format="gff3" name="gff" type="data" label="GFF annotation of the genome" help=""/>
+
+	</inputs>
+	<outputs>
+		<data format="vcf" name="output" label="Annotated VCF" />
+		<data format="html" name="statsFile" label="HTML statistics output"/>
+		<data format="txt" name="log" label="Log file"/>
+	</outputs>
+
+	<help>
+
+
+
+
+
+.. class:: infomark
+
+**Program encapsulated in Galaxy by Southgreen**
+
+.. class:: infomark
+
+**SnpEff version 4.0**
+
+-----
+
+==============
+ Please cite:
+==============
+
+"A program for annotating and predicting the effects of single nucleotide polymorphisms, SnpEff: SNPs in the genome of Drosophila melanogaster strain w1118; iso-2; iso-3.", **Cingolani P, Platts A, Wang le L, Coon M, Nguyen T, Wang L, Land SJ, Lu X, Ruden DM.**, Fly (Austin). 2012 Apr-Jun;6(2):80-92.
+
+-----
+
+===========
+ Overview:
+===========
+
+Genetic variant annotation and effect prediction toolbox. It annotates and predicts the effects of variants on genes (such as amino acid changes).
+
+-----
+
+For further informations, please visite the SnpEff_ website.
+
+
+.. _SnpEff: http://snpeff.sourceforge.net/
+        </help>
+
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool-data/tool_dependencies.xml	Mon Mar 23 05:17:19 2015 -0400
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<tool_dependency>
+    <package name="snpEff" version="4.0">
+        <repository name="package_snpeff_4_0" owner="iuc" changeset_revision="6bc55957927b" toolshed="http://toolshed.g2.bx.psu.edu" />
+    </package>
+</tool_dependency>