<html>
<head>
<style>
body {
font-family: Verdana, sans-serif;
font-size: 0.8em;
color:#484848;
}
h1, h2, h3 { font-family: "Trebuchet MS", Verdana, sans-serif; margin: 0px; }
h1 { font-size: 1.2em; }
h2, h3 { font-size: 1.1em; }
a, a:link, a:visited { color: #2A5685;}
a:hover, a:active { color: #c61a1a; }
a.wiki-anchor { display: none; }
fieldset.attachments {border-width: 1px 0 0 0;}
hr {
width: 100%;
height: 1px;
background: #ccc;
border: 0;
}
span.footer {
font-size: 0.8em;
font-style: italic;
}
</style>
</head>
<body>
Issue #3326 has been updated by Peter Cock.
<ul>
<li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li>
<li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li>
</ul>
<p>As part of retiring the old RedMine issue tracker, I'm closing this but would welcome a pull request on GitHub if you think it would be useful.<br /><a class="external" href="https://github.com/biopython/biopython/">https://github.com/biopython/biopython/</a></p>
<p>Thanks.</p>
<hr />
<h1><a href="https://redmine.open-bio.org/issues/3326#change-15325">Feature #3326: MultipleSeqAlignment should support iterators, not only slice objects</a></h1>
<ul><li>Author: Fabio Zanini</li>
<li>Status: Closed</li>
<li>Priority: Normal</li>
<li>Assignee: Biopython Dev Mailing List</li>
<li>Category: Main Distribution</li>
<li>Target version: </li>
<li>URL: </li></ul>
<p>Currently, the MultipleSeqAlignment object supports slicing via various syntaxes, e.g.:</p>
<p>- alignment[4,6]<br />- alignment[2:4,3:6]<br />- alignment[3:4:5]</p>
<p>In the latter case, the indices build a so-called slice, a pure Python object, and MultipleSeqAlignment has an explicit if clause for dealing with this case.</p>
<p>However, the user might want to iterate over the MSA using the more general <strong>iterators</strong>, e.g. from itertools, rather than simple slice objects. An extension that includes iterators looks easy:</p>
<ol>
<li>Check whether the index is an iterator<br />if (hasattr(index, 'next')) and (hasattr(index:, '__iter__')):<br /> return MultipleSeqAlignment([self._records[i] for i in index], self._alphabet)</li>
</ol>
<p>Would you think this is useful?</p>
<hr />
<span class="footer"><p>You have received this notification because you have either subscribed to it, or are involved in it.<br />To change your notification preferences, please click here and login: <a class="external" href="http://redmine.open-bio.org">http://redmine.open-bio.org</a></p></span>
</body>
</html>