<?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: Perl script to rename the fasta file !]]></title>
	<link>https://bioinformaticsonline.com/snippets/view/43687/perl-script-to-rename-the-fasta-file?</link>
	<atom:link href="https://bioinformaticsonline.com/snippets/view/43687/perl-script-to-rename-the-fasta-file?" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/43687/perl-script-to-rename-the-fasta-file</guid>
	<pubDate>Wed, 29 Dec 2021 07:32:58 -0600</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/43687/perl-script-to-rename-the-fasta-file</link>
	<title><![CDATA[Perl script to rename the fasta file !]]></title>
	<description><![CDATA[<code>#Script #1
#!/usr/bin/perl -w
use strict;

#USAGE
#perl extractPattern.pl kmerfasta &gt; uniref100_result_broad

my %kHash;
local $/ = &#039;&gt;&#039;;
my $infile2 = &quot;$ARGV[0]&quot;; # Kmer fasta
open( FH2, &#039;&lt;&#039;, $infile2 ) or die $!;
while (&lt;FH2&gt;) {
my @allVal = split (&#039;\n&#039;, $_);
my $namewa;

for (my $j=0; $j&lt;scalar(@allVal); $j++) {
        next if ($allVal[$j] eq &quot;&gt;&quot;);
        if ($j == 0) {$namewa=$allVal[0]; next;}
        my $num=$j;
        my @lName=split(&#039; &#039;,$allVal[0]);
        #print &quot;$allVal[$j]\t$lName[0]\n&quot;;
        #$kHash{$allVal[$j]}=$lName[0];
        print &quot;&gt;$lName[0].$num\n$allVal[$j]\n&quot;;
      }
}</code>]]></description>
	<dc:creator>Abhi</dc:creator>
</item>

</channel>
</rss>