Skip to content

Commit

Permalink
Merge pull request #1838 from Clinical-Genomics/feature/pdfmerger
Browse files Browse the repository at this point in the history
Feature/pdfmerger
  • Loading branch information
jemten committed Mar 10, 2021
2 parents 2769eb6 + 58d0ae1 commit 48754c0
Show file tree
Hide file tree
Showing 19 changed files with 800 additions and 118 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ chanjo: 4.2.0 -> 4.6
deepvariant: 1.0.0
glnexus: v1.2.7
htslib: 1.10.2-h78d89cc_0 -> 1.11-hd3b49d5_2
pdfmerger: v1.0
picardtools: 2.23.4 -> 2.25.0
sambamba: 0.6.8-h682856c_0 -> 0.8.0-h984e79f_0
samtools: 1.10-h9402c20_2 -> 1.11-h6270b1f_0
Expand Down
2 changes: 1 addition & 1 deletion definitions/install_parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ rd_rna:
- mip
- mip_scripts
- multiqc
- pdfmerger
- picard
- preseq
- python
- rseqc
- salmon
- sambamba
- star
- star-fusion
- stringtie
Expand Down
1 change: 1 addition & 0 deletions definitions/rd_rna_initiation_map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ CHAIN_ALL:
- arriba_ar
- megafusion_ar
- svdb_merge_fusion
- fusion_report
- CHAIN_MAIN:
- star_aln
- picardtools_mergesamfiles
Expand Down
29 changes: 21 additions & 8 deletions definitions/rd_rna_parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ recipe_time:
bootstrapann: 2
dna_vcf_reformat: 1
fastqc_ar: 1
fusion_report: 1
gatk_asereadcounter: 2
gatk_baserecalibration: 5
gatk_haplotypecaller: 6
Expand Down Expand Up @@ -196,6 +197,7 @@ recipe_core_number:
bootstrapann: 1
dna_vcf_reformat: 1
fastqc_ar: 0
fusion_report: 1
gatk_asereadcounter: 1
gatk_baserecalibration: 13
gatk_haplotypecaller: 13
Expand Down Expand Up @@ -447,25 +449,36 @@ arriba_ar:
outfile_suffix: ".tsv"
program_executables:
- arriba
- draw_fusions.R
- sambamba
- samtools
type: recipe
arriba_blacklist_path:
associated_recipe:
- arriba_ar
- fusion_report
data_type: SCALAR
type: path
arriba_cytoband_path:
fusion_report:
analysis_mode: case
associated_recipe:
- arriba_ar
- mip
data_type: SCALAR
default: 1
file_tag: _report
outfile_suffix: ".pdf"
program_executables:
- draw_fusions.R
- pdfmerger
type: recipe
fusion_cytoband_path:
associated_recipe:
- fusion_report
data_type: SCALAR
type: path
arriba_proteindomain_path:
fusion_proteindomain_path:
associated_recipe:
- arriba_ar
- fusion_report
data_type: SCALAR
type: path
arriba_use_sample_id_as_display_name:
fusion_use_sample_id_as_display_name:
associated_recipe:
- arriba_ar
data_type: SCALAR
Expand Down
58 changes: 38 additions & 20 deletions lib/MIP/Cli/Mip/Analyse/Rd_rna.pm
Original file line number Diff line number Diff line change
Expand Up @@ -131,27 +131,9 @@ sub _build_usage {
);

option(
q{arriba_cytoband_path} => (
cmd_tags => [q{Recipe argument}],
documentation => q{Path to arriba cytoband file},
is => q{rw},
isa => Str,
)
);

option(
q{arriba_proteindomain_path} => (
cmd_tags => [q{Recipe argument}],
documentation => q{Path to arriba protein domain file},
is => q{rw},
isa => Str,
)
);

option(
q{arriba_use_sample_id_as_display_name} => (
q{fusion_use_sample_id_as_display_name} => (
cmd_tags => [q{Default: 0}],
documentation => q{Use sample id as display name for arriba fusion report},
documentation => q{Use sample id as display name for fusion report},
is => q{rw},
isa => Bool,
)
Expand Down Expand Up @@ -202,6 +184,42 @@ sub _build_usage {
)
);

option(
q{fusion_report} => (
cmd_tags => [q{Analysis recipe switch}],
documentation => q{Generate fusion report from Arriba calls},
is => q{rw},
isa => enum( [ 0, 1, 2 ] ),
)
);

option(
q{fusion_cytoband_path} => (
cmd_tags => [q{Recipe argument}],
documentation => q{Path to cytoband file},
is => q{rw},
isa => Str,
)
);

option(
q{fusion_proteindomain_path} => (
cmd_tags => [q{Recipe argument}],
documentation => q{Path to protein domain file},
is => q{rw},
isa => Str,
)
);

option(
q{fusion_use_sample_id_as_display_name} => (
cmd_tags => [q{Default: 0}],
documentation => q{Use sample id as display name for fusion report},
is => q{rw},
isa => Bool,
)
);

option(
q{gatk_disable_auto_index_and_file_lock} => (
cmd_flag => q{gatk_dis_auto_ind_fl},
Expand Down
16 changes: 8 additions & 8 deletions lib/MIP/Cli/Mip/Install.pm
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ sub _build_usage {
[
qw{ arriba bedtools blobfish bootstrapann bwa bwakit bwa-mem2 cadd chanjo
chromograph cnvnator cyrius deeptrio deepvariant delly expansionhunter fastqc gatk
gatk4 genmod gffcompare glnexus htslib manta megafusion mip mip_scripts multiqc peddy
picard plink preseq python rhocall rseqc rtg-tools salmon sambamba smncopynumbercaller
star star-fusion stranger stringtie svdb telomerecat tiddit trim-galore ucsc upd
utilities varg vcf2cytosure vcfanno vep vts }
gatk4 genmod gffcompare glnexus htslib manta megafusion mip mip_scripts multiqc
pdfmerger peddy picard plink preseq python rhocall rseqc rtg-tools salmon sambamba
smncopynumbercaller star star-fusion stranger stringtie svdb telomerecat tiddit
trim-galore ucsc upd utilities varg vcf2cytosure vcfanno vep vts }
]
),
],
Expand All @@ -154,10 +154,10 @@ sub _build_usage {
[
qw{ arriba bedtools blobfish bootstrapann bwa bwakit bwa-mem2 cadd chanjo
chromograph cnvnator cyrius deeptrio deepvariant delly expansionhunter fastqc gatk
gatk4 genmod gffcompare glnexus htslib manta megafusion mip mip_scripts multiqc peddy
picard plink preseq python rhocall rseqc rtg-tools salmon sambamba smncopynumbercaller
star star-fusion stranger stringtie svdb telomerecat tiddit trim-galore ucsc upd
utilities varg vcf2cytosure vcfanno vep vts }
gatk4 genmod gffcompare glnexus htslib manta megafusion mip mip_scripts multiqc
pdfmerger peddy picard plink preseq python rhocall rseqc rtg-tools salmon sambamba
smncopynumbercaller star star-fusion stranger stringtie svdb telomerecat tiddit
trim-galore ucsc upd utilities varg vcf2cytosure vcfanno vep vts }
]
),
],
Expand Down
147 changes: 147 additions & 0 deletions lib/MIP/Program/Pdfmerger.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
package MIP::Program::Pdfmerger;

use 5.026;
use Carp;
use charnames qw{ :full :short };
use English qw{ -no_match_vars };
use open qw{ :encoding(UTF-8) :std };
use Params::Check qw{ allow check last_error };
use utf8;
use warnings;
use warnings qw{ FATAL utf8 };

## CPANM
use autodie qw{ :all };
use Readonly;

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

BEGIN {
require Exporter;
use base qw{ Exporter };

# Set the version for version checking
# Functions and variables which can be optionally exported
our @EXPORT_OK = qw{ pdfmerger };
}

Readonly my $BASE_COMMAND => q{pdfmerger};

sub pdfmerger {

## Function : Perl wrapper for generic commands module
## Returns : @commands
## Arguments: $filehandle => Filehandle to write to
## : $infile_paths_ref => Infile paths {REF}
## : $orientation => Orientation
## : $outdir_path => Out directory path
## : $outfile_name => Out file name
## : $stderrfile_path => Stderrfile path
## : $stderrfile_path_append => Append stderr info to file path
## : $stdinfile_path => Stdinfile path
## : $stdoutfile_path => Stdoutfile path
## : $write_filenames => Write filenames

my ($arg_href) = @_;

## Flatten argument(s)
my $filehandle;
my $infile_paths_ref;
my $orientation;
my $outdir_path;
my $outfile_name;
my $stderrfile_path;
my $stderrfile_path_append;
my $stdinfile_path;
my $stdoutfile_path;
my $write_filenames;

my $tmpl = {
filehandle => {
store => \$filehandle,
},
infile_paths_ref => {
required => 1,
default => [],
store => \$infile_paths_ref,
strict_type => 1,
},
orientation => {
allow => [qw{ landscape portrait }],
required => 1,
store => \$orientation,
strict_type => 1,
},
outdir_path => {
required => 1,
store => \$outdir_path,
strict_type => 1,
},
outfile_name => {
required => 1,
store => \$outfile_name,
strict_type => 1,
},
stderrfile_path => {
store => \$stderrfile_path,
strict_type => 1,
},
stderrfile_path_append => {
store => \$stderrfile_path_append,
strict_type => 1,
},
stdinfile_path => { store => \$stdinfile_path, strict_type => 1, },
stdoutfile_path => {
store => \$stdoutfile_path,
strict_type => 1,
},
write_filenames => {
allow => [ undef, 0, 1 ],
store => \$write_filenames,
strict_type => 1,
},
};

check( $tmpl, $arg_href, 1 ) or croak q{Could not parse arguments!};

my @commands = ( get_executable_base_command( { base_command => $BASE_COMMAND, } ) );

push @commands, join $SPACE, map { q{--infile} . $SPACE . $_ } @{$infile_paths_ref};

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

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

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

if ($write_filenames) {

push @commands, q{--write-filenames};
}

push @commands,
unix_standard_streams(
{
stderrfile_path => $stderrfile_path,
stderrfile_path_append => $stderrfile_path_append,
stdinfile_path => $stdinfile_path,
stdoutfile_path => $stdoutfile_path,
}
);

unix_write_to_file(
{
commands_ref => \@commands,
filehandle => $filehandle,
separator => $SPACE,

}
);
return @commands;
}

1;
Loading

0 comments on commit 48754c0

Please sign in to comment.