ruffus test script not running

13 views
Skip to first unread message

archana bhardwaj

unread,
Aug 25, 2017, 4:59:44 AM8/25/17
to ruffus_discuss
Hello ,

I am new to python as well as ruffus. I like working on python and recently developed few scripts for NGS analysis.  But for ruffus detail, I am trying to run simple code for ruffus test run. But I am getting error

Traceback (most recent call last):
  File "ruffus-ff.py", line 4, in <module>
    from ruffus import *
  File "ruffus-test.py", line 12, in <module>
NameError: name 'transform' is not defined



Here is code that I am running


starting_files = "Sample-run2.sam"

from ruffus import *

@transform(starting_files,suffix(".sam"),".bam")                           
def compress_sam_file(input_file,output_file):

    os.system("java -jar picard.jar SortSam INPUT=%s OUTPUT=%s SORT_ORDER=coordinate" % (input_file,output_file))

    ii = open(input_file)
    oo = open(output_file, "w")

@transform(compress_sam_file,                  # Input = previous stage
            suffix(".bam"),                    #         suffix = .bam
            ".bai")                 # Output  suffix = .statistics)                # Extra statistics parameter
def summarise_bam_file(input_file,output_file):
   
    os.system("samtools index %s" % (input_file,output_file))
   
    ii = open(input_file)
    oo = open(output_file, "w")


pipeline_run()


please correct me If I am doing anything wrong.

Thank you in advance






archana bhardwaj

unread,
Aug 25, 2017, 9:52:00 AM8/25/17
to ruffus_discuss
Its solved. Now I can work on ruffus easily.
Reply all
Reply to author
Forward
0 new messages