コード例 #1
0
ファイル: day1.py プロジェクト: bh0085/compbio
def remote_batch_1d(run_id):
    '''
Remote job mothership for a single run that will generate
a bunch of bsub commands to run a series of RNAz checks
along the gene of interest.

inputs:
  run_id

output:
  the datapath (same for local and remote) of data output each thread
'''

    #GENERIC SETUP FOR A BSUBBED TASKMGR.
    #Takes an input in the form of a list of param-dicts.
    #
    inp_dicts = butils.load_data(run_id, 'input')    
    #DO EVERYTHING TWIXT --------------------------------[HERE]


    eyeball = bsub.eyeball(run_id,
                           os.path.abspath(inspect.stack()[0][1]), inp_dicts,
                           func = 'remote_run_1d',
                           name = run_id+'_eye', 
                           mem = 2)
                          
    eyeball.launch()
    eyeball.await()
    eyeball.package()
    eyeball.complete()
    out = {'result':eyeball.statii()}

    #AND ------------------------------------------------[HERE]
    butils.save_data(out,
                     run_id,'output')
コード例 #2
0
ファイル: day1.py プロジェクト: bh0085/compbio
def remote_run_1d(run_id):
    '''
    

'''

    #GENERIC SETUP FOR A SINGLE BSUBBED PROCESS.
    #Takes an input saved as a single dictionary.
    #
    p = butils.load_data(run_id, 'input')    
    #DO EVERYTHING TWIXT --------------------------------[HERE]
    

    baserng = p['baserng']
    win_len = p['win_len']
    win_ofs = p['win_ofs']
    spec_count = p['spec_count']
    

    bases = (128693265,129266680)
    a0 = day0.fetch_num_ali()
    names = day0.fetch_alinames()
    
    ref = a0[0]
    ali_counts = sum(less(a0,4) * equal(a0, a0[0,:]) ,1)
    names_all = [names[i]  for i in argsort(ali_counts)[::-1]]
    names = names_all[:spec_count]
    a0 = a0[argsort(ali_counts)[::-1]][:spec_count]
    ali_counts = sorted(ali_counts)[::-1][:spec_count]
    
    locii, results = day0.run_windows(a0,ref, n_specs = spec_count,
                                      win_len = win_len, win_ofs = win_ofs,
                                      spec_names = names,
                                      baserng = baserng)

    out = {'locii':locii,
           'results':results}

    #AND ------------------------------------------------[HERE]
    butils.save_data(out, 
                     run_id,'output')