Skip to content

Commit

Permalink
uncouple deepvariant from gatk combinevariants (#1843)
Browse files Browse the repository at this point in the history
* uncouple deepvariant from combinevariants

* Add CLI option to combine vcf output from specific recipes

* Update variable names Glnexus recipe

* Fix github action errors

* Fix github action errors

* Fix github action error
  • Loading branch information
ramprasadn committed Mar 23, 2021
1 parent 8c31b90 commit 4fedaaf
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 23 deletions.
6 changes: 6 additions & 0 deletions definitions/rd_dna_panel_parameters.yaml
Expand Up @@ -759,6 +759,12 @@ gatk_combinevariants_prioritize_caller:
data_type: SCALAR
mandatory: no
type: recipe_argument
gatk_combinevariants_callers_to_combine:
associated_recipe:
- gatk_combinevariantcallsets
data_type: ARRAY
mandatory: no
type: recipe_argument
## bcftools norm
bcftools_norm:
analysis_mode: case
Expand Down
16 changes: 11 additions & 5 deletions definitions/rd_dna_parameters.yaml
Expand Up @@ -534,7 +534,7 @@ gatk_baserecalibration:
associated_recipe:
- mip
data_type: SCALAR
default: 0
default: 1
file_tag: _brecal
outfile_suffix: ".bam"
program_executables:
Expand Down Expand Up @@ -1201,7 +1201,7 @@ gatk_haplotypecaller:
associated_recipe:
- mip
data_type: SCALAR
default: 0
default: 1
file_tag: _haptc
outfile_suffix: ".vcf"
program_executables:
Expand Down Expand Up @@ -1272,7 +1272,7 @@ gatk_genotypegvcfs:
associated_recipe:
- mip
data_type: SCALAR
default: 0
default: 1
file_tag: _gent
outfile_suffix: ".vcf"
program_executables:
Expand All @@ -1297,7 +1297,7 @@ gatk_gathervcfs:
associated_recipe:
- mip
data_type: SCALAR
default: 0
default: 1
file_tag: ""
outfile_suffix: ".vcf"
program_executables:
Expand All @@ -1315,7 +1315,7 @@ gatk_variantrecalibration:
associated_recipe:
- mip
data_type: SCALAR
default: 0
default: 1
file_tag: _vrecal
program_executables:
- bcftools
Expand Down Expand Up @@ -1470,6 +1470,12 @@ gatk_combinevariants_prioritize_caller:
data_type: SCALAR
mandatory: no
type: recipe_argument
gatk_combinevariants_callers_to_combine:
associated_recipe:
- gatk_combinevariantcallsets
data_type: ARRAY
mandatory: no
type: recipe_argument
prepareforvariantannotationblock:
analysis_mode: case
associated_recipe:
Expand Down
9 changes: 9 additions & 0 deletions lib/MIP/Cli/Mip/Analyse/Rd_dna.pm
Expand Up @@ -1403,6 +1403,15 @@ q{Number of hom-ref genotypes to infer at sites not present in a panel. Connecte
)
);

option(
q{gatk_combinevariants_callers_to_combine} => (
cmd_flag => q{gatk_combinevar_use_callers},
documentation => q{Combine vcf output from these recipes},
is => q{rw},
isa => enum( [qw{ gatk_variantcalibration glnexus_merge }] ),
)
);

option(
q{gatk_variantevalall} => (
cmd_tags => [q{Analysis recipe switch}],
Expand Down
9 changes: 9 additions & 0 deletions lib/MIP/Cli/Mip/Analyse/Rd_dna_panel.pm
Expand Up @@ -835,6 +835,15 @@ q{Number of hom-ref genotypes to infer at sites not present in a panel. Connecte
)
);

option(
q{gatk_combinevariants_callers_to_combine} => (
cmd_flag => q{gatk_combinevar_use_callers},
documentation => q{Combine vcf output from these recipes},
is => q{rw},
isa => enum( [qw{ gatk_variantcalibration glnexus_merge }] ),
)
);

option(
q{gatk_variantevalall} => (
cmd_tags => [q{Analysis recipe switch}],
Expand Down
12 changes: 6 additions & 6 deletions lib/MIP/Recipes/Analysis/Gatk_combinevariantcallsets.pm
Expand Up @@ -135,13 +135,13 @@ sub analysis_gatk_combinevariantcallsets {
my @variant_callers;

## Only process active callers
CALLER:
foreach my $variant_caller ( @{ $parameter_href->{cache}{variant_callers} } ) {
if ( $active_parameter_href->{$variant_caller} ) {

push @variant_callers, $variant_caller;
CALLER:
foreach my $variant_caller ( @{ $active_parameter_href->{gatk_combinevariants_callers_to_combine} } ) {
if ( $active_parameter_href->{$variant_caller} ) {

push @variant_callers, $variant_caller;
}
}
}

## Stores the parallel chains that job ids should be inherited from
my @parallel_chains;
Expand Down
21 changes: 16 additions & 5 deletions lib/MIP/Recipes/Analysis/Glnexus.pm
Expand Up @@ -118,7 +118,7 @@ sub analysis_glnexus {
use MIP::Program::Htslib qw{ htslib_bgzip };
use MIP::Processmanagement::Processes qw{ submit_recipe };
use MIP::Recipe qw{ parse_recipe_prerequisites };
use MIP::Sample_info qw{ set_recipe_outfile_in_sample_info };
use MIP::Sample_info qw{ set_file_path_to_store set_recipe_outfile_in_sample_info };
use MIP::Script::Setup_script qw{ setup_script };

### PREPROCESSING:
Expand Down Expand Up @@ -173,7 +173,7 @@ sub analysis_glnexus {
);

my $outfile_path_prefix = $io{out}{file_path_prefix};
my $outfile_path =
my $temp_outfile_path =
catdir( $active_parameter_href->{temp_directory}, $io{out}{file_name_prefix} . q{.vcf} );

## Filehandles
Expand Down Expand Up @@ -211,7 +211,7 @@ sub analysis_glnexus {
filehandle => $filehandle,
infile_paths_ref => \@genotype_infile_paths,
memory => $memory,
stdoutfile_path => $outfile_path,
stdoutfile_path => $temp_outfile_path,
threads => $core_number,
}
);
Expand All @@ -223,7 +223,7 @@ sub analysis_glnexus {
{
filehandle => $filehandle,
index_type => q{tbi},
infile_path => $outfile_path,
infile_path => $temp_outfile_path,
outfile_path_prefix => $outfile_path_prefix,
output_type => q{z},
threads => $core_number,
Expand Down Expand Up @@ -251,7 +251,18 @@ sub analysis_glnexus {

set_recipe_outfile_in_sample_info(
{
path => $outfile_path,
path => $outfile_path_prefix . q{.vcf.gz},
recipe_name => $recipe_name,
sample_info_href => $sample_info_href,
}
);

set_file_path_to_store(
{
format => q{vcf},
id => $case_id,
path => $outfile_path_prefix . q{.vcf.gz},
path_index => $outfile_path_prefix . q{.vcf.gz.tbi},
recipe_name => $recipe_name,
sample_info_href => $sample_info_href,
}
Expand Down
4 changes: 2 additions & 2 deletions lib/MIP/Recipes/Pipeline/Analyse_rd_dna_panel.pm
Expand Up @@ -232,8 +232,8 @@ sub parse_rd_dna_panel {
## Check that all active variant callers have a prioritization order and that the prioritization elements match a supported variant caller
parse_prioritize_variant_callers(
{
active_parameter_href => $active_parameter_href,
parameter_href => $parameter_href,
active_parameter_href => $active_parameter_href,
parameter_href => $parameter_href,
}
);

Expand Down
6 changes: 3 additions & 3 deletions t/analysis_gatk_combinevariantcallsets.t
Expand Up @@ -65,11 +65,11 @@ $active_parameter{gatk_variantrecalibration} = 1;
$active_parameter{glnexus_merge} = 1;
$active_parameter{recipe_core_number}{$recipe_name} = 1;
$active_parameter{recipe_time}{$recipe_name} = 1;
$active_parameter{gatk_combinevariants_callers_to_combine} = [ qw( gatk_variantrecalibration glnexus_merge ) ];
my $case_id = $active_parameter{case_id};
$active_parameter{gatk_path} = q{gatk.jar};
$active_parameter{gatk_combinevariantcallsets_bcf_file} = 1;

my @variant_callers = qw{ gatk_variantrecalibration glnexus_merge };

my %file_info = test_mip_hashes(
{
Expand All @@ -86,7 +86,7 @@ my %parameter = test_mip_hashes(
);

CALLER:
foreach my $caller (@variant_callers) {
foreach my $caller ( @{ $active_parameter{gatk_combinevariants_callers_to_combine} } ) {

test_add_io_for_recipe(
{
Expand Down Expand Up @@ -133,7 +133,7 @@ my $is_ok = analysis_gatk_combinevariantcallsets(
ok( $is_ok, q{ Executed analysis recipe } . $recipe_name . q{ multiple callers} );

## Given analysis parameters and single callers
@{ $parameter{cache}{variant_callers} } = $parameter{cache}{variant_callers}[0];
$active_parameter{gatk_combinevariants_callers_to_combine} = [ qw{ gatk_variantrecalibration } ];
$is_ok = analysis_gatk_combinevariantcallsets(
{
active_parameter_href => \%active_parameter,
Expand Down
5 changes: 4 additions & 1 deletion templates/grch38_mip_rd_dna_config.yaml
Expand Up @@ -66,7 +66,10 @@ vcfanno_config: grch38_vcfanno_config_-v0.1-.toml
### Analysis
## Programs
## Parameters
gatk_combinevariants_prioritize_caller: deepvariant
gatk_combinevariants_prioritize_caller: deepvariant,haplotypecaller
gatk_combinevariants_callers_to_combine:
- gatk_variantrecalibration
- glnexus_merge
gatk_path: /opt/conda/opt/gatk-3.8
qccollect_sampleinfo_file: cluster_constant_path!/case_id!/analysis_constant_path!/case_id!_qc_sample_info.yaml
picardtools_path: /usr/picard/
Expand Down
5 changes: 4 additions & 1 deletion templates/mip_rd_dna_config.yaml
Expand Up @@ -47,7 +47,10 @@ fqf_annotations:
- GNOMADAF
- GNOMADAF_popmax
- SWEGENAF
gatk_combinevariants_prioritize_caller: deepvariant
gatk_combinevariants_prioritize_caller: deepvariant,haplotypecaller
gatk_combinevariants_callers_to_combine:
- gatk_variantrecalibration
- glnexus_merge
gatk_path: /usr
picardtools_path: /usr/picard
qccollect_sampleinfo_file: cluster_constant_path!/case_id!/analysis_constant_path!/case_id!_qc_sample_info.yaml
Expand Down
3 changes: 3 additions & 0 deletions templates/mip_rd_dna_panel_config.yaml
Expand Up @@ -33,6 +33,9 @@ fqf_annotations:
- GNOMADAF_popmax
- SWEGENAF
gatk_combinevariants_prioritize_caller: haplotypecaller
gatk_combinevariants_callers_to_combine:
- gatk_variantrecalibration
- glnexus_merge
picardtools_path: /usr/picard
qccollect_sampleinfo_file: cluster_constant_path!/case_id!/analysis_constant_path!/case_id!_qc_sample_info.yaml
vep_custom_annotation:
Expand Down

0 comments on commit 4fedaaf

Please sign in to comment.