I use python for biology and I got an error and I'm not sure why, even though I have the (genomic_dna_4.txt) file in the directory, also in cell2, the function "genom_coding" isn't in blue like it should be, can someone check on the code?
Cell1 :
def genom_coding(seq_filename, coding_seq_filename):
with open(seq_filename, 'r') as file:
sequence = ''
for sequence in file:
exon1 = sequence[4:58]
exon2 = sequence[71:133]
exon3 = sequence[189:276]
exon4 = sequence[339:398]
with open(coding_seq_filename, 'w') as out_file:
print(exon1 + exon2 + exon3 + exon4 , file=file)
Cell2 :
genom_coding(genomic_dna_4.txt, genomic_dna_4_coding.txt)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-53-be2ad7077d60> in <module>
----> 1 genom_coding (genomic_dna_4.txt, genomic_dna_4_coding.txt)
NameError: name 'genomic_dna_4' is not defined