annotate onto-toolkit/tools/ontology/get_intersection_ontology_from.pl @ 0:4484575e4186

Migrated tool version 0.1 from old tool shed archive to new tool shed repository
author erick-antezana
date Tue, 07 Jun 2011 17:51:45 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
4484575e4186 Migrated tool version 0.1 from old tool shed archive to new tool shed repository
erick-antezana
parents:
diff changeset
1 #!/usr/bin/perl -w
4484575e4186 Migrated tool version 0.1 from old tool shed archive to new tool shed repository
erick-antezana
parents:
diff changeset
2
4484575e4186 Migrated tool version 0.1 from old tool shed archive to new tool shed repository
erick-antezana
parents:
diff changeset
3 use OBO::Parser::OBOParser;
4484575e4186 Migrated tool version 0.1 from old tool shed archive to new tool shed repository
erick-antezana
parents:
diff changeset
4 use OBO::Util::Ontolome;
4484575e4186 Migrated tool version 0.1 from old tool shed archive to new tool shed repository
erick-antezana
parents:
diff changeset
5
4484575e4186 Migrated tool version 0.1 from old tool shed archive to new tool shed repository
erick-antezana
parents:
diff changeset
6
4484575e4186 Migrated tool version 0.1 from old tool shed archive to new tool shed repository
erick-antezana
parents:
diff changeset
7 use Carp;
4484575e4186 Migrated tool version 0.1 from old tool shed archive to new tool shed repository
erick-antezana
parents:
diff changeset
8 use strict;
4484575e4186 Migrated tool version 0.1 from old tool shed archive to new tool shed repository
erick-antezana
parents:
diff changeset
9 use warnings;
4484575e4186 Migrated tool version 0.1 from old tool shed archive to new tool shed repository
erick-antezana
parents:
diff changeset
10
4484575e4186 Migrated tool version 0.1 from old tool shed archive to new tool shed repository
erick-antezana
parents:
diff changeset
11 my @input_files = @ARGV;
4484575e4186 Migrated tool version 0.1 from old tool shed archive to new tool shed repository
erick-antezana
parents:
diff changeset
12
4484575e4186 Migrated tool version 0.1 from old tool shed archive to new tool shed repository
erick-antezana
parents:
diff changeset
13 my $parse_ont = OBO::Parser::OBOParser->new();
4484575e4186 Migrated tool version 0.1 from old tool shed archive to new tool shed repository
erick-antezana
parents:
diff changeset
14 my $ome = OBO::Util::Ontolome->new();
4484575e4186 Migrated tool version 0.1 from old tool shed archive to new tool shed repository
erick-antezana
parents:
diff changeset
15
4484575e4186 Migrated tool version 0.1 from old tool shed archive to new tool shed repository
erick-antezana
parents:
diff changeset
16 my @input_ontos;
4484575e4186 Migrated tool version 0.1 from old tool shed archive to new tool shed repository
erick-antezana
parents:
diff changeset
17 foreach(@input_files)
4484575e4186 Migrated tool version 0.1 from old tool shed archive to new tool shed repository
erick-antezana
parents:
diff changeset
18 {
4484575e4186 Migrated tool version 0.1 from old tool shed archive to new tool shed repository
erick-antezana
parents:
diff changeset
19 my $onto = $parse_ont->work($_) or warn "ontology not defined, check input files\n";
4484575e4186 Migrated tool version 0.1 from old tool shed archive to new tool shed repository
erick-antezana
parents:
diff changeset
20 push @input_ontos, $onto;
4484575e4186 Migrated tool version 0.1 from old tool shed archive to new tool shed repository
erick-antezana
parents:
diff changeset
21 }
4484575e4186 Migrated tool version 0.1 from old tool shed archive to new tool shed repository
erick-antezana
parents:
diff changeset
22
4484575e4186 Migrated tool version 0.1 from old tool shed archive to new tool shed repository
erick-antezana
parents:
diff changeset
23 my $intersection_ontology = $ome->intersection(@input_ontos);
4484575e4186 Migrated tool version 0.1 from old tool shed archive to new tool shed repository
erick-antezana
parents:
diff changeset
24 $intersection_ontology->export(\*STDOUT, "obo");
4484575e4186 Migrated tool version 0.1 from old tool shed archive to new tool shed repository
erick-antezana
parents:
diff changeset
25
4484575e4186 Migrated tool version 0.1 from old tool shed archive to new tool shed repository
erick-antezana
parents:
diff changeset
26 exit 0;
4484575e4186 Migrated tool version 0.1 from old tool shed archive to new tool shed repository
erick-antezana
parents:
diff changeset
27