-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Emil Bertilsson
committed
Dec 17, 2021
1 parent
af92035
commit 18326d2
Showing
11 changed files
with
2,437 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
#!/usr/bin/env perl | ||
|
||
use 5.026; | ||
use Carp; | ||
use charnames qw{ :full :short }; | ||
use English qw{ -no_match_vars }; | ||
use File::Basename qw{ dirname }; | ||
use File::Spec::Functions qw{ catdir catfile }; | ||
use FindBin qw{ $Bin }; | ||
use open qw{ :encoding(UTF-8) :std }; | ||
use Params::Check qw{ allow check last_error }; | ||
use Test::More; | ||
use utf8; | ||
use warnings qw{ FATAL utf8 }; | ||
|
||
## CPANM | ||
use autodie qw { :all }; | ||
use Modern::Perl qw{ 2018 }; | ||
use Test::Trap; | ||
|
||
## MIPs lib/ | ||
use lib catdir( dirname($Bin), q{lib} ); | ||
use MIP::Constants qw{ $COLON $COMMA $SPACE }; | ||
use MIP::Test::Fixtures qw{ test_add_io_for_recipe test_log test_mip_hashes }; | ||
|
||
BEGIN { | ||
|
||
use MIP::Test::Fixtures qw{ test_import }; | ||
|
||
### Check all internal dependency modules and imports | ||
## Modules with import | ||
my %perl_module = ( | ||
q{MIP::Recipes::Analysis::Gatk_collectreadcounts} => | ||
[qw{ analysis_gatk_collectreadcounts }], | ||
q{MIP::Test::Fixtures} => [qw{ test_add_io_for_recipe test_log test_mip_hashes }], | ||
); | ||
|
||
test_import( { perl_module_href => \%perl_module, } ); | ||
} | ||
|
||
use MIP::Recipes::Analysis::Gatk_collectreadcounts qw{ analysis_gatk_collectreadcounts }; | ||
|
||
diag( q{Test analysis_gatk_collectreadcounts from Gatk_collectreadcounts.pm} | ||
. $COMMA | ||
. $SPACE . q{Perl} | ||
. $SPACE | ||
. $PERL_VERSION | ||
. $SPACE | ||
. $EXECUTABLE_NAME ); | ||
|
||
my $log = test_log( { log_name => q{MIP}, no_screen => 1, } ); | ||
|
||
## Given analysis parameters | ||
my $recipe_name = q{gatk_collectreadcounts}; | ||
my $slurm_mock_cmd = catfile( $Bin, qw{ data modules slurm-mock.pl } ); | ||
|
||
my %active_parameter = test_mip_hashes( | ||
{ | ||
mip_hash_name => q{active_parameter}, | ||
recipe_name => $recipe_name, | ||
} | ||
); | ||
$active_parameter{$recipe_name} = 1; | ||
$active_parameter{recipe_core_number}{$recipe_name} = 1; | ||
$active_parameter{recipe_time}{$recipe_name} = 1; | ||
my $sample_id = $active_parameter{sample_ids}[0]; | ||
|
||
my %file_info = test_mip_hashes( | ||
{ | ||
mip_hash_name => q{file_info}, | ||
recipe_name => $recipe_name, | ||
} | ||
); | ||
|
||
my %job_id; | ||
my %parameter = test_mip_hashes( | ||
{ | ||
mip_hash_name => q{recipe_parameter}, | ||
recipe_name => $recipe_name, | ||
} | ||
); | ||
|
||
test_add_io_for_recipe( | ||
{ | ||
file_info_href => \%file_info, | ||
id => $sample_id, | ||
outfile_suffix => q{.hdf5}, | ||
parameter_href => \%parameter, | ||
recipe_name => $recipe_name, | ||
step => q{bam}, | ||
} | ||
); | ||
|
||
my %sample_info = test_mip_hashes( | ||
{ | ||
mip_hash_name => q{qc_sample_info}, | ||
recipe_name => $recipe_name, | ||
} | ||
); | ||
|
||
my $is_ok = analysis_gatk_collectreadcounts( | ||
{ | ||
active_parameter_href => \%active_parameter, | ||
file_info_href => \%file_info, | ||
job_id_href => \%job_id, | ||
parameter_href => \%parameter, | ||
profile_base_command => $slurm_mock_cmd, | ||
recipe_name => $recipe_name, | ||
sample_id => $sample_id, | ||
sample_info_href => \%sample_info, | ||
} | ||
); | ||
|
||
## Then return TRUE | ||
ok( $is_ok, q{ Executed analysis recipe } . $recipe_name ); | ||
|
||
done_testing(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
#!/usr/bin/env perl | ||
|
||
use 5.026; | ||
use Carp; | ||
use charnames qw{ :full :short }; | ||
use English qw{ -no_match_vars }; | ||
use File::Basename qw{ dirname }; | ||
use File::Spec::Functions qw{ catdir catfile }; | ||
use FindBin qw{ $Bin }; | ||
use open qw{ :encoding(UTF-8) :std }; | ||
use Params::Check qw{ allow check last_error }; | ||
use Test::More; | ||
use utf8; | ||
use warnings qw{ FATAL utf8 }; | ||
|
||
## CPANM | ||
use autodie qw { :all }; | ||
use Modern::Perl qw{ 2018 }; | ||
use Test::Trap; | ||
|
||
## MIPs lib/ | ||
use lib catdir( dirname($Bin), q{lib} ); | ||
use MIP::Constants qw{ $COLON $COMMA $SPACE }; | ||
use MIP::Test::Fixtures qw{ test_add_io_for_recipe test_log test_mip_hashes }; | ||
|
||
BEGIN { | ||
|
||
use MIP::Test::Fixtures qw{ test_import }; | ||
|
||
### Check all internal dependency modules and imports | ||
## Modules with import | ||
my %perl_module = ( | ||
q{MIP::Recipes::Analysis::Gatk_denoisereadcounts} => | ||
[qw{ analysis_gatk_denoisereadcounts }], | ||
q{MIP::Test::Fixtures} => [qw{ test_add_io_for_recipe test_log test_mip_hashes }], | ||
); | ||
|
||
test_import( { perl_module_href => \%perl_module, } ); | ||
} | ||
|
||
use MIP::Recipes::Analysis::Gatk_denoisereadcounts qw{ analysis_gatk_denoisereadcounts }; | ||
|
||
diag( q{Test analysis_gatk_denoisereadcounts from Gatk_denoisereadcounts.pm} | ||
. $COMMA | ||
. $SPACE . q{Perl} | ||
. $SPACE | ||
. $PERL_VERSION | ||
. $SPACE | ||
. $EXECUTABLE_NAME ); | ||
|
||
my $log = test_log( { log_name => q{MIP}, no_screen => 1, } ); | ||
|
||
## Given analysis parameters | ||
my $recipe_name = q{gatk_denoisereadcounts}; | ||
my $slurm_mock_cmd = catfile( $Bin, qw{ data modules slurm-mock.pl } ); | ||
|
||
my %active_parameter = test_mip_hashes( | ||
{ | ||
mip_hash_name => q{active_parameter}, | ||
recipe_name => $recipe_name, | ||
} | ||
); | ||
$active_parameter{$recipe_name} = 1; | ||
$active_parameter{recipe_core_number}{$recipe_name} = 1; | ||
$active_parameter{recipe_time}{$recipe_name} = 1; | ||
my $sample_id = $active_parameter{sample_ids}[0]; | ||
|
||
my %file_info = test_mip_hashes( | ||
{ | ||
mip_hash_name => q{file_info}, | ||
recipe_name => $recipe_name, | ||
} | ||
); | ||
|
||
my %job_id; | ||
my %parameter = test_mip_hashes( | ||
{ | ||
mip_hash_name => q{recipe_parameter}, | ||
recipe_name => $recipe_name, | ||
} | ||
); | ||
|
||
test_add_io_for_recipe( | ||
{ | ||
file_info_href => \%file_info, | ||
id => $sample_id, | ||
outfile_suffix => q{.tsv}, | ||
parameter_href => \%parameter, | ||
recipe_name => $recipe_name, | ||
step => q{hdf5}, | ||
} | ||
); | ||
|
||
my %sample_info = test_mip_hashes( | ||
{ | ||
mip_hash_name => q{qc_sample_info}, | ||
recipe_name => $recipe_name, | ||
} | ||
); | ||
|
||
my $is_ok = analysis_gatk_denoisereadcounts( | ||
{ | ||
active_parameter_href => \%active_parameter, | ||
file_info_href => \%file_info, | ||
job_id_href => \%job_id, | ||
parameter_href => \%parameter, | ||
profile_base_command => $slurm_mock_cmd, | ||
recipe_name => $recipe_name, | ||
sample_id => $sample_id, | ||
sample_info_href => \%sample_info, | ||
} | ||
); | ||
|
||
## Then return TRUE | ||
ok( $is_ok, q{ Executed analysis recipe } . $recipe_name ); | ||
|
||
done_testing(); |
Oops, something went wrong.