Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

victorbianchi
Copy link

No description provided.

>>> get_complement('T')
'A'
>>> get_complement('G')
'C'
"""
# TODO: implement this
Copy link

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'
Copy link

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
Copy link

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
Copy link

@Elepert Elepert Oct 5, 2017

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

@Elepert
Copy link

Elepert commented Oct 5, 2017

I made a few stylistic suggestions for future reference. Keep up the good work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants