ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/yamap/glimmer_parse_artemis.pl
Revision: 1.1.1.1 (vendor branch)
Committed: Thu Sep 7 15:35:21 2006 UTC (9 years, 8 months ago) by knirirr
Branch: MAIN, cehox
CVS Tags: start, HEAD
Changes since 1.1: +0 -0 lines
Log Message:
Imported sources

Line File contents
1 #!/usr/bin/perl
2
3 # Script to run glimmer and parse glimmer output into EMBL formatted
4 # features for reading into Artemis annotation environment. The script
5 # requires a glimmer output file and produces EMBL formatted output to STDOUT and can piped to an appropriate
6 # output file, if not the EMBL format will be displayed on the screen.
7 #
8 # USAGE : glimmer_artmeis <glimmer output file> > (output tab file)
9 ###################################################################################
10 my $inter_output = $ARGV[0];
11 my $final_output = $inter_output . "tab";
12 parse_glimmer($inter_output, $final_output);
13
14 ###################################################################################
15 sub parse_glimmer
16 {
17 #subroutine variable declarations
18 my $glimmer; #filehandle for input
19 my $output; #filehandle for output
20 my $buffer; #input buffer
21 my $FLAG_parse=0; #FLAG to say it's time to parse
22 my $FLAG_shadow=0; #FLAG to say it's a shadowed gene
23 my @results; #results array for the genes
24 my $component; #component of the result, ie gene, start and stop
25 my $inx; #index counter
26
27 #get these variables from subroutine arguments
28 $glimmer = $_[0];
29 $output = $_[1];
30
31 open(GLIMMER, $glimmer) || die "cannot open the input $glimmer file";
32
33 while(<GLIMMER>){
34 if(/Shadowed/)
35 {
36 $FLAG_shadow = 1;
37 }
38 else
39 {
40 $FLAG_shadow = 0;
41 }
42 if(($FLAG_parse == 1) && ($FLAG_shadow == 0))
43 {
44 @results = split;
45 $gene = $results[0];
46 $start = $results[1];
47 $end = $results[2];
48
49 if($end < $start)
50 {
51 print("FT CDS complement($start..$end)\n");
52 print("FT \/note=\"predicted using Glimmer\"\n");
53 print("FT \/gene=\"\"\n");
54 }
55 else
56 {
57 print("FT CDS $start..$end\n");
58 print("FT \/note=\"predicted using Glimmer\"\n");
59 print("FT \/gene=\"\"\n");
60 }
61 }
62
63 if(/Putative/)
64 {
65 $FLAG_parse = 1;
66 }
67
68 }
69 }
70
71