Skip to content

Conversation

@akaushika
Copy link

No description provided.

Copy link

@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.

@@ -1,38 +1,49 @@
# -*- coding: utf-8 -*-
"""
YOUR HEADER COMMENT HERE

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:

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

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

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

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

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