<p>Hi there,<br />
I know there are different ways to extract some &quot;wanted&quot; sequences from multifasta file. In general, having one or more IDs, you can retrieve the sequence from multifasta file using bioperl script or another kind of software as ones pointed out here (<a href="https://www.biostars.org/p/2822/">https://www.biostars.org/p/2822/</a>). In my case I know that I want the sequence <strong>number</strong> 1, 5 and 10 from a multifasta file. Any idea how can I achieve this using perl/bioperl preferably?<br />
<br />
Thanks in advance.<br />
P.D: I&#39;m a beginner in bioinformatics word, sorry if it is a very basic question.</p>

<p>Here is a BioPerl example since you asked:</p>

<p>https://gist.github.com/sestaton/651a34ae8dbb4d4c945c</p>

<p>I put this in a script so it is easier to read, but in practice, I would just do this at the command line with a one-liner (that&#39;s how I wrote it):</p>

<pre>
perl -MBio::SeqIO -M&#39;List::MoreUtils qw(any)&#39; -E &#39;@ids = (1, 5, 10); $num = 0; $seqio = Bio::SeqIO-&gt;new(-fh =&gt; \*STDIN); while ($seq = $seqio-&gt;next_seq) { $num++; say join &quot;\n&quot;, &quot;&gt;&quot;.$seq-&gt;id, $seq-&gt;seq if any { $_ == $num } @ids; }&#39; &lt; seqs.fas</pre>

<p>That will save you from opening an editor. It&#39;s not as readable but it works the same. :)</p>
