Skip to content

Commit

Permalink
Merge 3d1f071 into 12349ff
Browse files Browse the repository at this point in the history
  • Loading branch information
jemten committed Apr 6, 2023
2 parents 12349ff + 3d1f071 commit 124068d
Show file tree
Hide file tree
Showing 8 changed files with 483 additions and 9 deletions.
1 change: 1 addition & 0 deletions definitions/rd_dna_initiation_map.yaml
Expand Up @@ -52,6 +52,7 @@ CHAIN_ALL:
- CHAIN_MOBILE_ELEMENTS:
- me_merge_bam
- retroseq
- me_merge_vcfs
- CHAIN_MAIN:
# PARALLEL chains, which inherit from MAIN in initiation, but are merged back to CHAIN_MAIN after execution
- PARALLEL:
Expand Down
27 changes: 27 additions & 0 deletions definitions/rd_dna_parameters.yaml
Expand Up @@ -227,6 +227,7 @@ recipe_core_number:
manta: 36
markduplicates: 13
me_merge_bam: 5
me_merge_vcfs: 2
mitodel: 1
mt_annotation: 1
multiqc_ar: 1
Expand Down Expand Up @@ -359,6 +360,7 @@ recipe_time:
manta: 30
markduplicates: 20
me_merge_bam: 5
me_merge_vcfs: 2
mitodel: 2
mt_annotation: 1
multiqc_ar: 5
Expand Down Expand Up @@ -1289,6 +1291,31 @@ mobile_element_reference:
is_reference: 1
reference: reference_dir
type: path
me_merge_vcfs:
analysis_mode: case
associated_recipe:
- mip
data_type: SCALAR
default: 1
file_tag: _me
outfile_suffix: ".vcf.gz"
program_executables:
- bgzip
- svdb
- tabix
type: recipe
me_merge_vcfs_overlap:
associated_recipe:
- me_merge_vcfs
data_type: SCALAR
default: 0.5
type: recipe_argument
me_merge_vcfs_bnd_distance:
associated_recipe:
- me_merge_vcfs
data_type: SCALAR
default: 150
type: recipe_argument
## GATK CollectReadCounts
gatk_collectreadcounts:
analysis_mode: sample
Expand Down
27 changes: 27 additions & 0 deletions lib/MIP/Cli/Mip/Analyse/Rd_dna.pm
Expand Up @@ -1174,6 +1174,33 @@ q{Default: hgvs, symbol, numbers, sift, polyphen, humdiv, domains, protein, ccds
)
);

option(
q{me_merge_vcfs} => (
cmd_tags => [q{Analysis recipe switch}],
documentation => q{Merge sample vcfs from RetroSeq},
is => q{rw},
isa => enum( [ 0, 1, 2 ] ),
)
);

option(
q{me_merge_vcfs_bnd_distance} => (
cmd_tags => [q{Default: 150}],
documentation => q{Maximum distance between two similar BNDs},
is => q{rw},
isa => Num,
)
);

option(
q{me_merge_vcfs_overlap} => (
cmd_tags => [q{Default: }],
documentation => q{Overlap required to mege two events},
is => q{rw},
isa => Num,
)
);

option(
q{mobile_element_reference} => (
cmd_tags => [q{file.vcf=TE_type}],
Expand Down
36 changes: 29 additions & 7 deletions lib/MIP/Program/Svdb.pm
Expand Up @@ -34,10 +34,12 @@ sub svdb_merge {

## Function : Perl wrapper for writing svdb merge recipe to $filehandle or return commands array. Based on svdb 1.0.7.
## Returns : @commands
## Arguments: $filehandle => Filehandle to write to
## Arguments: $bnd_distance => Maximum distance between two similar precise breakpoints
## : $filehandle => Filehandle to write to
## : $infile_paths_ref => Infile path {REF}
## : $notag => Do not add the the VARID and set entries to the info field
## : $outfile_path => Outfile path
## : $overlap => Overlap required to merge two events
## : $pass_only => Only merge variants labeled PASS
## : $priority => Priority order of structural variant calls
## : $same_order => Across all input vcf files, the order of the sample columns are the same
Expand All @@ -48,10 +50,12 @@ sub svdb_merge {
my ($arg_href) = @_;

## Flatten argument(s)
my $bnd_distance;
my $filehandle;
my $infile_paths_ref;
my $notag;
my $outfile_path;
my $overlap;
my $pass_only;
my $priority;
my $same_order;
Expand All @@ -60,6 +64,11 @@ sub svdb_merge {
my $stdoutfile_path;

my $tmpl = {
bnd_distance => {
allow => [ undef, qr/ \A \d+ \z /sxm ],
strict_type => 1,
store => \$bnd_distance
},
filehandle => { store => \$filehandle, },
infile_paths_ref => {
default => [],
Expand All @@ -70,7 +79,12 @@ sub svdb_merge {
},
notag => { store => \$notag, strict_type => 1, },
outfile_path => { store => \$outfile_path, strict_type => 1, },
pass_only => {
overlap => {
allow => [ undef, qr/ \A [-]? \d+ | \d+[.]\d+ \z /sxm ],
strict_type => 1,
store => \$overlap
},
pass_only => {
allow => [ undef, 0, 1 ],
store => \$pass_only,
strict_type => 1,
Expand All @@ -96,6 +110,18 @@ sub svdb_merge {
my @commands =
( get_executable_base_command( { base_command => $BASE_COMMAND, } ), qw{ --merge } );

if ($bnd_distance) {

push @commands, q{--bnd_distance} . $SPACE . $bnd_distance;
}
if ($notag) {

push @commands, q{--notag};
}
if ($overlap) {

push @commands, q{--overlap} . $SPACE . $overlap;
}
if ($pass_only) {

push @commands, q{--pass_only},;
Expand All @@ -104,10 +130,6 @@ sub svdb_merge {

push @commands, q{--priority} . $SPACE . $priority;
}
if ($notag) {

push @commands, q{--notag};
}
if ($same_order) {

push @commands, q{--same_order};
Expand Down Expand Up @@ -207,7 +229,7 @@ sub svdb_query {
out_allele_count_tag => { strict_type => 1, store => \$out_allele_count_tag },
out_frequency_tag => { strict_type => 1, store => \$out_frequency_tag },
overlap => {
allow => qr/ \A \d+ | d+[.]d+$ /sxm,
allow => qr/ \A [-]? \d+ | \d+[.]\d+ \z /sxm,
strict_type => 1,
store => \$overlap
},
Expand Down

0 comments on commit 124068d

Please sign in to comment.