This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# method to calculate a k-mer's minimum number of appearance in a dna sequence | |
# from Bioinformatics Specialization on Coursera. | |
import operator as op | |
def ncr(n, r): | |
r = min(r, n-r) | |
if r == 0: return 1 | |
numer = reduce(op.mul, xrange(n, n-r, -1)) | |
denom = reduce(op.mul, xrange(1, r+1)) | |
return numer//denom |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from LoadData import * | |
from k_means import * | |
from evaluation import * | |
from kernel_k_means import * | |
import matplotlib | |
import matplotlib.pyplot as plt | |
from mpl_toolkits.mplot3d import Axes3D | |
if __name__ == "__main__": |