-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
33 lines (29 loc) · 1.17 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.Align import MultipleSeqAlignment
from Bio.Align import AlignInfo
sequences = []
fasta_files = [
"./data/Delta/EPI_ISL_14594262.fasta",
"./data/Delta/EPI_ISL_14594268.fasta",
"./data/Delta/EPI_ISL_14594269.fasta",
"./data/Delta/EPI_ISL_14594270.fasta",
"./data/Delta/EPI_ISL_14594272.fasta",
"./data/Delta/EPI_ISL_17047775.fasta",
"./data/Delta/EPI_ISL_17047776.fasta",
"./data/Delta/EPI_ISL_17047777.fasta",
"./data/Delta/EPI_ISL_17047778.fasta",
"./data/Delta/EPI_ISL_17047779.fasta"
]
for file in fasta_files:
with open(file, "r") as f:
sequence = Seq(f.read().strip())
record = SeqRecord(sequence)
record.id = file.split(".")[0]
sequences.append(record)
print(f"Sequence {record.id} length: {len(sequence)}")
alignment = MultipleSeqAlignment(sequences)
summary_align = AlignInfo.SummaryInfo(alignment)
consensus = summary_align.dumb_consensus()
print("Consensus Sequence:")
print(consensus)