Пример #1
0
import sys
import init

with file('../../data/ref.cmap') as f:
    ref = init.read_ref(f)
with file('../../data/input.bnx') as f:
    moles = init.read_moles(f)
mole_id = int(sys.argv[1])
print 'mole:'
print moles[mole_id]
start_site = int(sys.argv[2])
end_site = int(sys.argv[3])
result = []
print 'ref:'
for i in xrange(end_site - start_site + 1):
    result.append(ref[start_site + i])
print result
Пример #2
0
 
    '''
    for i in xrange(rows):
        for j in xrange(cols):
            print '%f '%score_matrix[i][j],
        print
    
    #print the score_matrix
    for i in xrange(rows + 1):
        for j in xrange(cols + 1):
            print "%f "%score_matrix[i][j],
        print 
    '''

    #get the trace of DP
    #TODO
if __name__ == '__main__':
    if len(sys.argv) < 3:
        print 'INPUT ERROR: Two files is needs. The first file is mole file(*.inx), and another is reference file(*.cmp)'
        exit()
    with file(sys.argv[1]) as f:
        moleset = init.read_moles(f)
    with file(sys.argv[2]) as f:
        ref = init.read_ref(f)[1 : ]
    #print 'ref: '
    #print ref
    for mole in moleset:
        print 'mole: %d'%mole
        #print moleset[mole]
        DP(moleset[mole], ref)