<gh_stars>0
def nuc_count(seq):
    num=0
    for i in range(len(seq)):
        if len(seq[i])==6:
            num+=1
    nu5 = np.zeros((6,4))
    for i in range(6):
        temp = []
        for j in range(len(seq)):
            if len(seq[j])==6:
                temp.append(seq[j][i])
        nu5[i,:] = np.array([temp.count('A')/num,temp.count('C')/num,temp.count('G')/num,temp.count('T')/num])
    return nu5

def nucleic_biasin(seq,arrlnc,arrpc):
    if len(seq)==6:
        bia = np.zeros((6))
        for i in range(6):
            if seq[i]=='A':
                bia[i]=math.log(arrpc[i,0]/arrlnc[i,0])
            elif seq[i]=='C':     
                bia[i]=math.log(arrpc[i,1]/arrlnc[i,1])
            elif seq[i]=='G':      
                bia[i]=math.log(arrpc[i,2]/arrlnc[i,2])
            elif seq[i]=='T':        
                bia[i]=math.log(arrpc[i,3]/arrlnc[i,3])  
        bia0 = sum(bia)/6
    else:
        bia0=0
    return bia0
      
def nucleic_bia(seq,arrlnc,arrpc):
    bia=np.zeros((len(seq)))
    for i in range(len(seq)):
        bia[i] = nucleic_biasin(seq[i],arrlnc,arrpc)
    bia0 = np.expand_dims(bia, axis=1)
    return bia0

def nuc_count(seq):
    num=0
    for i in range(len(seq)):
        if len(seq[i])==6:
            num+=1
    nu5 = np.zeros((6,4))
    for i in range(6):
        temp = []
        for j in range(len(seq)):
            if len(seq[j])==6:
                temp.append(seq[j][i])
        nu5[i,:] = np.array([temp.count('A')/num,temp.count('C')/num,temp.count('G')/num,temp.count('T')/num])
    return nu5

def nucleic_biasin(seq,arrlnc,arrpc):
    if len(seq)==6:
        bia = np.zeros((6))
        for i in range(6):
            if seq[i]=='A':
                bia[i]=math.log(arrpc[i,0]/arrlnc[i,0])
            elif seq[i]=='C':     
                bia[i]=math.log(arrpc[i,1]/arrlnc[i,1])
            elif seq[i]=='G':      
                bia[i]=math.log(arrpc[i,2]/arrlnc[i,2])
            elif seq[i]=='T':        
                bia[i]=math.log(arrpc[i,3]/arrlnc[i,3])  
        bia0 = sum(bia)/6
    else:
        bia0=0
    return bia0
      
def nucleic_bia(seq,arrlnc,arrpc):
    bia=np.zeros((len(seq)))
    for i in range(len(seq)):
        bia[i] = nucleic_biasin(seq[i],arrlnc,arrpc)
    bia0 = np.expand_dims(bia, axis=1)
    return bia0