Example #1
0
 def test_step_scripts(self):
     script_file=os.path.join(RnaseqGlobals.root_dir(),'t/fixtures/sh_scripts/cufflinks.sh')
     expected=fragment_script(script_file)
     
     for step in self.pipeline.steps:
         if step.name=='header': continue
         step_script=step.sh_script(self.pipeline.context, echo_name=True).strip()
         
         fd=first_diff(step_script, expected[step.name])
         if fd >= 0:
             print "%s: first diff at %d" % (step.name, fd)
             (d1,d2)=diff_strs(step_script, expected[step.name])
             print "%s diff:\ngenerated: %s\nexpected:  %s" % (step.name, d1, d2)
         self.assertEqual(step_script, expected[step.name])
Example #2
0
    def test_sh_cmd(self):
        step=self.pipeline.step_with_name('remove_erccs')
        self.assertNotEqual(step, None)


        try:
            script=step.sh_script(self.pipeline.context)
        except Exception as e:
            print "test_align_filter: caught %s (%s)" % (e, type(e))
            self.fail()

        expected='''

export BOWTIE_INDEXES=/proj/hoodlab/share/programs/RNAseq-Pi/data/bowtie-indexes
bowtie ERCC_reference_081215 -1 ${ID}_1.${format} -2 ${ID}_2.${format} --quiet -p 4 -S --sam-nohead -k 1 -v 2 -q | perl -lane 'print unless($F[1] == 4)' > ${ID}.remove_erccs_BAD.${format}
'''
        fd=first_diff(script, expected)
        if fd >= 0:
            print "%s: first diff at %d" % (step.name, fd)
            (d1,d2)=diff_strs(script, expected)
            print "%s diff:\ngenerated: %s\nexpected:  %s" % (step.name, d1, d2)

        self.assertEqual(script,expected)