Skip to content

Commit

Permalink
Merge pull request #34 from ICGC-TCGA-PanCancer/dev
Browse files Browse the repository at this point in the history
v1.0.3 - maintenance release
  • Loading branch information
keiranmraine committed May 7, 2014
2 parents b3ebd97 + a987ec4 commit 188bedb
Show file tree
Hide file tree
Showing 47 changed files with 129 additions and 100 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
/MANIFEST.bak
/install_tmp
/setup.log
/reports
6 changes: 6 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
1.0.3
Corrected issue from dynamic de-reference of hash, issue fort pre 5.14 perl
and potentially unstable in future.
Added missing project code to cv terms.
Bug-fixed upgrade path, still needs better solution.
Cleaned up messaging in Threaded module.
1.0.2
Upgrade install to pull biobambam 0.0.138
- fastqtobam option 'pairedfile' for where readnames don't have trailing '/1' or '/2'.
Expand Down
60 changes: 30 additions & 30 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,36 @@ share/cv_tables/ICGC/dcc_specimen_type.txt
t/1_pm_compile.t
t/2_pl_compile.t
t/3_external_progs.t
t/data/1.fq
t/data/1_1.fq
t/data/1_2.fq
t/data/2_1.fq
t/data/3_2.fq
t/data/data.file
t/data/empty.bam
t/data/empty.bam.bas
t/data/empty.file
t/data/empty.fq
t/data/empty_r1_1.fq
t/data/empty_r1_2.fq
t/data/empty_r2_1.fq
t/data/empty_r2_2.fq
t/data/header.bam
t/data/header.sam
t/data/malformed_head.bam
t/data/malformed_head.sam
t/data/md5.bam
t/data/md5.bam.md5
t/data/multi_sample.bam
t/data/multi_sample.sam
t/data/no_readgroups.bam
t/data/no_readgroups.sam
t/data/not_really_a.bam
t/data/paired.bam
t/data/Stats.bam
t/data/Stats.bam.bas
t/data/test.bam.bas
t/data/unpaired.bam
t/pcap.t
t/pcapBam.t
t/pcapBamBas.t
Expand All @@ -38,33 +68,3 @@ t/pcapBwaMeta.t
t/pcapCli.t
t/pcapSra.t
t/pcapThreaded.t
testData/1.fq
testData/1_1.fq
testData/1_2.fq
testData/2_1.fq
testData/3_2.fq
testData/data.file
testData/empty.bam
testData/empty.bam.bas
testData/empty.file
testData/empty.fq
testData/empty_r1_1.fq
testData/empty_r1_2.fq
testData/empty_r2_1.fq
testData/empty_r2_2.fq
testData/header.bam
testData/header.sam
testData/malformed_head.bam
testData/malformed_head.sam
testData/md5.bam
testData/md5.bam.md5
testData/multi_sample.bam
testData/multi_sample.sam
testData/no_readgroups.bam
testData/no_readgroups.sam
testData/not_really_a.bam
testData/paired.bam
testData/Stats.bam
testData/Stats.bam.bas
testData/test.bam.bas
testData/unpaired.bam
2 changes: 1 addition & 1 deletion MYMETA.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@
}
},
"release_status" : "stable",
"version" : "v1.0.1"
"version" : "v1.0.3"
}
2 changes: 1 addition & 1 deletion MYMETA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ requires:
Term::UI: 0.42
Test::Fatal: 0.013
Try::Tiny: 0.19
version: v1.0.1
version: v1.0.3
5 changes: 4 additions & 1 deletion bin/bwa_aln.pl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ BEGIN
use Pod::Usage qw(pod2usage);
use List::Util qw(first);
use Const::Fast qw(const);
use File::Copy qw(move);

use PCAP::Cli;
use PCAP::Threaded;
Expand Down Expand Up @@ -75,7 +76,9 @@ BEGIN
}

sub cleanup {
my $tmpdir = shift->{'tmp'};
my $options = shift;
my $tmpdir = $options->{'tmp'};
move(File::Spec->catdir($tmpdir, 'logs'), File::Spec->catdir($options->{'outdir'}, 'logs')) || die $!;
remove_tree $tmpdir if(-e $tmpdir);
return 0;
}
Expand Down
6 changes: 4 additions & 2 deletions bin/bwa_mem.pl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ BEGIN
use Pod::Usage qw(pod2usage);
use List::Util qw(first);
use Const::Fast qw(const);
use File::Copy qw(copy);
use File::Copy qw(copy move);

use PCAP::Cli;
use PCAP::Bam;
Expand Down Expand Up @@ -79,7 +79,9 @@ BEGIN
}

sub cleanup {
my $tmpdir = shift->{'tmp'};
my $options = shift;
my $tmpdir = $options->{'tmp'};
move(File::Spec->catdir($tmpdir, 'logs'), File::Spec->catdir($options->{'outdir'}, 'logs')) || die $!;
remove_tree $tmpdir if(-e $tmpdir);
return 0;
}
Expand Down
Binary file modified docs.tar.gz
Binary file not shown.
15 changes: 8 additions & 7 deletions lib/PCAP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ package PCAP;
use strict;
use Const::Fast qw(const);

our $VERSION = '1.0.1';
our $VERSION = '1.0.3';

const my $LICENSE =>
"#################
Expand All @@ -35,13 +35,14 @@ const my $LICENSE =>
const my $DEFAULT_PATH => 'biobambam,samtools,bwa';
const my %UPGRADE_PATH => ( '0.1.0' => 'biobambam,samtools,bwa',
'0.1.1' => 'biobambam,bwa',
'0.1.2' => 'biobambam',
'0.2.0' => 'biobambam',
'0.2.99' => 'biobambam',
'0.3.0' => 'biobambam',
'1.0.0' => 'biobambam',
'0.1.2' => 'biobambam,bwa',
'0.2.0' => 'biobambam,bwa',
'0.2.99' => 'biobambam,bwa',
'0.3.0' => 'biobambam,bwa',
'1.0.0' => 'biobambam,bwa',
'1.0.1' => 'biobambam,bwa',
'1.0.2' => '',
'1.0.2' => 'biobambam,bwa',
'1.0.3' => '',
);

sub license {
Expand Down
2 changes: 1 addition & 1 deletion lib/PCAP/Bam/Bas.pm
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ sub bas_keys {
}

sub read_groups {
return (sort keys shift->{'_data'});
return (sort keys %{shift->{'_data'}});
}

sub get {
Expand Down
34 changes: 26 additions & 8 deletions lib/PCAP/Threaded.pm
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,24 @@ sub touch_success {
}

sub external_process_handler {
my ($tmp, $command, @indexes) = @_;
my ($tmp, $command_in, @indexes) = @_;

my @commands;
if(ref $command_in eq 'ARRAY') {
@commands = @{$command_in}
}
else {
@commands = ($command_in);
}

if(&use_out_err == 0) {
# these may be marshalled to different files so output both
warn "Errors from command: $command\n";
print "Output from command: $command\n";
try {
system($command);
for my $c(@commands) {
warn "\nErrors from command: $c\n\n";
print "\nOutput from command: $c\n\n";
system($c);
}
}
catch { die $_; };
}
Expand All @@ -191,10 +201,12 @@ sub external_process_handler {

my $out_fh = IO::File->new($out, "w+");
my $err_fh = IO::File->new($err, "w+");
print $err_fh "Errors from command: $command\n";
print $out_fh "Output from command: $command\n";
try {
capture { system($command); } stdout => $out_fh, stderr => $err_fh;
for my $c(@commands) {
print $err_fh "\nErrors from command: $c\n\n";
print $out_fh "\nOutput from command: $c\n\n";
capture { system($c); } stdout => $out_fh, stderr => $err_fh;
}
} catch {
die $_ if($_);
};
Expand Down Expand Up @@ -313,11 +325,17 @@ Requires implementation of L<success_exists()|PCAP::Threaded/touch_success>.
=item external_process_handler
PCAP::Threaded::external_process_handler(File::Spec->catdir($tmp, 'logs'), $command, $index[, $index_2...]);
PCAP::Threaded::external_process_handler($logdir, $commands, $index[, $index_2...]);
@params logdir - Path to pre-existing log directory
@params commands - Scalar command or arr-ref of commands
@params index - Which index this is, specifically for log/err files.
Wraps up command with stdout and stderr catchalls to keep the output of each threaded process
separated from the script itself. Added to simplify interpretation of any issues that may occur.
If you don't want to capture stdout/stderr see <disable_out_err>.
($index_2... may be useful for some other implementation, see L<bwa_aln()|PCAP::Bwa/bwa_aln>).
=back
Expand Down
83 changes: 42 additions & 41 deletions share/cv_tables/ICGC/dcc_project_code.txt
Original file line number Diff line number Diff line change
@@ -1,72 +1,73 @@
dcc_project_code
ALL-US
BLCA-CN
BLCA-US
LAML-US
LAML-KR
CLLE-ES
CMDI-UK
MALY-DE
NHLY-MX
BOCA-UK
GBM-US
LGG-US
PBCA-DE
PEME-CA
BRCA-CN
BRCA-EU
BRCA-FR
BRCA-KR
BRCA-US
BRCA-EU
BRCA-UK
BRCA-MX
BRCA-UK
BRCA-US
BTCA-SG
CESC-US
CLLE-ES
CMDI-UK
COAD-US
COCA-CN
READ-US
EOPC-DE
ESAD-UK
ESCA-CN
HNSC-US
THCA-US
ORCA-IN
THCA-SA
GACA-CN
GBM-CN
GBM-US
HNCA-MX
HNSC-US
KIRC-US
KIRP-US
RECA-EU
LAML-CN
LAML-KR
LAML-US
LGG-US
LICA-CN
LICA-FR
LIHC-US
LINC-JP
LIRI-JP
LIHC-US
LUAD-US
LUCA-DE
LUSC-CN
LUSC-KR
LUSC-US
MALY-DE
NACA-CN
NBL-US
NHLY-MX
ORCA-IN
OV-AU
OV-CN
OV-US
PAAD-US
PACA-AU
PACA-CA
PACA-CN
PACA-IT
PAAD-US
EOPC-DE
PAEN-AU
PBCA-DE
PEME-CA
PRAD-CA
PRAD-US
PRAD-CN
PRAD-UK
SKCM-US
STAD-US
GACA-CN
UCEC-US
ALL-US
PAEN-AU
LUCA-DE
PRAD-US
PRCA-FR
SKCA-BR
BLCA-CN
LAML-CN
GBM-CN
BRCA-CN
LUSC-CN
OV-CN
PACA-CN
PRAD-CN
READ-US
RECA-CN
RECA-EU
SKCA-BR
SKCM-US
STAD-US
THCA-CN
LUSC-KR
NBL-US
THCA-SA
THCA-US
UCEC-US
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion t/pcapBam.t
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const my $EXPECTED_MULTI_RG => [ {'CN' => 'SANGER',
} ];

use FindBin qw($Bin);
my $test_data = "$Bin/../testData";
my $test_data = "$Bin/data";

# if you need to change the header.bam
# edit header.sam then:
Expand Down
2 changes: 1 addition & 1 deletion t/pcapBamBas.t
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const my $EXP_MEDIAN => '462.000';
const my $RG_ORDER => [qw(1 2 3 4 5 6)];

use FindBin qw($Bin);
my $test_data = "$Bin/../testData";
my $test_data = "$Bin/data";

my $bas = File::Spec->catfile($test_data, 'test.bam.bas');
my $empty_bas = File::Spec->catfile($test_data, 'empty.bam.bas');
Expand Down
2 changes: 1 addition & 1 deletion t/pcapBamStats.t
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use Bio::DB::Sam;

const my $MODULE => 'PCAP::Bam::Stats';

my $test_data = "$Bin/../testData";
my $test_data = "$Bin/data";
my $test_bam_file = join('/',$test_data,'Stats.bam');
my $test_bas_file = join('/',$test_data,'Stats.bam.bas');

Expand Down
Loading

0 comments on commit 188bedb

Please sign in to comment.