Skip to content

Harrison Young Gene Finder Project#11

Open
hthomas60 wants to merge 4 commits intosd17fall:masterfrom
hthomas60:master
Open

Harrison Young Gene Finder Project#11
hthomas60 wants to merge 4 commits intosd17fall:masterfrom
hthomas60:master

Conversation

@hthomas60
Copy link
Copy Markdown

I would like some feedback on my genefinder project.

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.

Nicely Done! It looks really good overall. I made some stylistic suggestions that might be helpful. Keep up the good work!

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

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__

Comment thread gene_finder.py
complement_strand = complement_strand + 'A'
if pair == 'G':
complement_strand = complement_strand + 'C'
#print (complement_strand)
Copy link
Copy Markdown

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

Comment thread gene_finder.py
strand_length -= 1 #moves backwards
return (rev_complement)
# TODO: implement this
pass
Copy link
Copy Markdown

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

Comment thread gene_finder.py
>>> rest_of_ORF("ATGAGATAGG")
'ATGAGA'

>>> rest_of_ORF("TAG")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 to custom unit testing!

Comment thread gene_finder.py
"""
#stop codons are TAA, TAG, TGA
# TODO: implement this
#stop_codons = ['TAA','TAG','TGA']
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comments please

Comment thread gene_finder.py
if dna[i:i+3] in stop_codons: #stop if you find a stop codon

return dna[0:i] #return dna before the codon

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

Comment thread gene_finder.py
returns: a list of non-nested ORFs
>>> find_all_ORFs_oneframe("ATGCATGAATGTAGATAGATGTGCCC")
['ATGCATGAATGTAGA', 'ATGTGCCC']
>>> find_all_ORFs_oneframe("ATGATGCATGAATGTAGATAGATGTGCCC")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 another good unit test

Comment thread gene_finder.py
>>> longest_ORF("ATGCGAATGTAGCATCAAA")
'ATGCTACATTCGCAT'
"""
return max(find_all_ORFs_both_strands(dna), key=len); #returns longest orf
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice concise & efficient code

Comment thread gene_finder.py
"""
max_orf = ""
temp = ""
for i in range(0, num_trials):
Copy link
Copy Markdown

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):

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