limit fstBC to 30bp in Python3 ver.
[GalaxyCodeBases.git] / perl / etc / WoodyMiaoLin / PbeBefore2015 / rename0.pl
bloba9c8093e940a10f0898b5d647ced57ef8df6cb82
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
5 open I1, "<", "cytb_accession_number.txt";
6 open I2, "<", "cytb_sequence.fasta";
7 open O, ">", "cytb_rename.fa";
9 my %name;
10 while (<I1>) {
11 chomp;
12 my @a = split /\t/;
13 $name{$a[1]} = "$a[1]_$a[2]";
15 close I1;
17 my %fa;
18 while (<I2>) {
19 $/ = ">";
20 my $seq = <I2>;
21 chomp $seq;
22 $seq =~ s/\s//g;
23 $/ = "\n";
24 /([ABGU]{2}[0-9]{6})/;
25 print O ">$name{$1}\n$seq\n";
27 close I2;
28 close O;