ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/yamap/tRNA_parse_artemis.pl
Revision: 1.2
Committed: Thu Sep 28 13:14:52 2006 UTC (9 years, 8 months ago) by knirirr
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
Log Message:
Updated labels in parser scripts.

Line File contents
1 #!/usr/bin/perl -w
2
3
4 #################################################################
5 # Creates artemis tab file from tRNAscan output .
6 #################################################################
7
8 use strict;
9
10 unless (@ARGV ==2)
11 {
12 die "\n\nUsage:\n ./tRNA_parse_artemis.pl path2tRNA.out path2output\nPlease try again.\n\n\n";
13 }
14
15 my $path2tRNA = shift;
16 my $path2output = shift;
17
18 my ($header, @lines, $rs, $line, @temp, $start, $stop, $codon);
19
20 open (IN, "$path2tRNA");
21 @lines = <IN>;
22 close IN;
23 open (OUT, ">$path2output");
24
25 $header = 0;
26 $rs = "\t";
27
28 foreach $line (@lines)
29 {
30 $header++;
31 if ($header > 3)
32 {
33 $line =~s/\s+/$rs/g;
34 print "$line\n";
35 @temp = split /$rs/, $line;
36 $start = $temp[2];
37 $stop = $temp[3];
38 $codon = $temp[5];
39 if ($start > $stop)
40 {
41 print OUT "FT tRNA complement($stop"."..$start)\n";
42 print OUT "FT /colour=3\n";
43 print OUT "FT /note=\"predicted using tRNAscan-SE\"\n";
44 }
45 else
46 {
47 print OUT "FT tRNA $start"."..$stop\n";
48 print OUT "FT /colour=3\n";
49 print OUT "FT /note=\"predicted using tRNAscan-SE\"\n";
50 }
51 }
52 }