-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Completed my MP1 #12
base: master
Are you sure you want to change the base?
Completed my MP1 #12
Conversation
>>> get_complement('T') | ||
'A' | ||
>>> get_complement('G') | ||
'C' | ||
""" | ||
# TODO: implement this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stylistic comment: Remove TODOs when you've implemented the code
elif nucleotide == 'C': | ||
return 'G' | ||
else: | ||
return 'C' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stylistic comment: Instead of using a bunch of if
and else
statements and now that you've learned what dictionaries are, you could do something like this as well :
nucleotide_complements' = {'A':'T', 'T':'C', 'C':'G', 'G':'C'}
return nucleotide_complements[nucleotide]
orf_list = orf_list + find_all_ORFs_oneframe(dna[1:]) | ||
#second offset frame | ||
orf_list = orf_list + find_all_ORFs_oneframe(dna[2:]) | ||
return orf_list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If frames were larger than 3 codons long, you would have to copy the same line over and over, so putting it in a loop is a good choice.
if len(orf) > longest_length: | ||
longest_orf = orf | ||
longest_length = len(orf) | ||
return longest_orf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically longest_org = orf
is redundant
I made a few stylistic suggestions for future reference. Keep up the good work! |
No description provided.