Skip to content

Conversation

@hthomas60
Copy link

I would like some feedback on my genefinder project.

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.

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

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)

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

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

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']

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

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

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

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

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