Skip to content

Commit

Permalink
Merge 0cb727e into 7980631
Browse files Browse the repository at this point in the history
  • Loading branch information
jemten committed Oct 4, 2023
2 parents 7980631 + 0cb727e commit e549c33
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 17 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## Develop

- Adds loqudb and gnomad frequencies to vcf2cytosure filtering
- Store PCT_PF_READS_IMPROPER_PAIRS in qc file
- Evaluate and fail analysis where PCT_PF_READS_IMPROPER_PAIRS is above 5 %

## [12.0.0]

- Set overlap requirement for merging two SVs to 0.8, down from the 0.95 default
Expand Down
4 changes: 2 additions & 2 deletions definitions/rd_dna_parameters.yaml
Expand Up @@ -1057,7 +1057,7 @@ vcf2cytosure_exclude_filter:
associated_recipe:
- vcf2cytosure_ar
data_type: SCALAR
default: "'clingen_ngiAF > 0.1 || swegenAF > 0.05 || clinical_genomics_mipAF > 0.05 || decipherAF > 0.1'"
default: "'clingen_ngiAF > 0.1 || swegenAF > 0.05 || clinical_genomics_mipAF > 0.05 || decipherAF > 0.1 || clinical_genomics_loqusFrq > 0.05 || gnomad_svAF > 0.05'"
type: recipe_argument
vcf2cytosure_freq:
associated_recipe:
Expand All @@ -1069,7 +1069,7 @@ vcf2cytosure_freq_tag:
associated_recipe:
- vcf2cytosure_ar
data_type: SCALAR
default: FRQ
default: clinical_genomics_loqusFrq
type: recipe_argument
vcf2cytosure_maxbnd:
associated_recipe:
Expand Down
2 changes: 1 addition & 1 deletion lib/MIP/Main/Qccollect.pm
Expand Up @@ -555,7 +555,7 @@ sub parse_limit_qc_output {

return if not $limit_qc_output;

Readonly my @SKIP_QC_METRICS => qw{ collectmultiplemetrics variantevalall variantevalexome };
Readonly my @SKIP_QC_METRICS => qw{ variantevalall variantevalexome };

foreach my $delete_metric_key (@SKIP_QC_METRICS) {

Expand Down
3 changes: 1 addition & 2 deletions lib/MIP/Qccollect.pm
Expand Up @@ -455,7 +455,7 @@ sub define_evaluate_metric {

sub evaluate_analysis {

## Function : Read in aevaluate metrics and evaluate on sample and case level
## Function : Read in evaluation metrics and evaluate on sample and case level
## Returns :
## Arguments : eval_metric_file => File with evaluation metrics
## : qc_data_href => QC data {REF}
Expand Down Expand Up @@ -896,7 +896,6 @@ sub parse_sample_qc_metric {
$evaluate_metric_href->{$sample_id}{$recipe_name}{$metric},
}
);
next METRIC;
}
}
return 1;
Expand Down
4 changes: 4 additions & 0 deletions lib/MIP/Store.pm
Expand Up @@ -149,6 +149,10 @@ sub define_qc_metrics_to_store {
analysis_mode => q{sample},
recipe_name => q{collecthsmetrics},
},
PCT_PF_READS_IMPROPER_PAIRS => {
analysis_mode => q{sample},
recipe_name => q{collectmultiplemetrics},
},
PCT_TARGET_BASES_10X => {
analysis_mode => q{sample},
recipe_name => q{collecthsmetrics},
Expand Down
4 changes: 2 additions & 2 deletions t/parse_limit_qc_output.t
Expand Up @@ -47,7 +47,7 @@ my %qc_data = (
sample => {
sample_id => {
recipe_output_file => {
collectmultiplemetrics => {
variantevalall => {
header => q{data},
},
},
Expand All @@ -68,7 +68,7 @@ parse_limit_qc_output(
}
);

## Then remove key collectmultiplemetrics
## Then remove key variantevallall
my %expected_qc_data = (
sample => {
sample_id => {
Expand Down
32 changes: 22 additions & 10 deletions t/parse_sample_qc_metric.t
Expand Up @@ -49,20 +49,20 @@ diag( q{Test parse_sample_qc_metric from Qccollect.pm}

## Constants
Readonly my $PCT_TARGET_BASES_10X => 0.95;
Readonly my $FAIL_PCT_TARGET_BASES_10X => 0.90;
Readonly my $PERCENTAGE_MAPPED_READS_EVAL => 95;
Readonly my $PERCENTAGE_MAPPED_READS_PASS => 99;

## Given sample qc data when metric lacks a header
my $infile = q{an_infile};
my $metric = q{percentage_mapped_reads};
my $infile = q{an_infile};
my $metric = q{percentage_mapped_reads};
my $header_recipe = q{collecthsmetrics};
my $header_metric = q{PCT_TARGET_BASES_10X};
my $recipe = q{bamstats};
my $sample_id = q{ADM1059A1};
my %qc_data = (
my $recipe = q{bamstats};
my $sample_id = q{ADM1059A1};
my %qc_data = (
sample => {
$sample_id =>
{ $infile => { $recipe => { $metric => $PERCENTAGE_MAPPED_READS_PASS }, }, },
$sample_id => { $infile => { $recipe => { $metric => $PERCENTAGE_MAPPED_READS_PASS }, }, },
}
);

Expand Down Expand Up @@ -104,9 +104,13 @@ my $is_ok = parse_sample_qc_metric(
);
ok( $is_ok, q{Parsed sample qc data metrics} );

## Given sample qc data when metric has a header
my $data_header = q{first_of_pair};
$qc_data{sample}{$sample_id}{$infile}{$header_recipe}{header}{$data_header}{$header_metric} = $PCT_TARGET_BASES_10X;
## Given sample qc data when metric has headers
my $data_header = q{first_of_pair};
$qc_data{sample}{$sample_id}{$infile}{$header_recipe}{header}{$data_header}{$header_metric} =
$PCT_TARGET_BASES_10X;
my $second_data_header = q{second_of_pair};
$qc_data{sample}{$sample_id}{$infile}{$header_recipe}{header}{$second_data_header}{$header_metric}
= $FAIL_PCT_TARGET_BASES_10X;

## Alias
my $qc_data_header_recipe_href =
Expand All @@ -121,6 +125,14 @@ $is_ok = parse_sample_qc_metric(
sample_id => $sample_id,
}
);

## Then parses format OK...
ok( $is_ok, q{Parsed sample qc data header metrics} );

## ... and fails qc check for the second header
my $failed_evaluation =
q{FAILED:collecthsmetrics_PCT_TARGET_BASES_10X:} . $FAIL_PCT_TARGET_BASES_10X;
is( $qc_data{evaluation}{collecthsmetrics}[0],
$failed_evaluation, q{Fails qc on second data header} );

done_testing();
2 changes: 2 additions & 0 deletions templates/qc_eval_metric_-v1.3-.yaml
Expand Up @@ -28,6 +28,8 @@ wgs:
collectmultiplemetrics:
PCT_PF_READS_ALIGNED:
lt: 0.95
PCT_PF_READS_IMPROPER_PAIRS:
gt: 0.05
PCT_ADAPTER:
gt: 0.0005
markduplicates:
Expand Down

0 comments on commit e549c33

Please sign in to comment.