Skip to content

Commit

Permalink
Merge e158067 into 806d599
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikstranneheim committed Nov 6, 2020
2 parents 806d599 + e158067 commit 062927c
Show file tree
Hide file tree
Showing 179 changed files with 2,671 additions and 1,555 deletions.
22 changes: 22 additions & 0 deletions containers/perl/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
################## BASE IMAGE ######################

FROM perl:5.26

################## METADATA ######################

LABEL base_image="perl:5.26"
LABEL version="1"
LABEL software="perl"
LABEL software.version="5.26"
LABEL extra.binaries="perl"
LABEL maintainer="Clinical-Genomics/MIP"

RUN apt-get update && apt-get install -y --no-install-recommends locales locales-all \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

WORKDIR /data/
7 changes: 7 additions & 0 deletions definitions/analyse_parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ case_id:
- mip
data_type: SCALAR
type: mip
install_config_file:
associated_recipe:
- mip
data_type: SCALAR
default: 0
type: path
update_path: absolute_path
java_use_large_pages:
associated_recipe:
- varianteffectpredictor
Expand Down
1 change: 1 addition & 0 deletions definitions/dragen_rd_dna_parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ custom_default_parameters:
- conda_path
- exome_target_bed
- infile_dirs
- install_config_file
- pedigree_fam_file
- picardtools_path
- reference_dir
Expand Down
1 change: 1 addition & 0 deletions definitions/rd_dna_panel_parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ custom_default_parameters:
- bwa_mem2_build_reference
- exome_target_bed
- infile_dirs
- install_config_file
- pedigree_fam_file
- picardtools_path
- reference_dir
Expand Down
1 change: 1 addition & 0 deletions definitions/rd_dna_parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ custom_default_parameters:
- bwa_mem2_build_reference
- exome_target_bed
- infile_dirs
- install_config_file
- pedigree_fam_file
- picardtools_path
- reference_dir
Expand Down
1 change: 1 addition & 0 deletions definitions/rd_dna_vcf_rerun_parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ custom_default_parameters:
- conda_path
- exome_target_bed
- infile_dirs
- install_config_file
- pedigree_fam_file
- picardtools_path
- reference_dir
Expand Down
1 change: 1 addition & 0 deletions definitions/rd_rna_parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ custom_default_parameters:
- analysis_type
- conda_path
- infile_dirs
- install_config_file
- pedigree_fam_file
- picardtools_path
- reference_dir
Expand Down
36 changes: 35 additions & 1 deletion lib/MIP/Active_parameter.pm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ BEGIN {
use base qw{ Exporter };

# Set the version for version checking
our $VERSION = 1.32;
our $VERSION = 1.33;

# Functions and variables which can be optionally exported
our @EXPORT_OK = qw{
Expand All @@ -55,6 +55,7 @@ BEGIN {
set_default_conda_path
set_default_human_genome
set_default_infile_dirs
set_default_install_config_file
set_default_parameter
set_default_pedigree_fam_file
set_default_program_test_file
Expand Down Expand Up @@ -2108,6 +2109,39 @@ sub set_include_y {
return;
}

sub set_default_install_config_file {

## Function : Set default install config file to active parameters
## Returns :
## Arguments: $active_parameter_href => Holds all set parameter for analysis {REF}
## : $parameter_name => Parameter name

my ($arg_href) = @_;

## Flatten argument(s)
my $active_parameter_href;
my $parameter_name;

my $tmpl = {
active_parameter_href => {
default => {},
defined => 1,
required => 1,
store => \$active_parameter_href,
strict_type => 1,
},
parameter_name => { defined => 1, required => 1, store => \$parameter_name, },
};

check( $tmpl, $arg_href, 1 ) or croak q{Could not parse arguments!};

## Build default for mip install config
my $path = catfile( $Bin, qw{ templates mip_install_config.yaml } );

$active_parameter_href->{$parameter_name} = $path;
return;
}

sub set_parameter_reference_dir_path {

## Function : Set path for supplied reference(s) associated with parameter that should
Expand Down
10 changes: 9 additions & 1 deletion lib/MIP/Cli/Mip/Analyse.pm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use Moose::Util::TypeConstraints;
use MIP::Cli::Utils qw{ run };

# Set the version for version checking
our $VERSION = 1.15;
our $VERSION = 1.16;

extends(qw{ MIP::Cli::Mip });

Expand Down Expand Up @@ -132,6 +132,14 @@ q{Check analysis output and sets the analysis run status flag to finished in sam
)
);

option(
q{install_config_file} => (
documentation => q{File with install configuration parameters in YAML format},
is => q{rw},
isa => Str,
)
);

option(
q{java_use_large_pages} => (
documentation => q{Use large page memory},
Expand Down
34 changes: 33 additions & 1 deletion lib/MIP/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ BEGIN {
use base qw{ Exporter };

# Set the version for version checking
our $VERSION = 1.06;
our $VERSION = 1.07;

# Functions and variables which can be optionally exported
our @EXPORT_OK = qw{ check_cmd_config_vs_definition_file
get_install_containers
parse_config
parse_dynamic_config_parameters
set_config_to_active_parameters
Expand Down Expand Up @@ -94,6 +95,37 @@ sub check_cmd_config_vs_definition_file {
return;
}

sub get_install_containers {

## Function : Get install containers from install config file
## Returns : $install_config{container}
## Arguments: $install_config_file => File with containers from install config

my ($arg_href) = @_;

## Flatten argument(s)
my $install_config_file;

my $tmpl = {
install_config_file => {
defined => 1,
required => 1,
store => \$install_config_file,
strict_type => 1,
},
};

check( $tmpl, $arg_href, 1 ) or croak q{Could not parse arguments!};

my %install_config = read_from_file(
{
format => q{yaml},
path => $install_config_file,
}
);
return %{ $install_config{container} };
}

sub parse_config {

## Function : Parse config by loading from cli, removing prior dynamic entries,
Expand Down
42 changes: 39 additions & 3 deletions lib/MIP/Constants.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use 5.026;
use Carp;
use charnames qw{ :full :short };
use English qw{ -no_match_vars };
use File::Spec::Functions qw{ catfile };
use open qw{ :encoding(UTF-8) :std };
use Params::Check qw{ allow check last_error };
use strict;
Expand Down Expand Up @@ -37,6 +38,7 @@ BEGIN {
$COLON
$COMMA
@CONTAINER_BIND_PATHS
%CONTAINER_CMD
$CONTAINER_MANAGER
$DASH
$DOLLAR_SIGN
Expand Down Expand Up @@ -64,6 +66,7 @@ BEGIN {
$SPACE
$TAB
$UNDERSCORE
set_container_cmd
set_container_constants
set_genome_build_constants
set_log_name_constant
Expand Down Expand Up @@ -349,6 +352,34 @@ Readonly our $SPACE => q{ };
Readonly our $TAB => qq{\t};
Readonly our $UNDERSCORE => q{_};
sub set_container_cmd {
## Function : Set container commands for each executable
## Returns :
## Arguments: $container_cmd_href => Analysis recipe hash {REF}
my ($arg_href) = @_;
## Flatten argument(s)
my $container_cmd_href;
my $tmpl = {
container_cmd_href => {
default => {},
defined => 1,
required => 1,
store => \$container_cmd_href,
strict_type => 1,
},
};
check( $tmpl, $arg_href, 1 ) or croak q{Could not parse arguments!};
Readonly our %CONTAINER_CMD => %{$container_cmd_href};
return;
}
sub set_container_constants {
## Function : Set container constants
Expand All @@ -372,12 +403,17 @@ sub set_container_constants {
check( $tmpl, $arg_href, 1 ) or croak q{Could not parse arguments!};
use MIP::Language::Shell qw{ quote_bash_variable };
use MIP::Environment::Path qw{ reduce_dir_paths };
my $temp_directory_quoted = quote_bash_variable(
{ string_with_variable_to_quote => $active_parameter_href->{temp_directory}, } );
my $xdg_runtime_dir =
$temp_directory_quoted . $COLON . catfile( $EMPTY_STR, qw{ run user $(id -u)} );
my @container_bind_paths = (
$active_parameter_href->{reference_dir},
$active_parameter_href->{outdata_dir},
$active_parameter_href->{temp_directory},
$active_parameter_href->{reference_dir}, $active_parameter_href->{outdata_dir},
$active_parameter_href->{temp_directory}, $xdg_runtime_dir,
);
@container_bind_paths = reduce_dir_paths(
Expand Down
Loading

0 comments on commit 062927c

Please sign in to comment.