<p><a href="http://biolecture.org/index.php?title=Minsu_Kim/python/Rosalind / problem7">[7]</a> <a href="http://biolecture.org/index.php?title=Minsu_Kim/python/Rosalind / problem8">[8]</a> <a href="http://biolecture.org/index.php?title=Minsu_Kim/python/Rosalind / problem9">[9]</a> <a href="http://biolecture.org/index.php?title=Minsu_Kim/python/Rosalind / problem10">[10]</a> <a href="http://biolecture.org/index.php?title=Minsu_Kim/python/Rosalind / problem11">[11]</a> <a href="http://biolecture.org/index.php?title=Minsu_Kim/python/Rosalind / problem12">[12]</a></p>
<h2>function</h2>
<p>def patterncount(text, pattern):<br />
count=0<br />
for i in range(0,len(text)):<br />
if(text[i:len(pattern)+i]==pattern):<br />
count += 1<br />
return count</p>
<p>def complementing(sequence):<br />
sequence = sequence[::-1]<br />
text = list(sequence)<br />
for i in range(0,len(text)):<br />
if text[i] == 'A':<br />
text[i] = 'T'<br />
elif text[i] == 'G':<br />
text[i] = 'C'<br />
elif text[i] == 'C':<br />
text[i] = 'G'<br />
elif text[i] == 'T':<br />
text[i] = 'A'<br />
<br />
s = ''.join(text)<br />
print(s)<br />
return 0</p>
<h1>rosalind transcript basic</h1>
<p>f = open('rosalind_rna.txt')<br />
a = f.readline()<br />
f.close</p>
<p>text = list(a)</p>
<p>for i in range(0,len(text)):<br />
if text[i] == 'T':<br />
text[i] = 'U'<br />
a = ''.join(text)</p>
<p>print(a)</p>
<p>f = open('rosalind_revc2.txt','r')<br />
b = f.readline()<br />
f.close</p>
<p>b = b[::-1]<br />
text = list(b)</p>
<p>for i in range(0,len(text)):<br />
if text[i] == 'A':<br />
text[i] = 'T'<br />
elif text[i] == 'G':<br />
text[i] = 'C'<br />
elif text[i] == 'C':<br />
text[i] = 'G'<br />
elif text[i] == 'T':<br />
text[i] = 'A'<br />
<br />
b = ''.join(text)</p>
<p>print(b)</p>
<h2>Computing CG Content</h2>
<p>f_fa f = open('rosalind_gc.txt','r')<br />
seq_list = dict()<br />
for line in f_fa:<br />
else:<br />
seq_list[name]= line.strip()<br />
f_faf.close()</p>
<p>seq_CG = dict()<br />