changeset 17:2779d6b74419 draft

Uploaded
author malbuquerque
date Tue, 20 Jan 2015 17:29:31 -0500
parents b0c2893ac2a1
children e2aa171ee8eb
files Makefile delly.xml tool_dependencies.xml
diffstat 3 files changed, 204 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile	Tue Jan 20 17:29:31 2015 -0500
@@ -0,0 +1,58 @@
+DEBUG ?= 0
+PARALLEL ?= 0
+
+# External Libraries
+BOOST_ROOT ?= /g/solexa/bin/software/boost_1_53_0/
+BAMTOOLS_ROOT ?= /g/solexa/bin/software/bamtools-2.3.0/
+SEQTK_ROOT ?= /g/solexa/bin/software/kseq/
+
+# Flags
+CXX=g++
+CXXFLAGS += -isystem ${BOOST_ROOT}/include -isystem ${BAMTOOLS_ROOT}/include -isystem ${SEQTK_ROOT} -pedantic -W -Wall -Wno-unknown-pragmas
+LDFLAGS += -L${BOOST_ROOT}/lib -lboost_iostreams -lboost_filesystem -lboost_system -lboost_program_options -lboost_date_time -L${BAMTOOLS_ROOT}/lib -lbamtools -lz -Wl,-rpath,${BAMTOOLS_ROOT}/lib,-rpath,${BOOST_ROOT}/lib
+
+# Additional flags for release/debug
+ifeq (${PARALLEL}, 1)
+	CXXFLAGS += -fopenmp -DOPENMP
+else
+	CXXFLAGS += -DNOPENMP
+endif
+
+# Additional flags for release/debug
+ifeq (${DEBUG}, 1)
+	CXXFLAGS += -g -O0 -fno-inline -DDEBUG
+else ifeq (${DEBUG}, 2)
+	CXXFLAGS += -g -O0 -fno-inline -DPROFILE
+	LDFLAGS += -lprofiler -ltcmalloc
+else
+	CXXFLAGS += -O9 -DNDEBUG
+	#LDFLAGS += --static
+endif
+
+# External sources
+HTSLIBSOURCES = $(wildcard src/htslib/*.c) $(wildcard src/htslib/*.h)
+BAMTOOLSSOURCES = $(wildcard src/bamtools/src/api/*.h) $(wildcard src/bamtools/src/api/*.cpp)
+DELLYSOURCES = $(wildcard src/*.h) $(wildcard src/*.cpp)
+
+# Targets
+TARGETS = src/delly src/extract src/cov src/iover src/stats
+
+all: $(TARGETS)
+
+src/delly: $(DELLYSOURCES)
+	$(CXX) $(CXXFLAGS) $@.cpp -o $@ $(LDFLAGS)
+
+src/extract: $(DELLYSOURCES)
+	$(CXX) $(CXXFLAGS) $@.cpp -o $@ $(LDFLAGS)
+
+src/cov: $(DELLYSOURCES)
+	$(CXX) $(CXXFLAGS) $@.cpp -o $@ $(LDFLAGS)
+
+src/iover: $(DELLYSOURCES)
+	$(CXX) $(CXXFLAGS) $@.cpp -o $@ $(LDFLAGS)
+
+src/stats: $(DELLYSOURCES)
+	$(CXX) $(CXXFLAGS) $@.cpp -o $@ $(LDFLAGS)
+
+clean:
+	rm -f $(TARGETS) $(TARGETS:=.o) 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/delly.xml	Tue Jan 20 17:29:31 2015 -0500
@@ -0,0 +1,106 @@
+<tool id="delly" name="DELLY" version="0.6.1">
+
+	<description>structural variant discovery by integrated paired-end and split-read analysis</description>
+
+	<requirements>
+		<requirement type="package" version="0.6.1">delly</requirement>
+		<requirement type="set_environment">DELLY_DIR</requirement>
+	</requirements>
+
+
+	<command> 
+
+		<!-- BAM and BAI linking, (1) link BAM to new BAM file & (2) link BAM metadata to new BAI file -->
+		#for $i, $s in enumerate( $repeatBam )
+			ln -s $s.sortedBam ./input$(i).bam;
+			ln -s $s.sortedBam.metadata.bam_index ./input$(i).bam.bai;
+		#end for		
+
+		<!-- Sets args to a list of types selected -->
+		#if not isinstance( $type.value, list ):
+			#set $args = [ $type.value ]
+		#else:
+			#set $args = $type.value
+		#end if
+
+		<!-- Run Delly Jobs for each type selected -->
+		#for $option in $args
+			<!-- NEED TO FIX -->
+			<!-- Delly should be automatically installed into the galaxy instance and should not be running off 
+					 the computers specific tool set -->
+			\$DELLY_DIR/src/delly -t $option -o ./output.$(option).vcf -q $mapQual -s $madCutoff 
+			#if $option == "DEL" 
+			-m $minFlank 
+			#end if 
+			-u $genoQual -v $vcfgeno -g $genome
+			
+			<!-- add each input bam to command -->
+			#for $i, $s in enumerate( $repeatBam )
+				./input$(i).bam	
+			#end for
+			;
+  	#end for
+
+		<!-- Combine VCF Files and Sort Lexographically -->
+		#set $option = $args[0]
+		grep ^\# output.$(option).vcf > $outfile;
+		grep ^\# -v output.$(option).vcf > variants.txt;
+		
+		<!-- If we called more than a single variant type, concatenate all the other types variant output -->
+		#if isinstance( $type.value, list ):
+			#for $option in $args[1:]
+				grep ^\# -v output.$(option).vcf >> variants.txt;
+			#end for
+		#end if
+		
+		<!-- Sort all variant output, assuming that it will sort lexographically by chromosome, then position, ID  -->
+		<!-- In future, maybe develop a script to sort by bam header -->
+		sort -k1,1d -k2,2n -k3,3d variants.txt > sortedVariants.txt;
+		
+		<!-- Filter Variants that have Passed Quality Checks -->
+		#if $filterCalls
+			awk '{if ($7 == "PASS") print $0;}' sortedVariants.txt >> $outfile;
+		#else
+			cat sortedVariants.txt >> $outfile;
+		#end if
+		
+	</command>
+ 
+	<inputs>
+		
+		<!-- General Options -->
+		<param name="type" type="select" multiple="true" display="checkboxes" label="Variant Types">
+			<option value="DEL" selected="true">Deletions</option>
+			<option value="DUP" selected="true">Tandem Duplications</option>
+			<option value="INV" selected="true">Inversions</option>
+			<option value="TRA" selected="true">Translocations</option>
+		</param>
+		<repeat name="repeatBam" title="Bam Alignment" min="1" default="1" >	
+			<param format="bam" name="sortedBam" type="data" label="File" />		
+		</repeat>
+		<param name="excludeFile" type="data" optional="true" label="Chromosomes to Exclude"/> 
+		<param name="filterCalls" type="boolean" value="false" label="Filter Poor Variant Calls"/>
+		
+		<!-- Paired End Options -->
+		<param name="mapQual" type="integer" value="0" min="0" max="255" label="PE - Minimum Mapping Quality" />
+		<param name="madCutoff" type="integer" value="9" min="0" max="255" label="PE - Insert Size Cutoff" />		
+
+		<!-- SR Options -->
+		<param format="fasta" name="genome" type="data" optional="true" label="SR - Genome Fasta File" />
+		<param name="minFlank" type="integer" value="13" label="SR - Minimum Flanking Sequence" />
+
+		<!-- Genotyping Options -->
+		<param format="vcf" name="vcfgeno" type="data" optional="true" label="GT - Input VCF" />
+		<param name="genoQual" type="integer" value="20" min="0" max="255" label="GT - Minimum Mapping Quality" />
+
+	</inputs>
+  
+	<outputs>
+		<data format="vcf" name="outfile" />
+	</outputs>
+  
+	<help>
+
+	</help>
+
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_dependencies.xml	Tue Jan 20 17:29:31 2015 -0500
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+<tool_dependency>
+		
+		<package name="boost" version="1.53.0">
+			<repository changeset_revision="cee17eb9de41" name="package_boost_1_53" owner="iuc" prior_installation_required="True" toolshed="https://toolshed.g2.bx.psu.edu" />
+		</package>
+
+		<package name="bamtools" version="2.3.0">
+			<repository changeset_revision="ad46b5210186" name="package_bamtools_2_3_0" owner="malbuquerque" prior_installation_required="True" toolshed="https://toolshed.g2.bx.psu.edu" />
+		</package>
+
+		<package name="seqtk" version="1.0.0">
+			<repository changeset_revision="35f0f4568ded" name="package_seqtk_1_0_0" owner="malbuquerque" prior_installation_required="True" toolshed="https://toolshed.g2.bx.psu.edu" />
+		</package>
+			
+		<package name="delly" version="0.6.1">
+			<install version="1.0">
+				<actions>
+					<action type="download_by_url">https://github.com/tobiasrausch/delly/archive/v0.6.1.tar.gz</action>
+					<action type="move_file">
+						<source>Makefile</source>
+						<destination>badbadbad</destination>
+					</action>
+					<action type="move_file">
+						<source>$REPOSITORY_INSTALL_DIR/Makefile</source>
+						<destination>.</destination>
+					</action>
+					<action type="shell_command">make all BOOST_ROOT=\$BOOST_ROOT BAMTOOLS_ROOT=\$BAMTOOLS_ROOT SEQTK_ROOT=\$SEQTK_ROOT</action>
+					<action type="move_directory_files">
+						<source_directory>.</source_directory>
+						<destination_directory>$INSTALL_DIR</destination_directory>
+					</action>	
+					<action type="set_environment">
+						<environment_variable action="set_to" name="DELLY_DIR">$INSTALL_DIR</environment_variable>
+					</action>
+				</actions>
+			</install>
+		</package>
+
+	</tool_dependency>