𧬠1.5 μλ¬Όνμ μμ΄μ κΈ°λ³Έ μ²λ¦¬
1.5 μλ¬Όνμ μμ΄μ κΈ°λ³Έ μ²λ¦¬
𧬠μ΄λ²μλ μμμ λ§λ μ¬λ¬ ν¨μλ€μ κ°μ§κ³ DNA μμ΄μ λ°μΌλ©΄ κΈ°λ³Έμ μΌλ‘ μ²λ¦¬ν΄μΌ ν κ²μ΄ 무μμ΄ μλμ§ μ 리ν΄λ³΄μ.
1.5.1. κΈ°λ³Έμ μ²λ¦¬ μμ½
𧬠λ€μ μ½λλ₯Ό μν΄μλ μμ ν¬μ€ν
μμ ꡬνν ν¨μλ€μ΄ sequences.py λΌλ νμΌμ λͺ¨λ λ€μ΄κ° μμ΄μΌ νλ€.
𧬠1. validate_dna( ) : seq μμ΄μ DNA μ ν¨μ±μ κ²μ¬
𧬠2. transcription( ) : DNA μμ΄μ μ μ¬ν RNA μμ΄ μμ±
𧬠3. reverse_complement( ) : μμ보μμ΄ μμ±
𧬠4. gc_content( ) : DNA μμ΄μμ GC μΌκΈ°μ λΉμ¨ νμΈ
𧬠5. translate_seq( ) : DNA μμ΄μ μλ―Έλ
Έμ° μμ΄λ‘ λ²μ
𧬠6. all_orfs_ord( ) : DNA μμ΄μ λ¨λ°±μ§ μμ΄λ‘ λ³ν
from sequences import *
seq = input("Insert DNA sequence: ")
if validate_dna(seq):
print("Valid sequence")
print("Transcription: ", transcription(seq))
print("Reverse complement: ", reverse_complement(seq))
print("GC content: ", gc_content(seq))
print("Direct translation: ", translate_seq(seq))
print("All proteins in ORFs(decreasing size): ", all_orfs_ord(seq))
else:
print("DNA sequence is not valid")
>>
Insert DNA sequence: ATGGGATCGTAGTCGTACTAGCTAGCTGATGGTACTCGATAGTCTACGTAGCTAGTGGTACTGGATGGTACTCAGTAACAT
Valid sequence
Transcription: AUGGGAUCGUAGUCGUACUAGCUAGCUGAUGGUACUCGAUAGUCUACGUAGCUAGUGGUACUGGAUGGUACUCAGUAACAU
Reverse complement: ATGTTACTGAGTACCATCCAGTACCACTAGCTACGTAGACTATCGAGTACCATCAGCTAGCTAGTACGACTACGATCCCAT
GC content: 0.4567901234567901
Direct translation: MGS_SY_LADGTR_ST_LVVLDGTQ_H
All proteins in ORFs(decreasing size): ['MLLSTIQYH', 'MVLDSLRS', 'MGS']
1.5.2. νμΌμ μ½κ³ μ°κΈ°
𧬠read_seq_from_file( ) : μ£Όμ΄μ§ νμΌμ μ½κΈ° λͺ¨λλ‘ λΆλ¬μμ μ¬λ¬ μ€μ μλ λ΄μ©μ ν μ€λ‘ μ½μ΄λ€μ - \n μ μΌλ°κ°κ²©μΌλ‘ replace ν΄μ μ½μ
𧬠DNA sequence read.txt λΌλ νμΌμ 미리 μΈ μ€μ DNAμμ΄μ μ λ ₯ν΄ λμλ€.
def read_seq_from_file(filename):
fh = open(filename, "r")
lines = fh.readlines()
seq=""
for l in lines:
seq += l.replace("\n", "")
fh.close()
return seq
print(read_seq_from_file('DNA sequence read.txt'))
>> ATGGGATCGTAGTCGTACTAGCTAGCTGATGGTACTCGATAGTCTACGTAGCTAGTGGTACTGGATGGTACTCAGTAACAT
DNA sequence read.txt νμΌμ μμ΄μ μ½μ΄μ¨ κ²μ νμΈν μ μλ€.
𧬠write_seq_to_file( ) : μ£Όμ΄μ§ νμΌμ μ°κΈ° λͺ¨λλ‘ λΆλ¬μ€κ±°λ νμΌμ μμ±ν΄μ ν μ€νΈ νμΌμ λ΄μ©μ μμ±
def write_seq_to_file(seq, filename):
fh = open(filename, "w")
fh.write(seq)
fh.close()
return None
write_seq_to_file("ATGGGATCGTAGTCGTACTAGCTAGCTGATGGTACTCGATAGTCTACGTAGCTAGTGGTACTGGATGGTACTCAGTAACAT", 'DNA sequence write.txt')
DNA sequence write.txt νμΌμ μμ΄μ΄ μ λ ₯λλ κ²μ νμΈνμ.
1.5.3. DNAμ μ΅μ’ κΈ°λ³Έμ μ²λ¦¬
𧬠.txt νμΌμ DNA μμ΄μ read_seq_from_file( ) ν¨μλ‘ μ½μ΄μ΄
𧬠μ½μ΄μ¨ DNA μμ΄μμ μ΅μ’
μ μΌλ‘ μ»κ³ μ νλ κ²μ κ²°κ΅ λ°νλλ λ¨λ°±μ§μ΄κΈ° λλ¬Έμ μ΄ λ¨λ°±μ§ μμ΄μ νμΌμ μμ±ν΄μ μ΅μ’
μ²λ¦¬ν¨
𧬠all_orfs_ord( ) ν¨μλ₯Ό νΈμΆνμ¬ λͺ¨λ 리λ©νλ μμ λν΄μ κ°μμ½λκ³Ό μ’
κ²°μ½λμ κ³ λ €ν λ¨λ°±μ§λ§ κ°μ Έμ¨λ€.
𧬠all_orfs_ord( ) ν¨μμμ μ»μ λ¨λ°±μ§ μμ΄μ write_seq_to_file( ) ν¨μκ° orf-i.txt μ΄λ¦μΌλ‘ μμ±ν νμΌμ μμ±ν΄μ€
from sequences import *
fname = input("Insert input filename: ")
seq = read_seq_from_file(fname)
if validate_dna(seq):
print("Valid sequence")
print("Transcription: ", transcription(seq))
print("Reverse complement: ", reverse_complement(seq))
print("GC content: ", gc_content(seq))
print("Direct translation: ", translate_seq(seq))
orfs = all_orfs_ord(seq)
i = 1
for orf in orfs:
write_seq_to_file(orf, "orf-"+ str(i) + ".txt")
i += 1
else:
print("DNA sequence is not valid")
>>
Insert input filename: DNA sequence read.txt
Valid sequence
Transcription: AUGGGAUCGUAGUCGUACUAGCUAGCUGAUGGUACUCGAUAGUCUACGUAGCUAGUGGUACUGGAUGGUACUCAGUAACAU
Reverse complement: ATGTTACTGAGTACCATCCAGTACCACTAGCTACGTAGACTATCGAGTACCATCAGCTAGCTAGTACGACTACGATCCCAT
GC content: 0.4567901234567901
Direct translation: MGS_SY_LADGTR_ST_LVVLDGTQ_H
μ μ¬μ§μμ νμΈν μ μλ―μ΄ orf-i.txt νμΌμ΄ μμ±λμλ€.
κ° νμΌμ λ¨λ°±μ§ μμ΄μ΄ ν¬κΈ°μμλλ‘ μ λ ₯λ κ²μ νμΈν μ μλ€.
1.5.4. μμ½
𧬠μμ ν¨μλ€μ ν΅ν΄μ μ°λ¦¬κ° μ§μ μμ΄μ μ λ ₯ν μλ μμ§λ§ νΉμ νμΌμ μλ μμ΄μ μ½μ΄μ€λ λ°©λ²λ λ°°μ λ€. νΉν μ μ μμ΄μ κ·Έ κΈΈμ΄λ ν¬κΈ°κ° κ΅μ₯ν ν¬κΈ° λλ¬Έμ μΌμΌμ΄ μ λ ₯ν기보λ€λ μ½μ΄μ€λ κ²μ΄ λ νΈνλ€κ³ μκ°νλ€.
𧬠μ΄λ κ² DNA μμ΄μ λ°μμ€λ©΄ μ°λ¦¬λ μ°μ μμ΄μ μ ν¨μ±μ κ²μ¬νκ³ μ΄λ₯Ό μ μ¬ν RNA μμ΄μ λ§λ€μ΄λ³Έλ€. κ·Έλ¦¬κ³ μμ΄μ GC μΌκΈ° λΉμ¨μ μμλ³΄κ³ , μ΄ μμ΄μ΄ μ£Όνκ°λ₯μΈμ§ λΉμ£Όνκ°λ₯μΈμ§ νμΈμ΄ νλ κ²½μ°μλ μμ보μμ΄μ λ§λ€μ΄μ DNA μμ΄μ μλ―Έλ Έμ° μμ΄λ‘ λ²μνλ€. λ§μ§λ§μΌλ‘ μ΄ μλ―Έλ Έμ° μμ΄μ λ¨λ°±μ§ μμ΄λ‘ λ°ννλ©΄ DNA μμ΄μ κ°μ§κ³ ν μ μλ μ μ²λ¦¬λ μ΄λμ λ λλ¬λ€κ³ ν μ μλ€.
Leave a comment