Skip to content

Commit

Permalink
sort the returned values for test purposes; order of terms may not be…
Browse files Browse the repository at this point in the history
… important
  • Loading branch information
Chris Fields committed Aug 10, 2013
1 parent da78229 commit 4ad78e5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions t/Ontology/IO/obo.t
Expand Up @@ -30,7 +30,7 @@ is (scalar(@roots), 1);
is ($roots[0]->name(), "Sequence_Ontology");
is ($roots[0]->identifier(), "SO:0000000");

my @terms = $ont->get_child_terms($roots[0]);
my @terms = sort {$a->name cmp $b->name} $ont->get_child_terms($roots[0]);
is (scalar(@terms), 5);
my ($term) = grep { $_->name() eq "variation_operation"; } @terms;
ok $term;
Expand All @@ -43,7 +43,7 @@ ok $term;
($term) = grep { $_->name() eq "located_sequence_feature"; } @terms;
ok $term;

@terms = $ont->get_child_terms($terms[0]);
@terms = sort {$a->name cmp $b->name} $ont->get_child_terms($terms[4]);
is (scalar(@terms), 5);
($term) = grep { $_->name() eq "translocate"; } @terms;
ok $term;
Expand All @@ -57,7 +57,7 @@ ok $term;
ok $term;

my $featterm = $terms[0];
@terms = $ont->get_child_terms($featterm);
@terms = sort {$a->name cmp $b->name} $ont->get_child_terms($featterm);
is (scalar(@terms), 2);

# substitution has two parents, see whether this is handled
Expand Down Expand Up @@ -174,12 +174,12 @@ is($bioont->get_relationship_type('POSITIVELY_REGULATES')->name,'POSITIVELY_REGU


## -- getting relationships for various ontologies
my @onto_pred = $ontologies[0]->get_predicate_terms();
my @bio_pred = $bioont->get_predicate_terms();
my @onto_pred = sort {$a->name cmp $b->name} $ontologies[0]->get_predicate_terms();
my @bio_pred = sort {$a->name cmp $b->name} $bioont->get_predicate_terms();
is(scalar @onto_pred,6,'Got predicates for gene_ontology');
is(scalar @bio_pred,2,'Got predicates for biological_process');
is($onto_pred[3]->name(),'REGULATES','Got regulates predicate');
is($bio_pred[1]->name(),'POSITIVELY_REGULATES','Got positively regulates predicate');
is($onto_pred[4]->name(),'REGULATES','Got regulates predicate');
is($bio_pred[0]->name(),'POSITIVELY_REGULATES','Got positively regulates predicate');


my @bio_rel = $bioont->get_relationships();
Expand Down

0 comments on commit 4ad78e5

Please sign in to comment.