changeset 21:119cb8e503d0 draft

planemo upload for repository https://github.com/zipho/novo_align commit da14cd54b0606513434a6e5bf2ed2881ab2220ec
author sanbi-uwc
date Tue, 27 Jun 2017 10:18:49 -0400
parents 77814664cb3f
children 482aef16b6f5
files novo_align.py novo_align.xml
diffstat 2 files changed, 14 insertions(+), 60 deletions(-) [+]
line wrap: on
line diff
--- a/novo_align.py	Tue Jun 27 05:40:46 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-#!/usr/bin/env python
-from __future__ import print_function
-import argparse
-import shlex
-import os
-import sys
-import logging
-log = logging.getLogger( __name__ )
-
-
-def novo_align(output_filename, index_filename, fwd_file, rev_file ):
-    param = r'@RG\tID:RG\tSM:$i\tPL:ILLUMINA'
-    cmdline_str = "novoalign -c 8 -k -d {} -f {} {} -i PE 250, 100 -o SAM '{}' | samtools view -bS - > {}".format(
-        index_filename,
-        fwd_file,
-        rev_file,
-        param,
-        output_filename)
-    try:
-        os.system(cmdline_str)
-    except:
-        print("Error running the nova-align", file=sys.stderr)
-
-
-def newSplit(value):
-    lex = shlex.shlex(value)
-    lex.quotes = '"'
-    lex.whitespace_split = True
-    lex.commenters = ''
-    return list(lex)
-
-
-def main():
-    parser = argparse.ArgumentParser(description="Generate a BAM file from the Novo Align tool")
-    parser.add_argument('output_filename')
-    parser.add_argument('--index_filename')
-    parser.add_argument('--forward_filename')
-    parser.add_argument('--reverse_filename')
-    args = parser.parse_args()
-
-    # a dirty way of referencing the file
-    index_file_path = args.index_filename  # removed old logic here: + "/" + args.index_filename.split("/")[-1]
-    novo_align(args.output_filename, index_file_path, args.forward_filename, args.reverse_filename)
-
-
-if __name__ == "__main__":
-    main()
--- a/novo_align.xml	Tue Jun 27 05:40:46 2017 -0400
+++ b/novo_align.xml	Tue Jun 27 10:18:49 2017 -0400
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" ?>
-<tool id="novo_align" name="NOVO ALIGN" version="0.0.9">
+<tool id="novo_align" name="novoalign" version="0.0.10">
     <description>Tool to run the Novo Align mapping tool</description>
     <requirements>
         <requirement type="package" version="1.2">samtools</requirement>
@@ -42,35 +42,36 @@
           ln -s '${index.reference}' reference.fasta &&
           novoindex -m reference.nix reference.fasta &&
         #end if
-        python $__tool_directory__/novo_align.py
-            '${out_file}'
-            --index
+        novoalign -c \${GALAXY_SLOTS:-8} -k -d
             #if str($index.source) == 'builtin':
               '${index.index1.fields.path}'
             #else
               reference.nix
             #end if
+            -f 
             #if $paired_end.is_paired_end
                 #if $paired_input_type == "pair_of_files"
                     #if $paired_end.paired_input_type_conditional.fastq_r1_in.metadata.is_gzipped
-                        --forward_file ./input_mate1.gz
-                        --reverse_file ./input_mate2.gz
+                        ./input_mate1.gz
+                        ./input_mate2.gz
                     #else
-                        --forward_file ./input_mate1.$r1_ext
-                        --reverse_file ./input_mate2.$r2_ext
+                        ./input_mate1.$r1_ext
+                        ./input_mate2.$r2_ext
                     #end if
                 #else
                     #if $paired_end.paired_input_type_conditional.fastq_pair.forward.metadata.is_gzipped:
-                        --forward_file ./input_mate1.gz
-                        --reverse_file ./input_mate2.gz
+                        ./input_mate1.gz
+                        ./input_mate2.gz
                     #else
-                        --forward_file ./input_mate1.$r1_ext
-                        --reverse_file ./input_mate2.$r2_ext
+                        ./input_mate1.$r1_ext
+                        ./input_mate2.$r2_ext
                     #end if
                 #end if
             #else
-                --forward_file ${fastq_in}.${fastq_in.ext} --reverse_file ${fastq_in}.${fastq_in.ext}
+                '${fastq_in}.${fastq_in.ext}' '${fastq_in}.${fastq_in.ext}'
             #end if
+            -i PE 250, 100 
+            -o SAM '@RG\tID:RG\tSM:\$i\tPL:ILLUMINA' | samtools view -bS - | novosort -c \${GALAXY_SLOTS:-8} -m 8G -s -f - > '${out_file}' 
 
     ]]></command>
     <inputs>