-
Notifications
You must be signed in to change notification settings - Fork 18
Harrison Young Gene Finder Project #11
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
base: master
Are you sure you want to change the base?
Conversation
SeunginLyu
left a comment
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.
Nicely Done! It looks really good overall. I made some stylistic suggestions that might be helpful. Keep up the good work!
| import random | ||
| from amino_acids import aa, codons, aa_table # you may find these useful | ||
| from load import load_seq | ||
| dna = load_seq("./data/X73525.fa") |
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.
While the logic here is similar for both import and load_seq, the former is a module import statement while the latter is a function call. It is conventional to keep import statements separate from the rest of the code. In this case, load_seq should be in __main__
| complement_strand = complement_strand + 'A' | ||
| if pair == 'G': | ||
| complement_strand = complement_strand + 'C' | ||
| #print (complement_strand) |
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.
please remove comments for the final code
| strand_length -= 1 #moves backwards | ||
| return (rev_complement) | ||
| # TODO: implement this | ||
| pass |
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.
These are simple placeholders, so no need to leave them in your final code
| >>> rest_of_ORF("ATGAGATAGG") | ||
| 'ATGAGA' | ||
|
|
||
| >>> rest_of_ORF("TAG") |
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.
👍 to custom unit testing!
| """ | ||
| #stop codons are TAA, TAG, TGA | ||
| # TODO: implement this | ||
| #stop_codons = ['TAA','TAG','TGA'] |
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.
remove comments please
| if dna[i:i+3] in stop_codons: #stop if you find a stop codon | ||
|
|
||
| return dna[0:i] #return dna before the codon | ||
|
|
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.
I like your inline comments. But you don't need to write them for every line if you feel like you are spending too much time explaining trivial things into words.
| returns: a list of non-nested ORFs | ||
| >>> find_all_ORFs_oneframe("ATGCATGAATGTAGATAGATGTGCCC") | ||
| ['ATGCATGAATGTAGA', 'ATGTGCCC'] | ||
| >>> find_all_ORFs_oneframe("ATGATGCATGAATGTAGATAGATGTGCCC") |
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.
👍 another good unit test
| >>> longest_ORF("ATGCGAATGTAGCATCAAA") | ||
| 'ATGCTACATTCGCAT' | ||
| """ | ||
| return max(find_all_ORFs_both_strands(dna), key=len); #returns 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.
nice concise & efficient code
| """ | ||
| max_orf = "" | ||
| temp = "" | ||
| for i in range(0, num_trials): |
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.
one stylistic convention. for _ in range(0, num_trials):
I would like some feedback on my genefinder project.