#!/usr/bin/env perl
my
$seed
= 123456789;
my
$script
= catfile(
'utils'
,
'bff_pxf_simulator'
,
'bff-pxf-simulator'
);
my
$inc
=
join
' -I'
,
''
,
@INC
;
{
my
$reference_file
= catfile(
't'
,
'individuals_random_100.json'
);
my
(
undef
,
$tmp_file
) =
tempfile(
DIR
=>
't'
,
SUFFIX
=>
".json"
,
UNLINK
=> 1 );
system
(
"$^X $inc $script -n 100 -f bff -diseases 10 -max-diseases-pool 10 -phenotypicFeatures 10 -max-phenotypicFeatures-pool 10 -treatments 10 --max-treatments-pool 10 -procedures 10 -max-procedures-pool 10 -exposures 10 -max-exposures-pool 10 --random-seed $seed -o $tmp_file"
);
ok(
compare(
$tmp_file
,
$reference_file
) == 0,
qq/Output matches the <$reference_file> file/
);
}
{
my
$reference_file
= catfile(
't'
,
'pxf_random_100.json'
);
my
(
undef
,
$tmp_file
) =
tempfile(
DIR
=>
't'
,
SUFFIX
=>
".json"
,
UNLINK
=> 1 );
system
(
"$^X $inc $script -n 100 -f pxf -diseases 10 -max-diseases-pool 10 -phenotypicFeatures 10 -max-phenotypicFeatures-pool 10 -treatments 10 --max-treatments-pool 10 -procedures 10 -max-procedures-pool 10 --random-seed $seed -o $tmp_file"
);
ok(
compare(
$tmp_file
,
$reference_file
) == 0,
qq/Output matches the <$reference_file> file/
);
}
{
my
$reference_file
=
catfile(
't'
,
'individuals_random_100_ontologies.json'
);
my
$ont_file
= catfile(
't'
,
'ontologies.yaml'
);
my
(
undef
,
$tmp_file
) =
tempfile(
DIR
=>
't'
,
SUFFIX
=>
".json"
,
UNLINK
=> 1 );
system
(
"$^X $script -n 100 -f bff --external-ontologies $ont_file -diseases 1 -max-diseases-pool 1 -phenotypicFeatures 1 -max-phenotypicFeatures-pool 1 -treatments 1 -max-treatments-pool 1 --exposures 0 -procedures 0 --random-seed $seed -o $tmp_file"
);
TODO: {
local
$TODO
=
'failures due srand/rand system differences'
;
ok(
compare(
$tmp_file
,
$reference_file
) == 0,
qq/Output matches the <$reference_file> file/
);
}
}