lncScore.py 文件源码

python
阅读 53 收藏 0 点赞 0 评论 0

项目:lncScore 作者: WGLab 项目源码 文件源码
def HexamerFeatures(seq,hash_matrix):
    if len(seq) < 6:
        return(0,0)
    frame_sequence = list(seq)
    frame_seq_length = len(frame_sequence)
    CDS_array = []
    for o in range(0,3):
        frame_TempStr = ''
        frame_TempStr = InitCodonSeq(o,frame_seq_length-2,3,frame_sequence)
        frame_array = frame_TempStr.split(' ') ## codon array
        frame_array.pop()
        other_num = 0
        frame_array_Len = len(frame_array) - 1
        for j in range(frame_array_Len):
            temp2 = frame_array[j]+frame_array[j+1]
            temple4 = re.compile('[atcg]{6}')
            if temple4.match(temp2):
                other_num = string.atof(other_num) + string.atof(hash_matrix[temp2])
        frame_array_Len = frame_array_Len + 2
        other_num = other_num / frame_array_Len
        CDS_array.append(other_num)      
    Mscore = max(CDS_array)
    score_distance = 0
    for m in range(0,3): #problem location
        score_distance += Mscore - CDS_array[m]
    score_distance = score_distance/float(2)   

    return(Mscore,score_distance)

#==============================================================================
#   Print the final result 
#==============================================================================
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号