Esempio n. 1
0
    def test_run(self) :		
        command = load_command_class('biotools', 'load_geneid__1_4')
        command.handle()

        biotools_settings = configparser.ConfigParser()
        biotools_settings.read( os.path.join( os.path.abspath(os.path.dirname(__file__)), '../settings.ini') )

        genome_file = LocalFile( label = 'C. cerevisiae S288C genome', \
                                 path  = "{0}/Saccharomyces_cerevisiae_S288C/Saccharomyces_cerevisiae_S288C.genomic.fna".format(settings.EMERGENCE_EXAMPLE_DATA_ROOT) )
        genome_file.save()

        geneid = StandaloneTool.objects.get( name='geneid', version='1.4' )
        flow = geneid.new_flow()
        flow.save()

        command = flow.get_command(name='Run geneid')
        command.set_param(name='<sequence_filename>', val=genome_file.path)
        command.stdout = '/tmp/geneid.test.out'

        geneid_settings = biotools_settings[ "geneid 1.4" ]
        command.set_param(name='-P', val=geneid_settings['test_param_file'] )

        flow.run()

        while flow.is_executing():
            flow = Flow.objects.get(id=flow.id)
            print("Gene prediction state is: {0}".format(flow.get_state_display()) )
            sleep(1)

            self.assertEqual(format(flow.get_state_display()) , 'complete')
Esempio n. 2
0
    def test_run(self) :		
        command = load_command_class('biotools', 'load_prodigal__2_60')
        command.handle()

        genome_file = LocalFile( label = 'E. coli K12 DH10B genome', \
                                 path  = "{0}/Escherichia_coli_K12_DH10B/e_coli_k12_dh10b.fna".format(settings.EMERGENCE_EXAMPLE_DATA_ROOT) )
        genome_file.save()

        prodigal = StandaloneTool.objects.get( name='Prodigal', version='2.60' )
        flow = prodigal.new_flow()
        flow.save()

        command = flow.get_command(name='Run prodigal')
        command.set_param(name='-i', val=genome_file.path)
        command.set_param(name='-o', val='/tmp/prodigal.test.out' )
        command.set_param(name='-g', val='10' )

        flow.run()

        while flow.is_executing():
            flow = Flow.objects.get(id=flow.id)
            print("Gene prediction state is: {0}".format(flow.get_state_display()) )
            sleep(1)

            self.assertEqual(format(flow.get_state_display()) , 'complete')
    def test_run(self) :
        # Load dependent tools.  This is only needed because Django creates a new database for each test
        for tool_name in ( 'load_nucmer__3_23', 'load_show_coords__3_23', 'load_nucmer_genome_coverage__1_0' ):
            command = load_command_class('emergence.apps.biotools', tool_name)
            command.handle()

        print("INFO: Loading E. coli K12")
        k12_genome_file = LocalFile( label = 'E. coli K12 DH10B genome', \
                                     path  = "{0}/Escherichia_coli_K12_DH10B/e_coli_k12_dh10b.fna".format(settings.EMERGENCE_EXAMPLE_DATA_ROOT) )
        k12_genome_file.save()

        print("INFO: Loading E. coli O157 H7")
        o157_genome_file = LocalFile( label = 'E. coli K12 DH10B genome', \
                                      path  = "{0}/Escherichia_coli_O157_H7_1044/NZ_AERP00000000.scaffolds.fna".format(settings.EMERGENCE_EXAMPLE_DATA_ROOT) )
        o157_genome_file.save()
	
        genome_cov = StandaloneTool.objects.get( name='NUCmer genome coverage', version='1.0' )

        ## this results in a built Flow
        flow = genome_cov.new_flow()
        flow.save()

        print("DEBUG: Flow that was just built:")
        for thing in flow.get_children():
            print("step: {0}".format(thing))
        
        nucmer_command = flow.get_command(name='Run NUCmer')
        print("DEBUG: TESTING: Within the test, flow.get_command() for nucmer returned this exec string: {0}".format(nucmer_command.exec_string))
        nucmer_command.set_param(name='<reference_in>', val=k12_genome_file.path)
        nucmer_command.set_param(name='<query_in>', val=o157_genome_file.path)

        #sc_command = flow.get_command(name='Run show-coords')
        # THIS NEEDS TO BE SET TO THE CWD/out.delta but we don't know the CWD at build time.  Issue.
        #sc_command.set_param(name='<deltafile>', val=nuc )
        flow.run()