Skip to content

Instantly share code, notes, and snippets.

@CicoZhang
Last active December 10, 2017 14:24
Show Gist options
  • Save CicoZhang/8d50230d1d65e25fc592fcff1b43df51 to your computer and use it in GitHub Desktop.
Save CicoZhang/8d50230d1d65e25fc592fcff1b43df51 to your computer and use it in GitHub Desktop.
Dynamic Programming
def print_matrix_to_file(matrix, fileName):
"""Write a matrix into file.
matrix: a list of list in Python, storing an alignment or a score
matrix.
fileName: str, a file name (with a path) to store the matrix.
It is not recommended to modify this function.
"""
with open(fileName, 'w') as f:
for row in matrix:
print(''.join(map(str,row)),file=f)
YICSFADCCF
| |
FPCK_EECA_
26
-FPCKEECA
-0-2-4-6-8-10-12-14-16
Y-27531-1-3-5-7
I-45531-1-3-5-6
C-6331715131197
S-814151715131110
F-10121315131198
A-12-12111315131111
D-14-3091116181614
C-16-5-2121014163028
C-18-7-410812142828
F-20-9-68610122626
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment