Entering edit mode
3.9 years ago
anasjamshed
▴
130
I want to compute the distance matrix based on the whole input alignment file strain.maf. The .maf file contains the multi-alignment of 119 genomes. It is downloaded from the UCSC Genome Browser
I have tried this script:
from Bio.Phylo.TreeConstruction import DistanceCalculator
from Bio import AlignIO
file = open("strain.maf")
aln = AlignIO.read(file,"maf")
print(aln)
But it shows the following error :
ValueError Traceback (most recent call last)
<ipython-input-15-86a85741d851> in <module>()
2 from Bio import AlignIO
3 file = open("strain.maf")
----> 4 aln = AlignIO.read(file,"maf")
5 print(aln)
~\Anaconda3\lib\site-packages\Bio\AlignIO\__init__.py in read(handle, format, seq_count)
393 try:
394 next(iterator)
--> 395 raise ValueError("More than one record found in handle")
396 except StopIteration:
397 pass
ValueError: More than one record found in handle
plz help me
Does the input file contain multiple alignments? I think there should be one single record of multiple sequence alignment.
Maybe you can try using
AlignIO.parse
instead ofAlignIO.read
https://biopython.org/wiki/Multiple_Alignment_Format