update obsolete go and po locus annotations
[phenome.git] / bin / loci_gene_model_match.pl
blob03943f7226a22b05ef4cb478d0f130118655c764
1 #!/usr/bin/env perl
2 use strict;
3 use warnings;
4 use English;
5 use Carp;
6 use FindBin;
7 use Getopt::Std;
9 use Data::Dumper;
11 use Bio::FeatureIO;
13 use CXGN::ITAG::Release;
15 sub usage {
16 my $message = shift || '';
17 $message = "Error: $message\n" if $message;
18 die <<EOU;
19 $message
20 Usage:
21 $FindBin::Script
23 Script to get some stuff or something. (Naama should rewrite this)
25 Options:
27 none yet
29 EOU
31 sub HELP_MESSAGE {usage()}
33 our %opt;
34 getopts('',\%opt) or usage();
36 my ($curr_pipeline) = CXGN::ITAG::Release->find();
37 $curr_pipeline or die 'no current ITAG pipeline found in base dir '.CXGN::ITAG::Release->releases_root_dir;
39 my $annotation_file = $curr_pipeline->get_file_info('combi_genomic_gff3')->{file};
41 open my $loci_matches, "grep ITAG_sgn_loci $annotation_file |"
42 or die "$! running grep on $annotation_file";
44 while (my $line = <$loci_matches> ) {
45 chomp $line;
46 my ($seq,$source,$type,$start,$end,$score,$dir,$phase,$attrs) = split /\s+/,$line,9;
47 next unless $source eq 'ITAG_sgn_loci';
48 my %attrs = map split(/(?<=[^\\])=/,$_), split(/(?<=[^\\]);/,$attrs);
49 print "got match for $attrs{Name} on $seq from $start to $end\n";