<?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: Format the fasta header]]></title>
	<link>https://bioinformaticsonline.com/snippets/view/33588/format-the-fasta-header?</link>
	<atom:link href="https://bioinformaticsonline.com/snippets/view/33588/format-the-fasta-header?" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/33588/format-the-fasta-header</guid>
	<pubDate>Sun, 18 Jun 2017 14:12:39 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/33588/format-the-fasta-header</link>
	<title><![CDATA[Format the fasta header]]></title>
	<description><![CDATA[<code>#!usr/bin/perl
    use strict;
    use warnings;

    my %id2seq = ();
    my $id = 0;
    open F,&quot;$ARGV[0]&quot;,or die $!;
    while(&lt;F&gt;){
        chomp;
        if($_ =~ /^&gt;(.+)/){
		$id++;
		s/\[//g; s/\]//g;
		my @val = split /\s+/, $_;
		my @newval=@val;
		shift @newval;
		print &quot;&gt;$id [ gene=$val[0] ] [ protein=@newval ]\n&quot;;
            #$id = $1;
        }else{
            print &quot;$_\n&quot;;
        }
    }
close F;</code>]]></description>
	<dc:creator>Jit</dc:creator>
</item>

</channel>
</rss>