Skip to content

Commit

Permalink
Merge pull request #1844 from Clinical-Genomics/feature/clinical_fusi…
Browse files Browse the repository at this point in the history
…on_report

feat(fusion): produce clinical fusion report
  • Loading branch information
jemten committed Mar 18, 2021
2 parents 4b3ddd5 + 7660092 commit f3d97a2
Show file tree
Hide file tree
Showing 21 changed files with 1,057 additions and 145 deletions.
4 changes: 3 additions & 1 deletion definitions/rd_rna_initiation_map.yaml
Expand Up @@ -13,8 +13,10 @@ CHAIN_ALL:
- star_fusion
- arriba_ar
- megafusion_ar
- svdb_merge_fusion
- fusion_report
- PARALELL:
- svdb_merge_fusion
- merge_fusion_reports
- CHAIN_MAIN:
- star_aln
- picardtools_mergesamfiles
Expand Down
29 changes: 25 additions & 4 deletions definitions/rd_rna_parameters.yaml
Expand Up @@ -6,6 +6,7 @@ custom_default_parameters:
default:
- analysis_type
- conda_path
- fusion_select_file
- infile_dirs
- install_config_file
- pedigree_fam_file
Expand Down Expand Up @@ -146,6 +147,7 @@ recipe_time:
markduplicates: 8
megafusion_ar: 1
multiqc_ar: 1
merge_fusion_reports: 1
picardtools_collectrnaseqmetrics: 2
picardtools_mergesamfiles: 2
preseq_ar: 2
Expand Down Expand Up @@ -206,8 +208,9 @@ recipe_core_number:
genebody_coverage: 1
gffcompare_ar: 1
gzip_fastq: 0
multiqc_ar: 1
markduplicates: 13
merge_fusion_reports: 1
multiqc_ar: 1
picardtools_collectrnaseqmetrics: 1
picardtools_mergesamfiles: 13
preseq_ar: 1
Expand Down Expand Up @@ -457,16 +460,16 @@ arriba_blacklist_path:
data_type: SCALAR
type: path
fusion_report:
analysis_mode: case
analysis_mode: sample
associated_recipe:
- mip
data_type: SCALAR
default: 1
file_tag: _report
outfile_suffix: ".pdf"
program_executables:
- perl
- draw_fusions.R
- pdfmerger
type: recipe
fusion_cytoband_path:
associated_recipe:
Expand All @@ -478,6 +481,13 @@ fusion_proteindomain_path:
- fusion_report
data_type: SCALAR
type: path
fusion_select_file:
associated_recipe:
- fusion_report
data_type: SCALAR
exists_check: file
type: path
update_path: absolute_path
fusion_use_sample_id_as_display_name:
associated_recipe:
- arriba_ar
Expand Down Expand Up @@ -522,13 +532,24 @@ svdb_merge_fusion:
- mip
data_type: SCALAR
default: 1
file_tag: _fusion
file_tag: _fusion_report
outfile_suffix: ".vcf.gz"
program_executables:
- bcftools
- svdb
type: recipe
## Merge bam files
merge_fusion_reports:
analysis_mode: case
associated_recipe:
- mip
data_type: SCALAR
default: 1
file_tag: _report
outfile_suffix: ".pdf"
program_executables:
- pdfmerger
type: recipe
picardtools_mergesamfiles:
analysis_mode: sample
associated_recipe:
Expand Down
5 changes: 3 additions & 2 deletions lib/MIP/Active_parameter.pm
Expand Up @@ -2584,8 +2584,9 @@ sub set_vcfparser_outfile_counter {

## Create link
my %vcfparser_select_file = (
sv_vcfparser => { sv_vcfparser_select_file => q{sv_vcfparser_outfile_count} },
vcfparser_ar => { vcfparser_select_file => q{vcfparser_outfile_count} },
sv_vcfparser => { sv_vcfparser_select_file => q{sv_vcfparser_outfile_count} },
vcfparser_ar => { vcfparser_select_file => q{vcfparser_outfile_count} },
fusion_report => { fusion_select_file => q{fusion_outfile_count} },
);

## Determine if to expect select outfile for vcfparser and sv_vcfparser
Expand Down
18 changes: 18 additions & 0 deletions lib/MIP/Cli/Mip/Analyse/Rd_rna.pm
Expand Up @@ -211,6 +211,24 @@ sub _build_usage {
)
);

option(
q{fusion_select_file} => (
cmd_tags => [q{Format: tsv; HGNC Symbol required in file}],
documentation => q{Select file with list of genes to analyse separately},
is => q{rw},
isa => Str,
)
);

option(
q{merge_fusion_reports} => (
cmd_tags => [q{Analysis recipe switch}],
documentation => q{Merge sample fusion reports to case},
is => q{rw},
isa => enum( [ 0, 1, 2 ] ),
)
);

option(
q{fusion_use_sample_id_as_display_name} => (
cmd_tags => [q{Default: 0}],
Expand Down
18 changes: 18 additions & 0 deletions lib/MIP/Language/Perl.pm
Expand Up @@ -354,6 +354,7 @@ sub perl_nae_oneliners {
q{get_fastq_header_v1.8_interleaved} => \&_get_fastq_header_v1_8_interleaved,
get_fastq_read_length => \&_get_fastq_read_length,
get_gene_panel_header => \&_get_gene_panel_info,
get_gene_panel_hgnc_symbols => \&_get_gene_panel_hgnc_symbols,
get_rrna_transcripts => \&_get_rrna_transcripts,
get_select_contigs_by_col => \&_get_select_contigs_by_col,
get_vcf_header_id_line => \&_get_vcf_header_id_line,
Expand Down Expand Up @@ -763,6 +764,23 @@ sub _get_gene_panel_info {
return $gene_panel_info_regexp;
}

sub _get_gene_panel_hgnc_symbols {

## Function : Return HGNC symbols from gene panel
## Returns : $gene_panel_hgnc_symbols
## Arguments:

my ($arg_href) = @_;

# If line starts with gene panel comment
my $gene_panel_hgnc_symbols = q?'next if (/ \A [#] /xms ); ?;

# Append ":". Skip rest if it's a comment
$gene_panel_hgnc_symbols .= q?print $F[4]'?;

return $gene_panel_hgnc_symbols;
}

sub _reformat_sacct_headers {

## Function : Write individual job line - skip line containing (.batch or .bat+) in the first column
Expand Down
7 changes: 7 additions & 0 deletions lib/MIP/Parameter.pm
Expand Up @@ -945,6 +945,13 @@ sub set_custom_default_to_active_parameter {
parameter_href => $parameter_href,
},
},
fusion_select_file => {
method => \&set_default_vcfparser_select_file,
arg_href => {
active_parameter_href => $active_parameter_href,
parameter_name => $parameter_name,
},
},
infile_dirs => {
method => \&set_default_infile_dirs,
arg_href => {
Expand Down
6 changes: 3 additions & 3 deletions lib/MIP/Program/Gnu/Software/Gnu_grep.pm
Expand Up @@ -15,7 +15,7 @@ use autodie qw{ :all };
use Readonly;

## MIPs lib/
use MIP::Constants qw{ $SPACE };
use MIP::Constants qw{ $EQUALS $SPACE };
use MIP::Unix::Standard_streams qw{ unix_standard_streams };
use MIP::Unix::Write_to_file qw{ unix_write_to_file };

Expand Down Expand Up @@ -113,12 +113,12 @@ sub gnu_grep {
}
if ($filter_file_path) {

push @commands, q{--file=} . $filter_file_path;
push @commands, q{--file} . $EQUALS . $filter_file_path;
}

if ($pattern) {

push @commands, $pattern;
push @commands, q{--regexp} . $EQUALS . $pattern;
}

## Infile
Expand Down

0 comments on commit f3d97a2

Please sign in to comment.