Question: Distance matrix based on the whole input alignment
0
gravatar for anasjamshed1994
4 weeks ago by
anasjamshed199420 wrote:

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

biopython alignment python • 116 views
ADD COMMENTlink modified 4 weeks ago by ATpoint41k • written 4 weeks ago by anasjamshed199420

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 REPLYlink modified 4 weeks ago • written 4 weeks ago by Fatima830
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1220 users visited in the last hour