5 if (scalar(@ARGV) != 2) {
6 print "Usage: extract-transcript-to-gene-map-from-trinity trinity_fasta_file map_file\n";
10 open(INPUT, $ARGV[0]);
11 open(OUTPUT, ">$ARGV[1]");
14 $tag = <INPUT>; chomp($tag);
15 while (substr($tag, 0, 1) eq ">") {
16 $tag = substr($tag, 1);
18 while (($line = <INPUT>) && substr($line, 0, 1) ne ">") {
21 if ($cnt == 0) { print "Warning: Fasta entry $tag has an empty sequence, it is omitted.\n"; }
23 my ($tid, @tmp) = split(/ /, $tag);
24 my ($comp, $c, @tmp) = split(/_/, $tag);
25 my $gid = join("_", $comp, $c);
26 print OUTPUT "$gid\t$tid\n";
28 $tag = $line; chomp($tag);