changeset 6:3938f90c9d91 draft

planemo upload for repository https://github.com/zipho/novo_align commit 4a89d4d866533a93706ceb29077d2e9bda69aa9f
author sanbi-uwc
date Fri, 11 Mar 2016 02:32:25 -0500
parents d51c5af7a8fe
children b91ad2488816
files novo_align.py
diffstat 1 files changed, 4 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/novo_align.py	Fri Mar 11 02:02:09 2016 -0500
+++ b/novo_align.py	Fri Mar 11 02:32:25 2016 -0500
@@ -1,18 +1,12 @@
 #!/usr/bin/env python
-
 from __future__ import print_function
 import argparse
-from subprocess import check_call, CalledProcessError, Popen
 import shlex
 import os
 import logging
 log = logging.getLogger( __name__ )
 
 def novo_align(output_filename, index_filename, fwd_file, rev_file ):
-    #novoalign -c 8 -k -d /cip0/research/ajayi/RNA-seq_Analysis_Project_Case_Study/reference/Homo_Sapiens/out/TB_H37Rv.nix
-    #         -f X165_820L8_.R1_val_1.fq  X165_820L8_.R2_val_2.fq -i PE 250,100
-    #         -o SAM '@RG\tID:readgroup\tPU:platform unit\tLB:library' | samtools view -bS - > `pwd`/out/X165_820L8.bam
-    #output_filename = path.join(output_directory, fwd_file.split(".")[0] + ".bam")
     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,
@@ -20,13 +14,10 @@
         rev_file,
         param,
         output_filename)
-    #cmdline = newSplit(cmdline_str)
-
-    os.system(cmdline_str)
-    #try:
-    #check_call(cmdline)
-    #except CalledProcessError:
-    #    print("Error running the nova-align", file=sys.stderr)
+    try:
+        os.system(cmdline_str)
+    except:
+        print("Error running the nova-align", file=sys.stderr)
 
 def newSplit(value):
     lex = shlex.shlex(value)
@@ -45,7 +36,6 @@
    
     #a dirty way of referencing the file
     index_file_path = args.index_filename + "/" + args.index_filename.split("/")[-1]
-    
     novo_align(args.output_filename, index_file_path, args.forward_filename, args.reverse_filename)
 
 if __name__ == "__main__": main()