<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Dear Ahmad,<br>
<br>
Actually I don't know if the PairwiseAligner object has an easy way
to fetch the two aligned sequences, but you can do:<br>
<br>
aligned_seq1, match_line, aligned_seq2 =
str(alignments[0])[:-1].split('\n')<br>
<br>
And then you write aligned_seq1 and aligned_seq2 to a fasta file
using SeqIO. Before writing them you need to make them SeqRecords.<br>
<br>
Best, Markus<br>
<br>
<br>
<div class="moz-cite-prefix">Am 21.03.2019 um 20:41 schrieb Ahmad
Khalifa:<br>
</div>
<blockquote type="cite"
cite="mid:CAL1o8vOvs2H8rLzy0OphMW7BbsAAdoqZJ3=NSfvxkm=rnd-E_g@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div>I have :</div>
<div><br>
</div>
<div>aligner = PairwiseAligner()</div>
<div>alignments = aligner.align(chain1, chain2)</div>
<div><br>
</div>
<div>how to write alignments[0] as a text file containing
the alignment in fasta format. I went through the
documentation below, and I'm not really sure I follow. Do
I have to save the alignments as text first, then, read it
using AlingIO then write it using SeqIO? </div>
<div><br>
</div>
<div><a
href="http://biopython.org/DIST/docs/api/Bio.AlignIO-module.html"
moz-do-not-send="true">http://biopython.org/DIST/docs/api/Bio.AlignIO-module.html</a><br>
</div>
<div><br>
</div>
<div>A code snippet would be most helpful.</div>
<div><br>
Regards. </div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Biopython mailing list - <a class="moz-txt-link-abbreviated" href="mailto:Biopython@mailman.open-bio.org">Biopython@mailman.open-bio.org</a>
<a class="moz-txt-link-freetext" href="https://mailman.open-bio.org/mailman/listinfo/biopython">https://mailman.open-bio.org/mailman/listinfo/biopython</a></pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
_________________________________
Dr. Markus Piotrowski
Privatdozent/Akademischer Rat
Lehrstuhl für Molekulare Genetik und Physiologie der Pflanzen
ND 3/49
Universitätsstr. 150
44801 Bochum
Tel. xx49-(0)234-3224290
Fax. xx49-(0)234-3214187
<a class="moz-txt-link-freetext" href="http://www.ruhr-uni-bochum.de/pflaphy/Seiten_dt/PG_Piotrowski_d.html">http://www.ruhr-uni-bochum.de/pflaphy/Seiten_dt/PG_Piotrowski_d.html</a>
<a class="moz-txt-link-freetext" href="http://homepage.ruhr-uni-bochum.de/Markus.Piotrowski/Index.html">http://homepage.ruhr-uni-bochum.de/Markus.Piotrowski/Index.html</a></pre>
</body>
</html>