ts
, you can test whether a given mutation called mut
is in that list with>>> mut in ts #tests whether mut is in ts and returns True or False
True
itertools.product
may be helpful). Then, iterate over the DNA sequence and add a count to your dictionary when a 4-mer is encountered. Remember a string of length n can be seen as composed of n−k+1 overlapping k-mers.#one way to build a matrix is a list of lists
#try this in your shell:
M = []
for i in range(5): #make a 5 row x 10 column matrix filled with zeroes
M.append([0] * 10)
M #view matrix M
M[0][1] = 1 #change the 0 at row 0, column 1 to a 1
M #view matrix M
On the due date, in class, you may be asked questions about how your code works and your comments will help you explain. Inability to explain how your code works will result in a reduced grade.
Note: You will only get credit for these if you have completed 14-21 correctly, so focus on those first. These two are much more challenging.
compbio.cs.luc.edu
and test running your scripts from the command line
scp
commandsys
and argparse
compbio
server: /homes/hwheeler/python_examples/DNA.py