示例#1
0
def main():

    queryfile_filestring = '/scratch/jamboree/fasta_split/hpd.fasta.*'

    pool = processor()
    pool.make_tasks(tasks, queryfile_filestring)
    consume(pool.run(run_blast))
示例#2
0
def main():
    global code, fasta_in, results_dir, nohoms, cleanup, frag_config

    # Create a parser, add options, parse options, and parse leftover required positional args.
    parser = OptionParser(usage=usage_str)
    set_options(parser)
    (options, args) = parser.parse_args()
    (code, fasta_in, results_dir) = parse_positional_args(args, parser)

    # Set config file, if specified.
    if options.config_file:
        frag_config = options.config_file

    # Set remaining globals
    nohoms = options.nohoms
    cleanup = options.cleanup

    # Create a processing pool (via hpf.processing) and make tasks to serve to the frag_driver.
    print "main:: Creating processor pool."
    pool = processor()
    print "main:: Serializing tasks based on input string: {0}.".format(
        fasta_in)
    pool.make_tasks(tasks, fasta_in)
    print "main:: Running tasks."
    consume(pool.run(frag_driver))
示例#3
0
def main():

    queryfile_filestring = '/scratch/jamboree/fasta_split/hpd.fasta.*'

    pool = processor()
    pool.make_tasks(tasks, queryfile_filestring)
    consume(pool.run(run_blast))
示例#4
0
文件: template.py 项目: bsmithers/hpf
def main(*args):
    # calls processor with a the keyword argument 'synchronous'. runtime() creates a new Runtime obj. or accesses
    # the existing runtime object, and .opt(SYNCHRONOUS) returns the value of the synchronous option of the Runtime
    # object. 
    # processor returns a Map, SGEArray, or PBSArrayProcessor object. NOTE: currently, PBSArrayProcessor is not fully implemented.
    pool = processor(synchronous=runtime().opt(SYNCHRONOUS))
    runtime().debug("Using processor",pool)
    pool.make_tasks(None)
    consume(pool.run(None))
示例#5
0
def main():
    # Simulated input string (dir containing fasta files).
    input_str="/Users/dpb/bonneau-dev/sandbox/frag-input/oi_test/*.fasta"

    # Create a processing pool (via hpf.processing) and make tasks to serve to the process function.
    pool = processor()
    
    # Input to make_tasks can be any number of arguments, as they are passed directly to the given function.
    pool.make_tasks(tasks, input_str)
    consume(pool.run(process))
示例#6
0
def main(*args):
    pool = processor(synchronous=runtime().opt(SYNCHRONOUS))
    runtime().debug("Using processor", pool)
    pool.make_tasks(lambda: zip(
        args,
        #                                [args[i] for i in range(0,len(args),2)],
        #                                [args[i] for i in range(1,len(args),2)],
        repeat(runtime().opt(MAX_SIZE), len(args)),
        repeat(runtime().opt(NEXUS), len(args)),
        repeat(runtime().opt(DIRECTORY), len(args))))
    consume(pool.run(_split))
示例#7
0
def main(*args):
    pool = processor(synchronous=runtime().opt(SYNCHRONOUS))
    runtime().debug("Using processor",pool)
    pool.make_tasks(lambda: zip(args,
#                                [args[i] for i in range(0,len(args),2)],
#                                [args[i] for i in range(1,len(args),2)],
                                repeat(runtime().opt(MAX_SIZE),len(args)),
                                repeat(runtime().opt(NEXUS),len(args)),
                                repeat(runtime().opt(DIRECTORY),len(args))
                                ))
    consume(pool.run(_split))
示例#8
0
def main():
    # TODO: make a pfam flag commandline argument
    # TODO: make output dir a commandline argument
    # TODO: make experiment a commandline argument
    experiment_id = 1171

    print "Interpro driver:: Creating processor pool, no SYNCHRONOUS option"
    pool = processor()
    pool.make_tasks(tasks, experiment_id)
    print "Running tasks..."
    #consume(pool.run(interpro_driver))
    consume(pool.run(pfam_driver))
示例#9
0
 def blast(self,fasta,output):
     """
     Blast the fasta, consume the output buffer, return the output filename
     """
     runtime().debug("Blasting %s with alignment %s using %s" %(fasta, self.alignment,self.blast_exe))
     r,e = NCBIStandalone.blastpgp(self.blast_exe, 
                                   self.db,
                                   fasta,
                                   align_infile=self.alignment,
                                   align_outfile=output,
                                   expectation=self.expect, 
                                   model_threshold=self.expect,
                                   npasses=3,
                                   nprocessors=1,
                                   **self.kwargs)
     consume(r)
     return output
示例#10
0
 def blast(self, fasta, output):
     """
     Blast the fasta, consume the output buffer, return the output filename
     """
     runtime().debug("Blasting %s with alignment %s using %s" %
                     (fasta, self.alignment, self.blast_exe))
     r, e = NCBIStandalone.blastpgp(self.blast_exe,
                                    self.db,
                                    fasta,
                                    align_infile=self.alignment,
                                    align_outfile=output,
                                    expectation=self.expect,
                                    model_threshold=self.expect,
                                    npasses=3,
                                    nprocessors=1,
                                    **self.kwargs)
     consume(r)
     return output
示例#11
0
def main():
    global code, fasta_in, results_dir, nohoms, cleanup, frag_config

    # Create a parser, add options, parse options, and parse leftover required positional args.
    parser = OptionParser(usage=usage_str)
    set_options(parser)
    (options, args) = parser.parse_args()
    (code, fasta_in, results_dir) = parse_positional_args(args, parser)
    
    # Set config file, if specified.
    if options.config_file:
        frag_config = options.config_file
    
    # Set remaining globals
    nohoms = options.nohoms
    cleanup = options.cleanup
    
    # Create a processing pool (via hpf.processing) and make tasks to serve to the frag_driver.
    print "main:: Creating processor pool."
    pool = processor()
    print "main:: Serializing tasks based on input string: {0}.".format(fasta_in)
    pool.make_tasks(tasks, fasta_in)
    print "main:: Running tasks."
    consume(pool.run(frag_driver))
示例#12
0
def main(fam, t, *files):
    global family, tree, session
    session = Session()
    family = int(fam)
    tree = int(t)

    for file in files:
        # runtime().set_debug(1)
        runtime().debug("Using file", file)
        with open(file) as handle:
            ps = PositiveSelectionParser().parse(handle)
        count = consume(imap(merge, ps))
        runtime().debug("Found", count, "sites")

    session.commit()
    session.close()
示例#13
0
def main(fam, t, *files):
    global family, tree, session
    session = Session()
    family = int(fam)
    tree = int(t)

    for file in files:
        #runtime().set_debug(1)
        runtime().debug("Using file", file)
        with open(file) as handle:
            ps = PositiveSelectionParser().parse(handle)
        count = consume(imap(merge, ps))
        runtime().debug("Found", count, "sites")

    session.commit()
    session.close()
示例#14
0
文件: remcm.py 项目: bsmithers/hpf
def main(*args):
    pool = processor(synchronous=runtime().opt(SYNCHRONOUS))
    runtime().debug("Using processor",pool)
    pool.make_tasks(None)
    consume(pool.run(remcm))
示例#15
0
def main(*args):
    pool = processor(synchronous=runtime().opt(SYNCHRONOUS))
    runtime().debug("Using processor", pool)
    pool.make_tasks(lambda: args)
    consume(pool.run(_blast))
示例#16
0
def main(*args):
    # Clear the db mappings, to use one engine per subprocess
    pool = processor(synchronous=runtime().opt(SYNCHRONOUS))
    runtime().debug("Using processor",pool)
    pool.make_tasks(lambda: args)
    consume(pool.run(_import_family))
示例#17
0
def main():
    # TODO: Create a parser for cmdline options
    # Create a processing pool (via hpf.processing) and make tasks to serve to the cluster_driver
    pool = processor()
    pool.make_tasks(tasks)
    consume(pool.run(cluster_driver))
示例#18
0
def main():
    print "Struct all-v-all main"
    pool = processor()
    pool.make_tasks(tasks, query_struct_pkl, num_pieces)
    consume(pool.run(do_allvall))
示例#19
0
文件: mcm.py 项目: bsmithers/hpf
def main(*args):
    pool = processor()
    runtime().debug("Using processor",pool)
    pool.make_tasks(tasks,*args)
    consume(pool.run(_mcm))
示例#20
0
def main(*args):
    pool = processor(synchronous=runtime().opt(SYNCHRONOUS))
    runtime().debug("Using processor",pool)
    pool.make_tasks(lambda: [(fasta, runtime().opt(PARTS)) for fasta in args])
    consume(pool.run(lambda args: split(*args)))
示例#21
0
def main(*args):
    # Clear the db mappings, to use one engine per subprocess
    pool = processor(synchronous=runtime().opt(SYNCHRONOUS))
    runtime().debug("Using processor", pool)
    pool.make_tasks(lambda: args)
    consume(pool.run(_import_family))
示例#22
0
def main(*args):
    pool = processor(synchronous=runtime().opt(SYNCHRONOUS))
    runtime().debug("Using processor",pool)
    pool.make_tasks(lambda: args)
    consume(pool.run(_blast))
示例#23
0
def main(*args):
    pool = processor(synchronous=runtime().opt(SYNCHRONOUS),processors=runtime().opt(PROCESSORS))
    runtime().debug("Using processor",pool)
    pool.make_tasks(tasks)
    consume(pool.run(_publications,result=upload))
示例#24
0
def main():
    global query_struct_pkl, num_pieces

    pool = processor()
    pool.make_tasks(tasks, query_struct_pkl, num_pieces)
    consume(pool.run(do_allvall))