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
Showing
6 changed files
with
277 additions
and
2 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
################## BASE IMAGE ###################### | ||
|
||
FROM clinicalgenomics/mip_base:2.1 | ||
|
||
################## METADATA ###################### | ||
|
||
LABEL base_image="clinicalgenomics/mip_base:2.1" | ||
LABEL version="1" | ||
LABEL software="HmtNote" | ||
LABEL software.version="0.7.2" | ||
LABEL extra.binaries="HmtNote" | ||
LABEL maintainer="Clinical-Genomics/MIP" | ||
|
||
RUN conda install pip python=3.7 | ||
|
||
## Clean up after conda | ||
RUN /opt/conda/bin/conda clean -tipsy | ||
|
||
RUN pip install --no-cache-dir hmtnote==0.7.2 | ||
|
||
RUN hmtnote dump | ||
|
||
WORKDIR /data/ |
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 |
---|---|---|
|
@@ -81,6 +81,7 @@ rd_dna: | |
- gatk4 | ||
- genmod | ||
- glnexus | ||
- hmtnote | ||
- htslib | ||
- manta | ||
- mip | ||
|
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,131 @@ | ||
package MIP::Program::HmtNote; | ||
|
||
use 5.026; | ||
use Carp; | ||
use charnames qw{ :full :short }; | ||
use English qw{ -no_match_vars }; | ||
use open qw{ :encoding(UTF-8) :std }; | ||
use Params::Check qw{ allow check last_error }; | ||
use utf8; | ||
use warnings; | ||
use warnings qw{ FATAL utf8 }; | ||
|
||
## CPANM | ||
use autodie qw{ :all }; | ||
use Readonly; | ||
|
||
## MIPs lib/ | ||
use MIP::Constants qw{ $SPACE }; | ||
use MIP::Environment::Executable qw{ get_executable_base_command }; | ||
use MIP::Unix::Standard_streams qw{ unix_standard_streams }; | ||
use MIP::Unix::Write_to_file qw{ unix_write_to_file }; | ||
|
||
BEGIN { | ||
require Exporter; | ||
use base qw{ Exporter }; | ||
|
||
# Set the version for version checking | ||
# Functions and variables which can be optionally exported | ||
our @EXPORT_OK = qw{ hmtnote_annotate }; | ||
} | ||
|
||
Readonly my $BASE_COMMAND => q{hmtnote}; | ||
|
||
sub hmtnote_annotate { | ||
|
||
## Function : Perl wrapper for hmtnote version 0.7.2 | ||
## Returns : @commands | ||
## Arguments: $filehandle => Filehandle to write to | ||
## : $infile_path => Input.vcf | ||
## : $offline => An argument if running the command offline | ||
## : $outfile_path => Annotate.vcf | ||
## : $stderrfile_path => Stderrfile path | ||
## : $stderrfile_path_append => Append stderr info to file path | ||
## : $stdinfile_path => Stdinfile path | ||
## : $stdoutfile_path => Stdoutfile path | ||
|
||
my ($arg_href) = @_; | ||
|
||
## Flatten argument(s) | ||
my $filehandle; | ||
my $infile_path; | ||
my $offline; | ||
my $outfile_path; | ||
my $stderrfile_path; | ||
my $stderrfile_path_append; | ||
my $stdinfile_path; | ||
my $stdoutfile_path; | ||
|
||
## Default(s) | ||
|
||
my $tmpl = { | ||
filehandle => { | ||
store => \$filehandle, | ||
}, | ||
infile_path => { | ||
defined => 1, | ||
required => 1, | ||
store => \$infile_path, | ||
strict_type => 1, | ||
}, | ||
offline => { | ||
allow => [ undef, 0, 1 ], | ||
store => \$offline, | ||
strict_type => 1, | ||
}, | ||
outfile_path => { | ||
defined => 1, | ||
required => 1, | ||
store => \$outfile_path, | ||
strict_type => 1, | ||
}, | ||
stderrfile_path => { | ||
store => \$stderrfile_path, | ||
strict_type => 1, | ||
}, | ||
stderrfile_path_append => { | ||
store => \$stderrfile_path_append, | ||
strict_type => 1, | ||
}, | ||
stdinfile_path => { store => \$stdinfile_path, strict_type => 1, }, | ||
stdoutfile_path => { | ||
store => \$stdoutfile_path, | ||
strict_type => 1, | ||
}, | ||
}; | ||
|
||
check( $tmpl, $arg_href, 1 ) or croak q{Could not parse arguments!}; | ||
|
||
my @commands = | ||
( get_executable_base_command( { base_command => $BASE_COMMAND, } ), qw{ annotate } ); | ||
|
||
push @commands, $infile_path; | ||
push @commands, $outfile_path; | ||
|
||
if ($offline) { | ||
|
||
push @commands, q{--offline}; | ||
} | ||
|
||
push @commands, | ||
unix_standard_streams( | ||
{ | ||
stderrfile_path => $stderrfile_path, | ||
stderrfile_path_append => $stderrfile_path_append, | ||
stdinfile_path => $stdinfile_path, | ||
stdoutfile_path => $stdoutfile_path, | ||
} | ||
); | ||
|
||
unix_write_to_file( | ||
{ | ||
commands_ref => \@commands, | ||
filehandle => $filehandle, | ||
separator => $SPACE, | ||
|
||
} | ||
); | ||
return @commands; | ||
} | ||
|
||
1; |
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,116 @@ | ||
#!/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 }; | ||
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 }; | ||
|
||
## MIPs lib/ | ||
use lib catdir( dirname($Bin), q{lib} ); | ||
use MIP::Constants qw{ $COMMA $SPACE }; | ||
use MIP::Test::Commands qw{ test_function }; | ||
|
||
BEGIN { | ||
|
||
use MIP::Test::Fixtures qw{ test_import }; | ||
|
||
### Check all internal dependency modules and imports | ||
## Modules with import | ||
my %perl_module = ( q{MIP::Program::HmtNote} => [qw{ hmtnote_annotate }], ); | ||
|
||
test_import( { perl_module_href => \%perl_module, } ); | ||
} | ||
|
||
use MIP::Program::HmtNote qw{ hmtnote_annotate }; | ||
|
||
diag( q{Test hmtnote_annotate from HmtNote.pm} | ||
. $COMMA | ||
. $SPACE . q{Perl} | ||
. $SPACE | ||
. $PERL_VERSION | ||
. $SPACE | ||
. $EXECUTABLE_NAME ); | ||
|
||
## Base arguments | ||
my @function_base_commands = qw{ hmtnote }; | ||
|
||
my %base_argument = ( | ||
filehandle => { | ||
input => undef, | ||
expected_output => \@function_base_commands, | ||
}, | ||
stderrfile_path => { | ||
input => q{stderrfile.test}, | ||
expected_output => q{2> stderrfile.test}, | ||
}, | ||
stderrfile_path_append => { | ||
input => q{stderrfile.test}, | ||
expected_output => q{2>> stderrfile.test}, | ||
}, | ||
stdoutfile_path => { | ||
input => q{stdoutfile.test}, | ||
expected_output => q{1> stdoutfile.test}, | ||
}, | ||
); | ||
|
||
## Can be duplicated with %base_argument and/or %specific_argument | ||
## to enable testing of each individual argument | ||
my %required_argument = ( | ||
infile_path => { | ||
input => q{myfile.vcf}, | ||
expected_output => q{myfile.vcf}, | ||
}, | ||
outfile_path => { | ||
input => q{outfile.vcf}, | ||
expected_output => q{outfile.vcf}, | ||
}, | ||
); | ||
|
||
my %specific_argument = ( | ||
offline => { | ||
input => 1, | ||
expected_output => q{--offline}, | ||
}, | ||
infile_path => { | ||
input => q{myfile.vcf}, | ||
expected_output => q{myfile.vcf}, | ||
}, | ||
outfile_path => { | ||
input => q{outfile.vcf}, | ||
expected_output => q{outfile.vcf}, | ||
}, | ||
); | ||
|
||
## Coderef - enables generalized use of generate call | ||
my $module_function_cref = \&hmtnote_annotate; | ||
|
||
## Test both base and function specific arguments | ||
my @arguments = ( \%base_argument, \%specific_argument ); | ||
|
||
ARGUMENT_HASH_REF: | ||
foreach my $argument_href (@arguments) { | ||
|
||
my @commands = test_function( | ||
{ | ||
argument_href => $argument_href, | ||
do_test_base_command => 1, | ||
function_base_commands_ref => \@function_base_commands, | ||
module_function_cref => $module_function_cref, | ||
required_argument_href => \%required_argument, | ||
} | ||
); | ||
} | ||
|
||
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