Skip to content

Commit

Permalink
Merge 2bc397c into 87de06a
Browse files Browse the repository at this point in the history
  • Loading branch information
jemten committed Sep 17, 2021
2 parents 87de06a + 2bc397c commit 0f4543b
Show file tree
Hide file tree
Showing 14 changed files with 247 additions and 109 deletions.
10 changes: 10 additions & 0 deletions definitions/dragen_rd_dna_parameters.yaml
Expand Up @@ -202,6 +202,16 @@ sv_fqa_annotations:
- GNOMADAF
- GNOMADAF_POPMAX
type: recipe_argument
sv_fqa_filters:
associated_recipe:
- sv_annotate
data_type: ARRAY
default:
- GNOMADAF
- GNOMADAF_POPMAX
- gnomad_sv
- clinical_genomics_loqus
type: recipe_argument
sv_bcftools_view_filter:
associated_recipe:
- sv_annotate
Expand Down
10 changes: 10 additions & 0 deletions definitions/rd_dna_parameters.yaml
Expand Up @@ -913,6 +913,16 @@ sv_fqa_annotations:
- GNOMADAF
- GNOMADAF_POPMAX
type: recipe_argument
sv_fqa_filters:
associated_recipe:
- sv_annotate
data_type: ARRAY
default:
- GNOMADAF
- GNOMADAF_POPMAX
- gnomad_sv
- clinical_genomics_loqus
type: recipe_argument
sv_bcftools_view_filter:
associated_recipe:
- sv_annotate
Expand Down
10 changes: 10 additions & 0 deletions definitions/rd_dna_vcf_rerun_parameters.yaml
Expand Up @@ -170,6 +170,16 @@ sv_fqa_annotations:
- GNOMADAF
- GNOMADAF_POPMAX
type: recipe_argument
sv_fqa_filters:
associated_recipe:
- sv_annotate
data_type: ARRAY
default:
- GNOMADAF
- GNOMADAF_POPMAX
- gnomad_sv
- clinical_genomics_loqus
type: recipe_argument
sv_bcftools_view_filter:
associated_recipe:
- sv_annotate
Expand Down
10 changes: 9 additions & 1 deletion lib/MIP/Cli/Mip/Analyse/Dragen_rd_dna.pm
Expand Up @@ -258,7 +258,15 @@ q{gatk_baserecalibration_known_sites, gatk_haplotypecaller_snp_known_set, gatk_v

option(
q{sv_fqa_annotations} => (
documentation => q{Frequency annotations to use when filtering },
documentation => q{Frequency annotations to use},
is => q{rw},
isa => ArrayRef,
)
);

option(
q{sv_fqa_filters} => (
documentation => q{Frequency annotations to use when filtering},
is => q{rw},
isa => ArrayRef,
)
Expand Down
8 changes: 8 additions & 0 deletions lib/MIP/Cli/Mip/Analyse/Rd_dna.pm
Expand Up @@ -799,6 +799,14 @@ q{Default: grch37_dbsnp_-138-.vcf, grch37_1000g_indels_-phase1-.vcf, grch37_mill

option(
q{sv_fqa_annotations} => (
documentation => q{Frequency annotations to use },
is => q{rw},
isa => ArrayRef,
)
);

option(
q{sv_fqa_filter} => (
documentation => q{Frequency annotations to use when filtering },
is => q{rw},
isa => ArrayRef,
Expand Down
10 changes: 9 additions & 1 deletion lib/MIP/Cli/Mip/Analyse/Rd_dna_vcf_rerun.pm
Expand Up @@ -213,7 +213,15 @@ q{gatk_baserecalibration_known_sites, gatk_haplotypecaller_snp_known_set, gatk_v

option(
q{sv_fqa_annotations} => (
documentation => q{Frequency annotations to use when filtering },
documentation => q{Frequency annotations to use},
is => q{rw},
isa => ArrayRef,
)
);

option(
q{sv_fqa_filter} => (
documentation => q{Frequency annotations to use when filtering},
is => q{rw},
isa => ArrayRef,
)
Expand Down
56 changes: 52 additions & 4 deletions lib/MIP/Program/Bcftools.pm
Expand Up @@ -210,6 +210,7 @@ sub bcftools_base {
## : $regions_ref => Regions to process {REF}
## : $samples_file_path => File of samples to annotate
## : $samples_ref => Samples to include or exclude if prefixed with "^"
## : $targets => Select target. Logical complement can be requested with "^" prefix
## : $threads => Extra compression threds in addition to main thread

my ($arg_href) = @_;
Expand All @@ -223,6 +224,7 @@ sub bcftools_base {
my $regions_ref;
my $samples_file_path;
my $samples_ref;
my $targets;
my $threads;

my $tmpl = {
Expand Down Expand Up @@ -261,6 +263,10 @@ sub bcftools_base {
store => \$samples_ref,
strict_type => 1,
},
targets => {
store => \$targets,
strict_type => 1,
},
threads => {
allow => [ undef, qr{\A \d+ \z}xms ],
store => \$threads,
Expand Down Expand Up @@ -298,6 +304,11 @@ sub bcftools_base {
push @commands, q{--output-type} . $SPACE . $output_type;
}

if ($targets) {

push @commands, q{--targets} . $SPACE . $targets;
}

if ($threads) {

push @commands, q{--threads} . $SPACE . $threads;
Expand Down Expand Up @@ -579,15 +590,15 @@ sub bcftools_concat {

sub bcftools_filter {

## Function : Perl wrapper for writing bcftools filter recipe to $filehandle or return commands array. Based on bcftools 1.6.
## Function : Perl wrapper for writing bcftools filter recipe to $filehandle or return commands array. Based on bcftools 1.13.
## Returns : @commands
## Arguments: $filehandle => Filehandle to write to
## : $exclude => Exclude sites for which the expression is true
## : $filter_mode => "+": do not replace but add to existing FILTER; "x": reset filters at sites which pass
## : $include => Include only sites for which the expression is true
## : $indel_gap => Filter clusters of indels separated by <int> or fewer base pairs allowing only one to pass
## : $infile_path => Infile paths
## : $outfile_path => Outfile path to write to
## : $outfile_path => Outfile path to write to/view
## : $output_type => 'b' compressed BCF; 'u' uncompressed BCF; 'z' compressed VCF; 'v' uncompressed VCF [v]
## : $regions_ref => Regions to process {REF}
## : $samples_file_path => File of samples to annotate
Expand All @@ -597,6 +608,8 @@ sub bcftools_filter {
## : $stdoutfile_path => Stdoutfile path
## : $stderrfile_path => Stderrfile path
## : $stderrfile_path_append => Append stderr info to file path
## : $targets => Select target. Logical complement can be requested with "^" prefix
## : $threads => Extra compression threds in addition to main thread

my ($arg_href) = @_;

Expand All @@ -616,6 +629,8 @@ sub bcftools_filter {
my $stdoutfile_path;
my $stderrfile_path;
my $stderrfile_path_append;
my $targets;
my $threads;

## Default(s)
my $output_type;
Expand Down Expand Up @@ -690,6 +705,15 @@ sub bcftools_filter {
store => \$stdoutfile_path,
strict_type => 1,
},
targets => {
store => \$targets,
strict_type => 1,
},
threads => {
allow => [ undef, qr{\A \d+ \z}xms ],
store => \$threads,
strict_type => 1,
},
};

check( $tmpl, $arg_href, 1 ) or croak q{Could not parse arguments!};
Expand All @@ -706,6 +730,8 @@ sub bcftools_filter {
regions_ref => $regions_ref,
samples_file_path => $samples_file_path,
samples_ref => $samples_ref,
targets => $targets,
threads => $threads,
}
);

Expand Down Expand Up @@ -975,7 +1001,7 @@ sub bcftools_merge {

sub bcftools_mpileup {

## Function : Perl wrapper for writing bcftools mpileup recipe to $filehandle. Based on bcftools 1.6 (using htslib 1.6).
## Function : Perl wrapper for writing bcftools mpileup recipe to $filehandle. Based on bcftools 1.13 (using htslib 1.13).
## Returns : @commands
## : $adjust_mq => Adjust mapping quality
## : $filehandle => Sbatch filehandle to write to
Expand All @@ -991,6 +1017,8 @@ sub bcftools_mpileup {
## : $stderrfile_path => Stderrfile path
## : $stderrfile_path_append => Stderrfile path append
## : $stdoutfile_path => Stdoutfile file path to write to
## : $targets => Select target. Logical complement can be requested with "^" prefix
## : $threads => Extra compression threds in addition to main thread

my ($arg_href) = @_;

Expand All @@ -1006,6 +1034,8 @@ sub bcftools_mpileup {
my $stderrfile_path;
my $stderrfile_path_append;
my $stdoutfile_path;
my $targets;
my $threads;

## Default(s)
my $adjust_mq;
Expand Down Expand Up @@ -1066,6 +1096,15 @@ sub bcftools_mpileup {
stderrfile_path => { store => \$stderrfile_path, strict_type => 1, },
stderrfile_path_append => { store => \$stderrfile_path_append, strict_type => 1, },
stdoutfile_path => { store => \$stdoutfile_path, strict_type => 1, },
targets => {
store => $targets,
strict_type => 1,
},
threads => {
allow => [ undef, qr{\A \d+ \z}xms ],
store => \$threads,
strict_type => 1,
},
};

check( $tmpl, $arg_href, 1 ) or croak q{Could not parse arguments!};
Expand All @@ -1082,6 +1121,8 @@ sub bcftools_mpileup {
output_type => $output_type,
samples_file_path => $samples_file_path,
samples_ref => $samples_ref,
targets => $targets,
threads => $threads,
}
);

Expand Down Expand Up @@ -2058,6 +2099,7 @@ sub bcftools_view {
## : $stderrfile_path => Stderr file path to write to
## : $stderrfile_path_append => Append stderr info to file path
## : $stdoutfile_path => Stdoutfile file path to write to
## : $targets => Select target. Logical complement can be requested with "^" prefix
## : $threads => Number of threads to use
## : $types => Comma separated variant types to include (snps|indels|mnps|other), based on based on REF,ALT

Expand All @@ -2084,6 +2126,7 @@ sub bcftools_view {
my $stderrfile_path;
my $stderrfile_path_append;
my $stdoutfile_path;
my $targets;
my $threads;
my $types;

Expand Down Expand Up @@ -2143,7 +2186,11 @@ sub bcftools_view {
stderrfile_path => { store => \$stderrfile_path, strict_type => 1, },
stderrfile_path_append => { store => \$stderrfile_path_append, strict_type => 1, },
stdoutfile_path => { store => \$stdoutfile_path, strict_type => 1, },
threads => {
targets => {
store => \$targets,
strict_type => 1,
},
threads => {
allow => qr/ \A \d+ \z /xms,
store => \$threads,
strict_type => 1,
Expand All @@ -2168,6 +2215,7 @@ sub bcftools_view {
regions_ref => $regions_ref,
samples_file_path => $samples_file_path,
samples_ref => $samples_ref,
targets => $targets,
}
);

Expand Down

0 comments on commit 0f4543b

Please sign in to comment.