This video shows how to extract the DNA sequence/genome from the FASTA file and store the DNA sequence in the DataFrame. Bio python package is used to process the DNA sequence. SeqIO function is used to extract the DNA sequence from the FASTA file.
The website to download the DNA sequence of MERS virus:
[ Ссылка ]
The code is given below:
pip install phylopandas
import pandas as pd
from Bio import SeqIO
with open('/content/drive/My Drive/Dataset/MERS Sequence.fasta') as fasta_file: # Will close handle cleanly
identifiers = []
lengths = []
#read Sequence from FASTA file
for seq_record in SeqIO.parse(fasta_file, 'fasta'): # (generator)
identifiers.append(str(seq_record.seq))
lengths.append(len(seq_record.seq))
#store sequence in DataFrame
d = {'Sequence':identifiers,'Len':lengths}
data= pd.DataFrame(d)
data['label']="MERS"
data
![](https://i.ytimg.com/vi/Wn7-mlB_ZCY/maxresdefault.jpg)