"""
Function of this code: one method of transforming DNA sequences to numerical values.
Contact for help: gch_liu@163.com 
"""

def dna2numKBPC1(seq):
    N=len(seq);
    seq0=[];
    for i in range(0,N):
        if seq[i]=='A':
            seq0.append(1j);
        elif seq[i]=='C':
            seq0.append(-1);
        elif seq[i]=='G':
            seq0.append(1);
        else:   #seq(i)=='T';
            seq0.append(-1j);
    return seq0;

