Skip to content

Aditya Kaushika Mini Project One#10

Open
akaushika wants to merge 2 commits into
sd17fall:masterfrom
akaushika:master
Open

Aditya Kaushika Mini Project One#10
akaushika wants to merge 2 commits into
sd17fall:masterfrom
akaushika:master

Conversation

@akaushika
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@SeunginLyu SeunginLyu left a 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.

Comment thread gene_finder.py
@@ -2,37 +2,48 @@
"""
YOUR HEADER COMMENT HERE
Copy link
Copy Markdown

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)

Comment thread gene_finder.py
return 'A'
elif letter == 'G':
return 'C'
else:
Copy link
Copy Markdown

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?

Comment thread gene_finder.py
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
Copy link
Copy Markdown

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.

Comment thread gene_finder.py
# 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
Copy link
Copy Markdown

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.

Comment thread gene_finder.py
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
Copy link
Copy Markdown

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

Comment thread gene_finder.py
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
Copy link
Copy Markdown

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__

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