<?xml version='1.0'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
	<title><![CDATA[BOL: Extract a range from genome file with perl.]]></title>
	<link>https://bioinformaticsonline.com/snippets/view/31103/extract-a-range-from-genome-file-with-perl?</link>
	<atom:link href="https://bioinformaticsonline.com/snippets/view/31103/extract-a-range-from-genome-file-with-perl?" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/31103/extract-a-range-from-genome-file-with-perl</guid>
	<pubDate>Fri, 24 Feb 2017 09:30:11 -0600</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/31103/extract-a-range-from-genome-file-with-perl</link>
	<title><![CDATA[Extract a range from genome file with perl.]]></title>
	<description><![CDATA[<code>#!/usr/bin/perl 

use strict;
use warnings;
use Bio::SeqIO;

my $in_file = $ARGV[0];
my $start_pos = $ARGV[1];
my $end_pos = $ARGV[2];

my $in = Bio::SeqIO-&gt;new ( -file =&gt; $in_file, -format =&gt; &#039;fasta&#039;);
my $out = Bio::SeqIO-&gt;new( -file =&gt; &quot;&gt;$in_file.out&quot;, -format =&gt; &#039;fasta&#039;);


while (my $seq = $in-&gt;next_seq() ) {

    $seq-&gt;display_id( $seq-&gt;display_id() . &quot;_$start_pos-$end_pos&quot; );
    $out-&gt;write_seq( $seq-&gt;trunc($start_pos, $end_pos) );
}</code>]]></description>
	<dc:creator>Abhimanyu Singh</dc:creator>
</item>

</channel>
</rss>