#!/usr/local/bin/perl -w
n_tests(2);
create_test_database(
"go_path"
);
my
$apph
= getapph();
my
$parser
= new GO::Parser ({
handler
=>
'db'
});
$parser
->xslt(
'oboxml_to_godb_prestore'
);
$parser
->handler->apph(
$apph
);
stmt_note(
'loading assocs'
);
$parser
->set_type(
'go_assoc'
);
$parser
->handler->optimize_by_dtype(
'go_assoc'
);
$parser
->acc2name_h(
$apph
->acc2name_h);
$parser
->cache_errors;
$parser
->parse(
"./t/data/gene_assoc-with-quals.mgi"
);
my
@errs
=
$parser
->errlist;
print
$_
->sxpr
foreach
@errs
;
stmt_note(
scalar
@errs
);
stmt_check(
@errs
==0);
my
$assocs
=
$apph
->get_associations({
acc
=>
"GO:0004842"
});
my
$ok
= 0;
foreach
my
$assoc
(
@$assocs
) {
if
(
$assoc
->is_not) {
my
@qs
=
map
{
$_
->acc} @{
$assoc
->qualifier_list};
if
((
grep
{
$_
eq
'not'
}
@qs
) && (
grep
{
$_
eq
'contributes_to'
}
@qs
)) {
$ok
= 1;
}
foreach
(@{
$assoc
->qualifier_list}) {
printf
"Q:%s\n"
,
$_
->acc;
}
}
}
stmt_check(
$ok
);