Esempio n. 1
0
def from_transcript(transcript, params):
    """It does workflow for creating sh-miR from transcript

    Args:
        transcript: name of NCBI transcript
        params: dict with optional arguments:
            * min_gc -- Minimal "GC" content in strand
                default: 40
            * max_gc -- Maximal "GC" content in strand
                default: 60
            * max_offtarget -- Maximal offtarget in strand
                default: 10
            * mirna_name -- The name of miRNA backbone to use
                default: 'all'
            * stymulators -- one of "yes", "no", "no_difference"
                default: 'no_difference'

    Returns:
        None
    """
    return wait_until_task(
        creator("from_transcript_create", transcript,
                params=params), lambda task_id, **kwargs: checker(
                    "from_transcript_check", task_id, **kwargs),
        from_transcript_result)
Esempio n. 2
0
def from_transcript(transcript, params):
    """It does workflow for creating sh-miR from transcript

    Args:
        transcript: name of NCBI transcript
        params: dict with optional arguments:
            * min_gc -- Minimal "GC" content in strand
                default: 40
            * max_gc -- Maximal "GC" content in strand
                default: 60
            * max_offtarget -- Maximal offtarget in strand
                default: 10
            * mirna_name -- The name of miRNA backbone to use
                default: 'all'
            * immuno -- one of "yes", "no", "no_difference"
                default: 'no_difference'

    Returns:
        None
    """
    return wait_until_task(
        creator("from_transcript_create", transcript, params=params),
        lambda task_id, **kwargs: checker("from_transcript_check", task_id, **kwargs),
        from_transcript_result,
    )
Esempio n. 3
0
def mfold(sequence):
    """It does all workflow for mfold task
        * creates task
        * wait until it's done
        * gets result(s)

    Args:
        sequence: Sequence which we would like to fold via mfold

    Returns:
        None
    """
    return wait_until_task(
        creator("mfold_create", sequence),
        lambda task_id, **kwargs: checker("mfold_check", task_id, **kwargs),
        mfold_result)
Esempio n. 4
0
def from_sirna(sequences):
    """It does workflow for creating sh-miR from siRNA sequence(s)
        * creates task
        * wait until it's done
        * gets result(s)

    Args:
        sequences: one siRNA strand (active) or two siRNA strands separated by space.
            First strand is active, both are in 5-3 orientation.

    Returns:
        None
    """
    return wait_until_task(
        creator("from_sirna_create",
                sequences), lambda task_id, **kwargs: checker(
                    "from_sirna_check", task_id, **kwargs), from_sirna_result)
Esempio n. 5
0
def mfold(sequence):
    """It does all workflow for mfold task
        * creates task
        * wait until it's done
        * gets result(s)

    Args:
        sequence: Sequence which we would like to fold via mfold

    Returns:
        None
    """
    return wait_until_task(
        creator("mfold_create", sequence),
        lambda task_id, **kwargs: checker("mfold_check", task_id, **kwargs),
        mfold_result,
    )
Esempio n. 6
0
def main(difficulty):
    clock = pygame.time.Clock()
    diff_gen(difficulty)
    strs = utils.read_field('new_field.txt')
    objects = []
    cur = Cursor()
    prev_sel = (0, 0)
    screen_color = BLACK
    for x in range(9):
        row = []
        for y in range(9):
            elem = strs[x][y]
            if '1' <= elem <= '9':
                row.append(Number(int(elem), x, y, fixed=True))
            else:
                row.append(Number(None, x, y))
        objects.append(row)
    while True:
        SCREEN.fill(screen_color)
        events = pygame.event.get()
        for event in events:
            if event.type == pygame.QUIT or (event.type == pygame.KEYDOWN
                                             and event.key == pygame.K_ESCAPE):
                exit(0)
            elif event.type == pygame.KEYDOWN and event.key == pygame.K_RETURN:
                if utils.checker(strs):
                    screen_color = DARK_GREEN
                else:
                    screen_color = DARK_RED
        clock.tick(20)
        cur.exist()
        objects[prev_sel[0]][prev_sel[1]].selected = False
        objects[cur.gx][cur.gy].selected = True
        if not objects[cur.gx][
                cur.gy].fixed and cur.number_pressed and cur.number:
            if cur.number == 'd':
                objects[cur.gx][cur.gy].number = None
                strs[cur.gx][cur.gy] = 'X'
            else:
                objects[cur.gx][cur.gy].number = cur.number
                strs[cur.gx][cur.gy] = cur.number
        prev_sel = (cur.gx, cur.gy)
        for row in objects:
            for obj in row:
                obj.exist()
        pygame.display.flip()
Esempio n. 7
0
def from_sirna(sequences):
    """It does workflow for creating sh-miR from siRNA sequence(s)
        * creates task
        * wait until it's done
        * gets result(s)

    Args:
        sequences: one siRNA strand (active) or two siRNA strands separated by space.
            First strand is active, both are in 5-3 orientation.

    Returns:
        None
    """
    return wait_until_task(
        creator("from_sirna_create", sequences),
        lambda task_id, **kwargs: checker("from_sirna_check", task_id, **kwargs),
        from_sirna_result,
    )
Esempio n. 8
0
def plot_plate(dataframe, parameter, config):
    data = dataframe
    coords = map(well_to_ij, data['Well Name'].values)
    values = data[parameter].values
    conditions = data['Condition'].values
    matrix, missing_coords = to_plate_layout(coords, values)
    
    if config['color'] == None:
        plt.imshow(
            checker(*matrix.shape) & ~np.isnan(matrix),
            interpolation = 'nearest',
            cmap = 'Greys',
            aspect = 'auto',
            vmin = 0, 
            vmax = 6);
    else:
        plt.imshow(
            matrix,
            interpolation = 'nearest',
            cmap = config['color'],
            aspect = 'auto',
            vmin = config['vmin'], 
            vmax = config['vmax']);
    
    plot_plate_ticks(matrix,xticks=config['xticks?'])
    
    # Plot 'no data' for wells that don't have any data
    [plot_plate_text(i,j,'No data') for i,j in missing_coords]
 
    # Label wells with values, conditions, or nothing (empty strings)
    show = config['show']
    vs = {'Conditions': [format_long_line(c, 12) for c in conditions],
          'Values': values,
          'None': ['' for _ in values]}
    formats = {'Conditions': '%s',
               'Values': '%.2f',
               'None': '%s'}
    [plot_plate_text(i, j, v, format_string = formats[show]) \
         for (i, j), v in zip(coords, vs[show])]
Esempio n. 9
0
def plot_plate(dataframe, parameter, config):
    data = dataframe
    coords = map(well_to_ij, data['Well Name'].values)
    values = data[parameter].values
    conditions = data['Condition'].values
    matrix, missing_coords = to_plate_layout(coords, values)
    
    if config['color'] == None:
        plt.imshow(
            checker(*matrix.shape) & ~np.isnan(matrix),
            interpolation = 'nearest',
            cmap = 'Greys',
            aspect = 'auto',
            vmin = 0, 
            vmax = 6);
    else:
        plt.imshow(
            matrix,
            interpolation = 'nearest',
            cmap = config['color'],
            aspect = 'auto',
            vmin = config['vmin'], 
            vmax = config['vmax']);
    
    plot_plate_ticks(matrix,xticks=config['xticks?'])
    
    # Plot 'no data' for wells that don't have any data
    [plot_plate_text(i,j,'No data') for i,j in missing_coords]
 
    # Label wells with values, conditions, or nothing (empty strings)
    show = config['show']
    vs = {'Conditions': [format_long_line(c, 12) for c in conditions],
          'Values': values,
          'None': ['' for _ in values]}
    formats = {'Conditions': '%s',
               'Values': '%.2f',
               'None': '%s'}
    [plot_plate_text(i, j, v, format_string = formats[show]) \
         for (i, j), v in zip(coords, vs[show])]
params=get_params()
url=None
thumb=None
name=None
mode=None

try: url=urllib.unquote_plus(params["url"])
except: pass
try: thumb=urllib.unquote_plus(params["thumb"])
except: pass
try: name=urllib.unquote_plus(params["name"])
except: pass
try: mode=int(params["mode"])
except: pass

checker()

if mode==None or url==None or len(url)<1:
    print "Versao Instalada: v" + versao
    if selfAddon.getSetting('termos') == 'true':
        mensagemaviso()
        selfAddon.setSetting('termos',value='false')
    canais()
if mode==1: menu_principal()
elif mode==2: replaytv()
elif mode==3: replaytv_lista(name,url)
elif mode==4: replaytv_progs(name,url)
elif mode==5: obter_lista(name,url)
elif mode==6: listascanais()
elif mode==7: descobrirresolver(url,nomecanal,linkrecebido,zapping)
elif mode==8: replaytv_play(name,url)
Esempio n. 11
0
params=get_params()
url=None
thumb=None
name=None
mode=None

try: url=urllib.unquote_plus(params["url"])
except: pass
try: thumb=urllib.unquote_plus(params["thumb"])
except: pass
try: name=urllib.unquote_plus(params["name"])
except: pass
try: mode=int(params["mode"])
except: pass

checker()

if mode==None or url==None or len(url)<1:
    print "Versao Instalada: v" + versao
    if selfAddon.getSetting('termos') == 'true':
        mensagemaviso()
        selfAddon.setSetting('termos',value='false')
    canais()
if mode==1: menu_principal()
elif mode==2: replaytv()
elif mode==3: replaytv_lista(name,url)
elif mode==4: replaytv_progs(name,url)
elif mode==5: obter_lista(name,url)
elif mode==6: listascanais()
elif mode==7: descobrirresolver(url,nomecanal,linkrecebido,zapping)
elif mode==8: replaytv_play(name,url)