Skip to content

Commit

Permalink
Merge 3715665 into 3ac75d9
Browse files Browse the repository at this point in the history
  • Loading branch information
jemten committed Nov 10, 2020
2 parents 3ac75d9 + 3715665 commit f1d356b
Show file tree
Hide file tree
Showing 40 changed files with 758 additions and 531 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,4 +5,5 @@
!mip_install_perl.sh
mip_log/
**/.idea
_Deparsed_XSubs.pm
.gitignore
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [9.0.5]
- Predicted gender from wgs samples are now used in the generated fam files.
- Restrict plink analysis to intersected target capture kits for mixed wgs/wes cases

## [9.0.4]
- Increased memory allocation for samtools_subsample_mt
- Check that vep plugin paths exists prior to executing mip
Expand Down
2 changes: 1 addition & 1 deletion definitions/rd_dna_parameters.yaml
Expand Up @@ -1433,7 +1433,7 @@ gatk_combinevariantcallsets:
data_type: SCALAR
default: 1
file_tag: _gatkcomb
outfile_suffix: ".vcf"
outfile_suffix: ".vcf.gz"
type: recipe
gatk_combinevariantcallsets_bcf_file:
associated_recipe:
Expand Down
4 changes: 2 additions & 2 deletions lib/MIP/Constants.pm
Expand Up @@ -20,7 +20,7 @@ BEGIN {
use base qw{ Exporter };

# Set the version for version checking
our $VERSION = 1.25;
our $VERSION = 1.26;

# Functions and variables which can be optionally exported

Expand Down Expand Up @@ -80,7 +80,7 @@ Readonly our %ANALYSIS => (
);

## Set MIP version
Readonly our $MIP_VERSION => q{v9.0.4};
Readonly our $MIP_VERSION => q{v9.0.5};

## Cli
Readonly our $MOOSEX_APP_SCEEN_WIDTH => 160;
Expand Down
24 changes: 11 additions & 13 deletions lib/MIP/Get/File.pm
Expand Up @@ -25,32 +25,30 @@ BEGIN {
use base qw{ Exporter };

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

# Functions and variables which can be optionally exported
our @EXPORT_OK = qw{
get_exom_target_bed_file
get_exome_target_bed_file
get_io_files
get_merged_infile_prefix
get_path_entries
};
}

sub get_exom_target_bed_file {
sub get_exome_target_bed_file {

## Function : Get exome_target_bed file for specfic sample_id and add file_ending from file_info hash if supplied
## Returns : $exome_target_bed_file
## Arguments: $exome_target_bed_href => Exome target bed files lnked to sample ids
## : $file_ending => File ending to add to file
## : $log => Log object
## : $sample_id => Sample id

my ($arg_href) = @_;

## Flatten argument(s)
my $exome_target_bed_href;
my $file_ending;
my $log;
my $sample_id;

my $tmpl = {
Expand All @@ -62,12 +60,7 @@ sub get_exom_target_bed_file {
store => \$exome_target_bed_href,
},
file_ending => { store => \$file_ending },
log => {
required => 1,
defined => 1,
store => \$log
},
sample_id => {
sample_id => {
required => 1,
defined => 1,
strict_type => 1,
Expand All @@ -77,6 +70,11 @@ sub get_exom_target_bed_file {

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

### PREPROCESSING:

## Retrieve logger object
my $log = Log::Log4perl->get_logger($LOG_NAME);

## To track sample_ids with capture kits
my %seen;

Expand Down Expand Up @@ -111,7 +109,7 @@ sub get_exom_target_bed_file {
$log->fatal(
q{Could not detect }
. $sample_id
. q{ in '-exome_target_bed' associated files in sub routine get_exom_target_bed_file},
. q{ in '-exome_target_bed' associated files in sub routine get_exome_target_bed_file},
$NEWLINE
);
exit 1;
Expand Down Expand Up @@ -506,7 +504,7 @@ sub _collect_outfile {
strict_type => 1,
},
value => { defined => 1, required => 1, store => \$value, },
key => { defined => 1, store => \$key, required => 1, strict_type => 1, },
key => { defined => 1, store => \$key, required => 1, strict_type => 1, },
};

check( $tmpl, $arg_href, 1 ) or croak q{Could not parse arguments!};
Expand Down
7 changes: 3 additions & 4 deletions lib/MIP/Get/Parameter.pm
Expand Up @@ -20,7 +20,7 @@ BEGIN {
use base qw{ Exporter };

# Set the version for version checking
our $VERSION = 1.26;
our $VERSION = 1.27;

# Functions and variables which can be optionally exported
our @EXPORT_OK = qw{
Expand Down Expand Up @@ -115,19 +115,18 @@ sub get_gatk_intervals {

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

use MIP::Get::File qw{ get_exom_target_bed_file };
use MIP::Get::File qw{ get_exome_target_bed_file };
use MIP::File::Interval qw{ generate_contig_interval_file };

## Store gatk interval
my %gatk_intervals;

if ( $analysis_type eq q{wes} ) {

my $exome_target_bed_file = get_exom_target_bed_file(
my $exome_target_bed_file = get_exome_target_bed_file(
{
exome_target_bed_href => $exome_target_bed_href,
file_ending => $file_ending,
log => $log,
sample_id => $sample_id,
}
);
Expand Down
12 changes: 7 additions & 5 deletions lib/MIP/Main/Analyse.pm
Expand Up @@ -77,7 +77,7 @@ BEGIN {
require Exporter;

# Set the version for version checking
our $VERSION = 1.59;
our $VERSION = 1.60;

# Functions and variables which can be optionally exported
our @EXPORT_OK = qw{ mip_analyse };
Expand Down Expand Up @@ -461,7 +461,6 @@ sub mip_analyse {
case_id => $active_parameter_href->{case_id},
execution_mode => q{system},
fam_file_path => $active_parameter_href->{pedigree_fam_file},
parameter_href => $parameter_href,
sample_ids_ref => $active_parameter_href->{sample_ids},
sample_info_href => \%sample_info,
}
Expand Down Expand Up @@ -505,9 +504,12 @@ sub mip_analyse {

write_job_ids_to_file(
{
case_id => $active_parameter_href->{case_id},
job_id_href => \%job_id,
job_ids_file_path => catfile($active_parameter_href->{outdata_dir}, q{slurm_job_ids} . $DOT . q{yaml}),
case_id => $active_parameter_href->{case_id},
job_id_href => \%job_id,
job_ids_file_path => catfile(
$active_parameter_href->{outdata_dir},
q{slurm_job_ids} . $DOT . q{yaml}
),
}
);

Expand Down
34 changes: 33 additions & 1 deletion lib/MIP/Parse/Gender.pm
Expand Up @@ -36,7 +36,7 @@ BEGIN {
use base qw{ Exporter };

# Set the version for version checking
our $VERSION = 1.10;
our $VERSION = 1.11;

# Functions and variables which can be optionally exported
our @EXPORT_OK = qw{ build_stream_file_cmd
Expand Down Expand Up @@ -240,13 +240,15 @@ sub parse_fastq_for_gender {
## Arguments: $active_parameter_href => Active parameters for this analysis hash {REF}
## : $consensus_analysis_type => Consensus analysis_type
## : $file_info_href => File info hash {REF}
## : $sample_info_href => Sample info hash {REF}

my ($arg_href) = @_;

## Flatten argument(s)
my $active_parameter_href;
my $consensus_analysis_type;
my $file_info_href;
my $sample_info_href;

my $tmpl = {
active_parameter_href => {
Expand All @@ -269,6 +271,13 @@ sub parse_fastq_for_gender {
store => \$file_info_href,
strict_type => 1,
},
sample_info_href => {
default => {},
defined => 1,
required => 1,
store => \$sample_info_href,
strict_type => 1,
},
};

check( $tmpl, $arg_href, 1 ) or croak q{Could not parse arguments!};
Expand Down Expand Up @@ -371,6 +380,7 @@ sub parse_fastq_for_gender {
consensus_analysis_type => $consensus_analysis_type,
file_info_href => $file_info_href,
sample_id => $sample_id,
sample_info_href => $sample_info_href,
y_read_count => $y_read_count,
}
);
Expand All @@ -386,6 +396,7 @@ sub update_gender_info {
## : $consensus_analysis_type => Consensus analysis_type
## : $file_info_href => File info hash {REF}
## : $sample_id => Sample id
## : $sample_info_href => File info hash {REF}
## : $y_read_count => Y read count

my ($arg_href) = @_;
Expand All @@ -395,6 +406,7 @@ sub update_gender_info {
my $consensus_analysis_type;
my $file_info_href;
my $sample_id;
my $sample_info_href;
my $y_read_count;

my $tmpl = {
Expand Down Expand Up @@ -424,6 +436,13 @@ sub update_gender_info {
store => \$sample_id,
strict_type => 1,
},
sample_info_href => {
default => {},
defined => 1,
required => 1,
store => \$sample_info_href,
strict_type => 1,
},
y_read_count => {
required => 1,
store => \$y_read_count,
Expand All @@ -435,6 +454,7 @@ sub update_gender_info {
use MIP::Active_parameter
qw{ add_gender remove_sample_id_from_gender set_gender_estimation set_include_y };
use MIP::Contigs qw{ update_contigs_for_run };
use MIP::Sample_info qw{ set_sample_gender };

my $log = Log::Log4perl->get_logger($LOG_NAME);

Expand All @@ -445,6 +465,7 @@ sub update_gender_info {
my $genders = $gender . q{s};
$log->info(qq{Found $gender according to fastq reads});

## Update in active parameter hash
add_gender(
{
active_parameter_href => $active_parameter_href,
Expand Down Expand Up @@ -476,6 +497,17 @@ sub update_gender_info {
}
);

## Update gender in sample info hash
set_sample_gender(
{
gender => $gender,
sample_id => $sample_id,
sample_info_href => $sample_info_href,
}
);

## Update cache

## Update contigs depending on settings in run (wes or if only male samples)
update_contigs_for_run(
{
Expand Down

0 comments on commit f1d356b

Please sign in to comment.