-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
be64763
commit 6833b06
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from Transcribing_DNA_into_RNA import transcription | ||
from Translating_RNA_into_Protein import translation | ||
from Complementing_a_Strand_of_DNA import complementer | ||
|
||
|
||
def find_protein(DNA): | ||
proteins = set() | ||
for i in range(len(DNA)): | ||
if DNA[i:i+3] == 'ATG': | ||
DNAlst = [] | ||
for j in range(i, len(DNA), 3): | ||
DNAlst.append(DNA[j:j + 3]) | ||
if 'TAG' in DNAlst or 'TGA' in DNAlst or 'TAA' in DNAlst: | ||
proteins.add(translation(transcription(DNA[i:]))) | ||
for i in range(len(DNA)): | ||
if complementer(DNA)[i:i+3] == 'ATG': | ||
DNAlst = [] | ||
for j in range(i, len(DNA), 3): | ||
DNAlst.append(DNA[j:j + 3]) | ||
if 'TAG' in DNAlst or 'TGA' in DNAlst or 'TAA' in DNAlst: | ||
proteins.add(translation(transcription(complementer(DNA)[i:]))) | ||
proteins = list(proteins) | ||
return proteins | ||
|
||
|
||
with open('rosalind_orf3.txt','r') as file: | ||
content = file.read() | ||
DNA = '' | ||
for i in range(1,len(content.splitlines())): | ||
DNA += content.splitlines()[i] | ||
lst = find_protein(DNA) | ||
for i in lst: | ||
print(i) |