# your code here
(You can use a lot of the code you wrote in the last lesson)
# your code here
rna_sequence = 'AUGUUUUUGAUACUUUUAAUUUCCUUACCAACGGCUUUUGCUGUUAUAGGAGAUUUAAAGUGUACUACAGUUUCCAUUAAUGAU'
print(find_start_codons(rna_sequence))
print(find_stop_codons(rna_sequence))
[0, 79] [7, 16, 46, 55, 77, 80]
dog_name_dict = {'sparky':'german shepherd', 'charlie':'terrier'}
print(dog_name_dict['sparky'])
german shepherd
beach_cities = {'beachy_west_coast_cities':['santa cruz','san diego','santa barbara'],
'beach_east_coast_cities':['miami','myrtle beach','orlando']}
print(beach_cities['beachy_west_coast_cities'])
['santa cruz', 'san diego', 'santa barbara']
# your code here
dog_name_dict = {'sparky':'german_shepherd', 'charlie':'terrier'}
dog_name_dict['tommy'] = 'yorkie'
print(dog_name_dict['tommy'])
yorkie
dog_name_dict
¶# your code here
# your code here
import sys
def read_fasta(path):
file = open(path, "r")
fasta = dict()
for line in file.readlines():
if line.startswith('>'):
entry = line.replace('>', '').strip()
fasta[entry] = ''
else:
fasta[entry] += ''.join(line.strip())
return(fasta)
new_fasta = read_fasta('/Users/vikas/Downloads/sbcc_slides/intro_python/vikas/teacher_slides/test.fasta')
print(new_fasta)
'gene_2'
from the dictionary new_fasta
¶# your code here
new_sequence = 'AUGUUAUUCUAUCUAGUUUCGGCUACUAGUUCAUGGUGUGUAACUAGUAUCA'
new_header = 'test_header'
# your code here
gene_1
from new_fasta
¶# your code here
new_fasta
¶# your code here