-
Notifications
You must be signed in to change notification settings - Fork 18
Aditya Kaushika Mini Project One #10
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.
Looks good overall! I really like that you are documenting your code all the way through. I've made some stylistic suggestions, especially on how to name your variables in a more readable way.
| @@ -1,38 +1,49 @@ | |||
| # -*- coding: utf-8 -*- | |||
| """ | |||
| YOUR HEADER COMMENT HERE | |||
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.
For next mini project, please write a short description about the code (header comment really helps when your code base gets large)
| return 'A' | ||
| elif letter == 'G': | ||
| return 'C' | ||
| else: |
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.
this function will never fail if the user gives "A", "C', "G", "T" only as inputs. But what if I give "S" as input?
| rol=len(orf) #add letters to our remaining letters | ||
| if (rol > 0): #ask if there are any remaining letters | ||
| rol = rol - 3 #if there are, take three away | ||
| return a #Display results |
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 how you are commenting every line to help the reader understand what is going on! It is generally good practice to write readable code. But sometimes, especially when the code is simple and trivial, we don't need to leave comments for "every line" if it's taking too much time.
| # a.append(rest_of_ORF(dna[i:])) | ||
| # elif (dna[i+2:i+5]=='ATG'): | ||
| # a.append(rest_of_ORF(dna[i:])) | ||
| return a #Display results |
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.
When submitting your final code, please removed commented(deprecated) lines.
| if len(i)>count: #Check their length to the last counted string | ||
| count = len (i) #If it is the longest, change it | ||
| a = i #make a the largest string | ||
| return a #Display a |
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.
just a note on naming variables. Naming it max or longestORF would be much more readable than naming it just a.
Here's an article that's worth skimming through. http://archive.oreilly.com/pub/post/the_worlds_two_worst_variable.html
| if Long_Orfs>threshold): #Compare values | ||
| a.append(coding_strand_to_AA(dna)) #add to the list | ||
| dna = load_seq("./data/X73525.fa") #obtaining genes | ||
| print gene_finder(dna) #showing the list of Amino Acids |
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.
This is a recursive function, but we don't really need recursion here.
return dna would be the better way of ending this function.
Then we call gene_finder(dna) in __main__
No description provided.