Skip to content

Commit

Permalink
Merge pull request #70 from ICGC-TCGA-PanCancer/dev
Browse files Browse the repository at this point in the history
Looks good, happy for release to go ahead
  • Loading branch information
keiranmraine committed Mar 6, 2015
2 parents 51fb0cc + 687d3b2 commit 75add4d
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 35 deletions.
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
1.5.4
bam_stats C
* Reference file parameter is now optional to replicate bam_stats.pl functionality.
* Warnings in help, and when a cram file is given as reference from header may not be found, and bam stats will fail.
1.5.3
bam_stats C - changed array for khash in insert size calculations in order to make code more robust.
Header RG line reading now reads anything not a tab or newline as it should when determining what the values of tags are.
Expand Down
4 changes: 2 additions & 2 deletions MYMETA.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"unknown"
],
"dynamic_config" : 0,
"generated_by" : "ExtUtils::MakeMaker version 6.68, CPAN::Meta::Converter version 2.131560",
"generated_by" : "ExtUtils::MakeMaker version 6.68, CPAN::Meta::Converter version 2.143240",
"license" : [
"gpl_2"
],
Expand Down Expand Up @@ -55,5 +55,5 @@
}
},
"release_status" : "stable",
"version" : "v1.5.3"
"version" : "v1.5.4"
}
48 changes: 24 additions & 24 deletions MYMETA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,38 @@ abstract: unknown
author:
- unknown
build_requires:
ExtUtils::MakeMaker: 0
ExtUtils::MakeMaker: '0'
configure_requires:
ExtUtils::MakeMaker: 0
ExtUtils::MakeMaker: '0'
dynamic_config: 0
generated_by: 'ExtUtils::MakeMaker version 6.68, CPAN::Meta::Converter version 2.131560'
generated_by: 'ExtUtils::MakeMaker version 6.68, CPAN::Meta::Converter version 2.143240'
license: gpl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
version: '1.4'
name: PCAP
no_index:
directory:
- t
- inc
requires:
Bio::DB::Sam: 1.39
Bio::Root::Version: 1.006923
Capture::Tiny: 0.24
Const::Fast: 0.014
Data::UUID: 1.219
Devel::Cover: 1.09
File::Which: 0.05
GD: 2.52
IPC::System::Simple: 1.25
List::Util: 1.38
Math::Gradient: 0.04
Module::Build: 0.42
Pod::Coverage: 0.23
Proc::ProcessTable: 0.5
Sub::Exporter::Progressive: 0.001011
Term::UI: 0.42
Test::Fatal: 0.013
Try::Tiny: 0.19
XML::Simple: 2.2
version: v1.5.3
Bio::DB::Sam: '1.39'
Bio::Root::Version: '1.006923'
Capture::Tiny: '0.24'
Const::Fast: '0.014'
Data::UUID: '1.219'
Devel::Cover: '1.09'
File::Which: '0.05'
GD: '2.52'
IPC::System::Simple: '1.25'
List::Util: '1.38'
Math::Gradient: '0.04'
Module::Build: '0.42'
Pod::Coverage: '0.23'
Proc::ProcessTable: '0.5'
Sub::Exporter::Progressive: '0.001011'
Term::UI: '0.42'
Test::Fatal: '0.013'
Try::Tiny: '0.19'
XML::Simple: '2.2'
version: v1.5.4
2 changes: 1 addition & 1 deletion c/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=1.5.3
VERSION=1.5.4

#Compiler
CC = gcc -O3 -DVERSION='"$(VERSION)"' -g
Expand Down
23 changes: 17 additions & 6 deletions c/bam_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@ void print_version (int exit_code){

void print_usage (int exit_code){

printf ("Usage: bam_stats [-i file] [-o file] [-p plots] [-r reference.fa.fai] [-h] [-v]\n\n");
printf ("Usage: bam_stats -i file -o file [-p plots] [-r reference.fa.fai] [-h] [-v]\n\n");
printf ("-i --input File path to read in.\n");
printf ("-r --ref-file File path to reference index (.fai) file.\n");
printf ("-o --output File path to output.\n\n");
printf ("Optional:\n");
printf ("-r --ref-file File path to reference index (.fai) file.\n");
printf (" NB. If cram format is supplied via -b and the reference listed in the cram header can't be found bam_stats may fail to work correctly.\n");
printf ("-p --plots Folder to contain quality score plots.\n\n");
printf ("Other:\n");
printf ("-h --help Display this usage information.\n");
Expand All @@ -69,6 +70,9 @@ void print_usage (int exit_code){
}

void options(int argc, char *argv[]){

ref_file = NULL;

const struct option long_opts[] =
{
{"version", no_argument, 0, 'v'},
Expand Down Expand Up @@ -128,9 +132,11 @@ void options(int argc, char *argv[]){
printf("Input file (-i) %s does not exist.\n",input_file);
print_usage(1);
}
if(check_exist(ref_file) != 1){
printf("Reference fasta index file (-r) %s does not exist.\n",ref_file);
print_usage(1);
if(ref_file){
if(check_exist(ref_file) != 1){
printf("Reference fasta index file (-r) %s does not exist.\n",ref_file);
print_usage(1);
}
}

return;
Expand Down Expand Up @@ -338,7 +344,12 @@ int main(int argc, char *argv[]){
//Open bam file as object
input = hts_open(input_file,"r");
//Set reference index file
hts_set_fai_filename(input, ref_file);
if(ref_file){
hts_set_fai_filename(input, ref_file);
}else{
if(input->format.format == cram) log_warn("No reference file provided for a cram input file, if the reference described in the cram header can't be located bam_stats may fail.");
}

//Read header from bam file
head = sam_hdr_read(input);
rg_info_t **grps = parse_header(head, &grps_size, &grp_stats);
Expand Down
Binary file modified docs.tar.gz
Binary file not shown.
3 changes: 2 additions & 1 deletion lib/PCAP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use strict;
use Const::Fast qw(const);
use base 'Exporter';

our $VERSION = '1.5.3';
our $VERSION = '1.5.4';
our @EXPORT = qw($VERSION);

const my $LICENSE =>
Expand Down Expand Up @@ -58,6 +58,7 @@ const my %UPGRADE_PATH => ( '0.1.0' => 'biobambam,bwa,samtools',
'1.5.1' => '',
'1.5.2' => '',
'1.5.3' => '',
'1.5.4' => '',
);

sub license {
Expand Down
2 changes: 1 addition & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SOURCE_BWA="https://github.com/lh3/bwa/archive/0.7.10.tar.gz"
SOURCE_SAMTOOLS="https://github.com/samtools/samtools/archive/0.1.20.tar.gz"

# for bamstats
SOURCE_HTSLIB="https://github.com/samtools/htslib/archive/1.1.tar.gz"
SOURCE_HTSLIB="https://github.com/samtools/htslib/archive/1.2.1.tar.gz"

# for bigwig
SOURCE_JKENT_BIN="https://github.com/ENCODE-DCC/kentUtils/raw/master/bin/linux.x86_64"
Expand Down

0 comments on commit 75add4d

Please sign in to comment.