def main():
    genome_file = LocalFile( label = 'E. coli K12 DH10B genome', \
                             path  = SAMPLE_GENOME )
    genome_file.save()

    ## This gives a reference to the tool (which you probably don't want to modify.)
    prodigal = StandaloneTool.objects.get( name='Prodigal', version='2.60' )

    ## this should actually instantiate the entire flow and children, with blueprints
    #   never being seen by the user.
    ## All commands and subflows are instantiated and saved to the database, and the
    #  parent flow is returned.  This will almost never pass an is_ready() check since
    #  no required parameters have been set yet.
    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)
        
    output = command.get_param( name='-o' )
    print("{0} completed.  Output written to: {1}".format(command.name, output.value))
Example #2
0
def main():
    genome_file = LocalFile( label = 'E. coli K12 DH10B genome', \
                             path  = SAMPLE_GENOME )
    genome_file.save()

    ## This gives a reference to the tool (which you probably don't want to modify.)
    prodigal = StandaloneTool.objects.get( name='Prodigal', version='2.60' )

    ## this should actually instantiate the entire flow and children, with blueprints
    #   never being seen by the user.
    ## All commands and subflows are instantiated and saved to the database, and the
    #  parent flow is returned.  This will almost never pass an is_ready() check since
    #  no required parameters have been set yet.
    flow = prodigal.new_flow()

    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()
Example #3
0
def main():

    workspace = Workspace(name='Example tool discovery and diginorm')
    workspace.save()

    left_reads = LocalFile(label='Left sample reads', path=SAMPLE_LEFT_READS)
    left_reads.save()

    right_reads = LocalFile(label='Right sample reads',
                            path=SAMPLE_RIGHT_READS)
    right_reads.save()

    #workspace.add( left_reads, right_reads )
    workspace.add_data(left_reads)
    workspace.add_data(right_reads)

    tools_available = workspace.get_available_tools()

    for tool in tools_available:
        print("{0}".format(tool))
def main():

    workspace = Workspace( name = 'Example tool discovery and diginorm' )
    workspace.save()

    left_reads  = LocalFile( label = 'Left sample reads',  path = SAMPLE_LEFT_READS )
    left_reads.save()
    
    right_reads = LocalFile( label = 'Right sample reads', path = SAMPLE_RIGHT_READS )
    right_reads.save()

    #workspace.add( left_reads, right_reads )
    workspace.add_data( left_reads )
    workspace.add_data( right_reads )

    tools_available = workspace.get_available_tools()

    for tool in tools_available:
        print("{0}".format(tool))