changeset 0:131c36a303ee

Imported from capsule None
author cmonjeau
date Fri, 05 Jun 2015 11:40:36 -0400
parents
children 496a2e67e5f7
files kissplice.xml kisspliceGWrapper.py tool_dependencies.xml
diffstat 3 files changed, 148 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kissplice.xml	Fri Jun 05 11:40:36 2015 -0400
@@ -0,0 +1,67 @@
+<tool id="KisSplice" name="KisSplice" version="2.1">
+  <description>A local transcriptome assembler for SNPs, indels and AS events
+  </description>
+  <requirements>
+    <requirement type="package" version="2.2.1">kissplice</requirement>
+  </requirements>
+  <command interpreter="python">kisspliceGWrapper.py $output1 $type0 $type1 $type2 $type3 $type4 $kmer $smallc $bigc $output_context $counts 
+  #for $r in $reads
+  ${r.input}
+  ${r.input.extension}
+  #end for 
+  </command>
+  <inputs>
+    <repeat name="reads" title="Input read file" min="1">
+    <param format="fasta,fastq" name="input" type="data" label="(fasta/q format)">
+    </param>
+    </repeat>
+    <param name="kmer" type="text" value="41">
+      <label>K-mer length</label>
+    </param>
+    <param name="smallc" type="text" value="2">
+      <label>K-mers present strictly less than this number of times in the dataset will be discarded (integer value required)</label>
+    </param>
+    <param name="bigc" type="text" value="0.02">
+      <label>Edges with relative coverage below this number are removed (value in [0,1) required) </label>
+    </param>
+    <param name="output_context" type="select">
+      <label>
+	Output the maximum non-ambiguous context of each event
+      </label>
+      <option value="no">No</option>
+      <option value="yes">Yes</option>
+    </param>
+    <param name="counts" type="select">
+      <label>Selecting how the counts will be reported</label>
+      <option value="0">Total counts</option>
+      <option value="1">Counts on junctions</option>
+      <option value="2">All counts</option>
+    </param>
+  </inputs>
+  <outputs>
+    <data name="output1" format="txt" label="KisSplice logfile" />
+    <data name="type0" format="fasta" label="SNPs or sequencing errors" />
+    <data name="type1" format="fasta" label="Alternative splicing events" />
+    <data name="type2" format="fasta" label="Inexact tandem repeats" />
+    <data name="type3" format="fasta" label="Short indels" />
+    <data name="type4" format="fasta" label="Other events" />
+  </outputs>
+  
+  <help>
+**Website**
+
+References, documentation and FAQ here_.
+    
+.. _here: http://kissplice.prabi.fr/
+    
+------
+    
+**Description**
+
+KisSplice is a piece of software that enables the **analysis of RNA-seq data with or without a reference genome**. It is an exact local transcriptome assembler that allows one to identify **SNPs, indels and alternative splicing events**. It can deal with an arbitrary number of biological conditions, and will quantify each variant in each condition. It has been tested on Illumina datasets of up to 1G reads. Its memory consumption is around 5Gb for 100M reads.
+
+KisSplice is not a full-length transcriptome assembler. This means that it will output the variable regions of the transcripts, not reconstruct them entirely. However, KisSplice results can be further aligned to a reference transcriptome (if available), or to the output of a full-length transcriptome assembler like Trinity or Oases.
+  </help>
+</tool>
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kisspliceGWrapper.py	Fri Jun 05 11:40:36 2015 -0400
@@ -0,0 +1,75 @@
+import subprocess, os, sys, shutil, tempfile, os.path
+from os.path import basename, splitext
+
+## inputs
+kmer_value = sys.argv[7]
+smallc_value = sys.argv[8]
+bigc_value = sys.argv[9]
+output_contex_value = sys.argv[10]
+counts_value = sys.argv[11]
+input_dat = sys.argv[12:len(sys.argv):2] # contains filename1... filenameq
+input_ext = sys.argv[13:len(sys.argv):2] # contains extension1... extensionq
+
+## tmp directory
+tmp_dir = tempfile.mkdtemp(prefix='kissplice-galaxy.')
+
+## command line (init)
+command_line = []
+command_line.append("kissplice")
+
+## symlink for .fasta/q (extension required)
+## command line built with -r option
+identifier = ""
+for i in range(0,len(input_dat)):
+	tmp_input_fasta =  os.path.join(tmp_dir, 'input'+str(i)+'.'+input_ext[i])
+	identifier += 'input'+str(i)+'_'
+	os.symlink(input_dat[i], tmp_input_fasta)
+	command_line.append("-r")
+	command_line.append(tmp_input_fasta)
+
+## command line (end)
+opath=tmp_dir+"/results"
+nocontext = ""
+nosnp = ""
+if output_contex_value == "yes":
+	command_line.extend(["-k", kmer_value, 
+			     "-c", smallc_value, "-C", bigc_value,
+			     "--counts", counts_value, "--output-context",
+			     "-o", opath, "-s"])
+else:
+	command_line.extend(["-k", kmer_value, 
+			     "-c", smallc_value, "-C", bigc_value,
+			     "--counts", counts_value,
+			     "-o", opath, "-s"])
+
+## running kissplice
+p=subprocess.Popen(command_line, 
+		   stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+stdoutput = p.communicate()
+
+## outputs
+output_f1=sys.argv[1]
+out1=open(output_f1, 'w' )
+out1.write(stdoutput[0])
+out1.close()
+
+output_type0=sys.argv[2]
+output_type1=sys.argv[3]
+output_type2=sys.argv[4]
+output_type3=sys.argv[5]
+output_type4=sys.argv[6]
+
+result_type0 = opath+"/"+"results_"+identifier+"k"+kmer_value+"_coherents_type_0.fa"
+result_type1 = opath+"/"+"results_"+identifier+"k"+kmer_value+"_coherents_type_1.fa"
+result_type2 = opath+"/"+"results_"+identifier+"k"+kmer_value+"_coherents_type_2.fa"
+result_type3 = opath+"/"+"results_"+identifier+"k"+kmer_value+"_coherents_type_3.fa"
+result_type4 = opath+"/"+"results_"+identifier+"k"+kmer_value+"_coherents_type_4.fa"
+
+shutil.move(result_type0, output_type0)
+shutil.move(result_type1, output_type1)
+shutil.move(result_type2, output_type2)
+shutil.move(result_type3, output_type3)
+shutil.move(result_type4, output_type4)
+
+## cleaning
+shutil.rmtree(tmp_dir)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_dependencies.xml	Fri Jun 05 11:40:36 2015 -0400
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<tool_dependency>
+  <package name="kissplice" version="2.2.1">
+      <repository changeset_revision="9cf0b87d7b6d" name="package_kissplice" owner="cmonjeau" toolshed="https://toolshed.g2.bx.psu.edu" />
+    </package>
+</tool_dependency>