コード例 #1
0
ファイル: bioframes.py プロジェクト: averagehat/biopandas
def obj_to_dict(obj, names_getters_map):
    apply_to_obj = partial2(apply_to_object, obj)
    return dictmap(apply_to_obj, names_getters_map)
コード例 #2
0
ファイル: samframe.py プロジェクト: demis001/biopandas
    'POS' : int,
    'MAPQ' : int,
    'CIGAR' : str,
    'RNEXT' : str,
    'PNEXT' : int,
    'TLEN' : int,
    #'MRNM' : str,
    #'MRNM' : '*='.__contains__,
    #'MPOS' : int,
    #'ISIZE' : int,
    'SEQ' : str,
    'QUAL' : str,
    #'OPTIONS' : str
}
#['OPT', 'MPOS', 'MRNM', 'ISIZE']
basic_schema = Schema(dictmap(Use, basic_scheme))

options_scheme = {
    'A' : chr,
    'i' : int,
    'f' : float,
    'Z' : str,
    'H' : int, # hex
    'B' : parse_array
}

def parse_option(option_str):
    ''' alternatively:   tag, type, val = option_str.split('\t')  '''
#_join = partial(reduce, lambda a, b: a+':'+b)
#    tag_type_val = op.itemgetter(0, 2, 4)
#    _tag = Regex(r'[A-Za-z][A-Za-z0-9]')
コード例 #3
0
def obj_to_dict(obj, names_getters_map):
    apply_to_obj = partial2(apply_to_object, obj)
    return dictmap(apply_to_obj, names_getters_map)