Distance matrix based on the whole input alignment
0
0
Entering edit mode
3.5 years ago
anasjamshed ▴ 120

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

alignment python biopython • 1.1k views
ADD COMMENT
0
Entering edit mode

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 of AlignIO.read

https://biopython.org/wiki/Multiple_Alignment_Format

ADD REPLY

Login before adding your answer.

Traffic: 1830 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6