Skip to content

Commit

Permalink
Merge 333cbcd into 4802f52
Browse files Browse the repository at this point in the history
  • Loading branch information
jemten committed Apr 12, 2021
2 parents 4802f52 + 333cbcd commit 6d47af4
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 13 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ This project adheres to [Semantic Versioning](http://semver.org/).

arriba: v1.2.0 -> v2.1.0
bedtools: 2.29.0 -> 2.30.0
bcftools: 1.10.2-hd2cd319_0 -> 1.11-h7c999a4_0
bcftools: 1.10.2-hd2cd319_0 -> 1.12=h45bccc9_1
bwa-mem2 2.0 -> 2.2
chanjo: 4.2.0 -> 4.6
cyrius: v1.0 -> v1.1
deepvariant: 1.0.0
delly: 0.8.1 -> 0.8.7
gatk: v4.1.8.1 -> v4.2.0.0
glnexus: v1.3.1
htslib: 1.10.2-h78d89cc_0 -> 1.11-hd3b49d5_2
htslib: 1.10.2-h78d89cc_0 -> 1.12=h9093b5e_1
pdfmerger: v1.0
picardtools: 2.23.4 -> 2.25.0
samtools: 1.10-h9402c20_2 -> 1.11-h6270b1f_0
samtools: 1.10-h9402c20_2 -> 1.12=h9aed4be_1
smncopynumbercaller: 4b2c1ad -> v1.1.1
star: 2.7.4a -> 2.7.8a
stranger: 0.7 -> 0.7.1
Expand Down
8 changes: 4 additions & 4 deletions containers/htslib/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ FROM clinicalgenomics/mip_base:2.1
################## METADATA ######################

LABEL base_image="clinicalgenomics/mip_base:2.1"
LABEL version="3"
LABEL version="4"
LABEL software="htslib"
LABEL software.version="1.11"
LABEL software.version="1.12"
LABEL extra.binaries="bcftools, bgzip, samtools, tabix"
LABEL maintainer="Clinical-Genomics/MIP"

RUN conda install bcftools=1.11=h7c999a4_0 htslib=1.11=hd3b49d5_2 samtools=1.11=h6270b1f_0
RUN conda install bcftools=1.12=h45bccc9_1 htslib=1.12=h9093b5e_1 samtools=1.12=h9aed4be_1

## Clean up after conda
RUN /opt/conda/bin/conda clean -tipsy
RUN /opt/conda/bin/conda clean -ya

WORKDIR /data/
2 changes: 1 addition & 1 deletion documentation/Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ You can speed up, for instance, the Readonly module by also installing the compa
- [GENMOD] (version: 3.7.3)
- [Gffcompare] (version: 0.11.2)
- [Glnexus] (version: 1.3.1)
- [Htslib] (version: 1.11)
- [Htslib] (version: 1.12)
- [Manta] (version: 1.6.0)
- [Megafusion] (version: cc6676c)
- [MultiQC] (version: 1.9)
Expand Down
40 changes: 38 additions & 2 deletions lib/MIP/Program/Bcftools.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use autodie qw{ :all };
use Readonly;

## MIPs lib/
use MIP::Constants qw{ $COMMA $DOUBLE_QUOTE $NEWLINE $PIPE $SPACE };
use MIP::Constants qw{ $ASTERISK $BACKWARD_SLASH $COMMA $DOUBLE_QUOTE $DOT $NEWLINE $PIPE $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 };
Expand Down Expand Up @@ -1124,10 +1124,13 @@ sub bcftools_norm {

## Function : Perl wrapper for writing bcftools norm recipe to $filehandle or return commands array. Based on bcftools 1.6.
## Returns : @commands
## Arguments: $filehandle => Filehandle to write to
## Arguments: $atomize => Decompose complex variants e.g. split MNVs into consecutive SNVs
## : $atom_overlaps => Use "." or "*" for missing allele when decomposing complex varaiants
## : $filehandle => Filehandle to write to
## : $infile_path => Infile path to read from
## : $multiallelic => To split/join multiallelic calls or not
## : $multiallelic_type => Type of multiallelic to split/join {OPTIONAL}
## : $old_rec_tag => Annotate the decomposed records with the orignal record
## : $outfile_path => Outfile path to write to
## : $output_type => 'b' compressed BCF; 'u' uncompressed BCF; 'z' compressed VCF; 'v' uncompressed VCF [v]
## : $reference_check => Controls how to treat incorrect reference alleles - 's' fix; 'w' warn; 'x' exclude; 'e' exit
Expand All @@ -1144,9 +1147,12 @@ sub bcftools_norm {
my ($arg_href) = @_;

## Flatten argument(s)
my $atomize;
my $atom_overlaps;
my $filehandle;
my $infile_path;
my $multiallelic;
my $old_rec_tag;
my $outfile_path;
my $reference_check;
my $reference_path;
Expand All @@ -1164,6 +1170,16 @@ sub bcftools_norm {
my $output_type;

my $tmpl = {
atomize => {
allow => [ undef, 0, 1 ],
store => \$atomize,
strict_type => 1,
},
atom_overlaps => {
allow => [ undef, $DOT, $BACKWARD_SLASH . $ASTERISK ],
store => \$atom_overlaps,
strict_type => 1,
},
filehandle => { store => \$filehandle, },
infile_path => { store => \$infile_path, strict_type => 1, },
multiallelic => {
Expand All @@ -1177,6 +1193,11 @@ sub bcftools_norm {
store => \$multiallelic_type,
strict_type => 1,
},
old_rec_tag => {
allow => [ undef, 0, 1 ],
store => \$old_rec_tag,
strict_type => 1,
},
outfile_path => {
store => \$outfile_path,
strict_type => 1,
Expand Down Expand Up @@ -1237,11 +1258,26 @@ sub bcftools_norm {
}
);

if ($atomize) {

push @commands, q{--atomize};
}

if ($atom_overlaps) {

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

if ($multiallelic) {

push @commands, q{--multiallelics} . $SPACE . $multiallelic . $multiallelic_type;
}

if ($old_rec_tag) {

push @commands, q{--old-rec-tag};
}

if ($reference_check) {

push @commands, q{--check-ref} . $SPACE . $reference_check;
Expand Down
14 changes: 13 additions & 1 deletion t/bcftools_norm.t
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use Readonly;

## MIPs lib/
use lib catdir( dirname($Bin), q{lib} );
use MIP::Constants qw{ $COMMA $SPACE };
use MIP::Constants qw{ $ASTERISK $BACKWARD_SLASH $COMMA $SPACE };
use MIP::Test::Commands qw{ test_function };

BEGIN {
Expand Down Expand Up @@ -80,6 +80,14 @@ my %required_argument = (
);

my %specific_argument = (
atomize => {
input => 1,
expected_output => q{--atomize},
},
atom_overlaps => {
input => $BACKWARD_SLASH . $ASTERISK,
expected_output => q{--atom_overlaps} . $SPACE . $BACKWARD_SLASH . $ASTERISK,
},
infile_path => {
input => q{infile.test},
expected_output => q{infile.test},
Expand All @@ -88,6 +96,10 @@ my %specific_argument = (
input => q{snps},
expected_output => q{--multiallelics +snps},
},
old_rec_tag => {
input => 1,
expected_output => q{--old-rec-tag},
},
output_type => {
input => q{v},
expected_output => q{--output-type v},
Expand Down
2 changes: 1 addition & 1 deletion t/data/test_data/miptest_install_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ container:
bgzip:
samtools:
tabix:
uri: docker.io/clinicalgenomics/htslib:1.11
uri: docker.io/clinicalgenomics/htslib:1.12
manta:
executable:
configManta.py:
Expand Down
2 changes: 1 addition & 1 deletion templates/mip_install_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ container:
bgzip:
samtools:
tabix:
uri: docker.io/clinicalgenomics/htslib:1.11
uri: docker.io/clinicalgenomics/htslib:1.12
manta:
executable:
configManta.py:
Expand Down

0 comments on commit 6d47af4

Please sign in to comment.